Embeddings
This endpoint creates an embedding using the specified model.
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 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 provider preference for handling the request.
balancedPossible values: The providers that are allowed to be used for the embedding.
["mistral","scaleway"]Whether to consider only providers based and regulated withing the EU. Even when false, all our endpoints are GDPR compliant.
falseExample: falseWhether to allow quantized endpoints.
trueExample: trueThe encoding to use for the output.
floatExample: floatPossible values: An embedding.
Internal server error.
POST /v1/embeddings HTTP/1.1
Host: api.cortecs.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 200
{
"model": "mistral-embed",
"input": "Please embed this sentence.",
"preference": "balanced",
"allowed_providers": [
"mistral",
"scaleway"
],
"eu_native": false,
"allow_quantization": true,
"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