Embeddings
This endpoint creates an embedding using the specified model.
Authorizations
Body
A request object for generating embeddings. This object contains all necessary parameters to generate an embedding from the specified model.
modelstringOptionalExample:
The model to use for the embedding.
mistral-embed
inputone ofOptional
stringOptionalExample:
A single input to embed.
Please embed this sentence.
string[]OptionalExample:
A list of inputs to embed.
["First sentence to embed.","Second sentence to embed."]
preferencestring · enumOptionalDefault:
The provider preference for handling the request.
balanced
Example: balanced
Possible values: encoding_formatstring · enumOptionalDefault:
The encoding to use for the output.
float
Example: float
Possible values: Responses
200
An embedding.
application/json
500
Internal server error.
post
POST /api/v1/models/serverless/embeddings HTTP/1.1
Host: cortecs.ai
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 113
{
"model": "mistral-embed",
"input": "Please embed this sentence.",
"preference": "balanced",
"encoding_format": "float"
}
{
"id": "cmpl_1234567890",
"object": "list",
"created": 1715155200,
"provider": "mistral",
"model": "mistral-embed",
"data": [
{
"index": 0,
"object": "embedding",
"embedding": [
0.1,
0.2,
0.3
]
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 0,
"total_tokens": 10
}
}
Last updated