For the complete documentation index, see llms.txt. This page is also available as Markdown.

Embeddings

Create an embedding

post

This endpoint creates an embedding using the specified model.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

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.

preferencestring · enumOptional

The provider preference for handling the request.

Possible values:
allowed_providersstring[] · nullableOptional

The providers that are allowed to be used for the completion.

Example: ["mistral","scaleway"]
eu_nativeboolean · nullableOptional

Whether to consider only providers based and regulated withing the EU. Even when false, all our endpoints are GDPR compliant.

Example: false
allow_quantizationboolean · nullableOptional

Whether to allow quantized endpoints.

Example: true
allow_zero_data_retentionboolean · nullableOptional

Whether to use only ZDR providers.

enable_model_fallbackboolean · nullableOptional

Whether to allow model fallback when a model is currently unavailable.

fallbacksstring[] · nullableOptional

The providers that are allowed to be used for the completion.

Example: ["bge-m3"]
modelstringOptional

The model to use for the embedding.

Example: mistral-embed
inputone ofOptional
stringOptional

A single input to embed.

Example: Please embed this sentence.
or
string[]Optional

A list of inputs to embed.

Example: ["First sentence to embed.","Second sentence to embed."]
encoding_formatstring · enumOptional

The encoding to use for the output.

Default: floatExample: floatPossible values:
Responses
200

An embedding.

application/json
idstringOptional

The unique identifier for the completion

Example: cmpl_1234567890
objectstringOptional

The type of object returned

Example: list
createdintegerOptional

The timestamp when the completion was created

Example: 1715155200
providerstringOptional

The provider that generated the completion

Example: mistral
modelstringOptional

The model that generated the embedding

Example: mistral-embed
post/embeddings
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