Embeddings
A request object for generating embeddings. This object contains suggested parameters to generate an embedding from the specified model; however, you may include other parameters as required. Note that not all providers support the same set of parameters. Adding unsupported or unnecessary parameters can cause requests to fail or limit the providers able to process them.
The provider preference for handling the request.
The providers that are allowed to be used for the completion.
["mistral","scaleway"]Whether to consider only providers based and regulated withing the EU. Even when false, all our endpoints are GDPR compliant.
falseWhether to allow quantized endpoints.
trueWhether to use only ZDR providers.
Whether to allow model fallback when a model is currently unavailable.
The providers that are allowed to be used for the completion.
["bge-m3"]The model to use for the embedding.
mistral-embedA single input to embed.
Please embed this sentence.A list of inputs to embed.
["First sentence to embed.","Second sentence to embed."]The encoding to use for the output.
floatExample: floatPossible values: An embedding.
The unique identifier for the completion
cmpl_1234567890The type of object returned
listThe timestamp when the completion was created
1715155200The provider that generated the completion
mistralThe model that generated the embedding
mistral-embedInternal server error.
POST /v1/embeddings HTTP/1.1
Host: api.cortecs.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 282
{
"preference": "speed",
"allowed_providers": [
"mistral",
"scaleway"
],
"eu_native": false,
"allow_quantization": true,
"allow_zero_data_retention": true,
"enable_model_fallback": true,
"fallbacks": [
"bge-m3"
],
"model": "mistral-embed",
"input": "Please embed this sentence.",
"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