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

Embeddings

Create Embeddings

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

The embeddings creation request.

modelstring · min: 1Required

ID of the model to use. Call /v1/models endpoint to get the list of available models, only text-embeddings-inference model type is supported.

inputany of · min: 1 · nullableOptional

Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (call /v1/models endpoint to get the max_context_length by model) and cannot be an empty string.

integer[]Optional
or
or
stringOptional
or
string[]Optional
dimensionsinteger · nullableOptional

The number of dimensions the resulting output embeddings should have.

encoding_formatstring · enumOptional

The format of the output embeddings.

Default: floatPossible values:
Other propertiesanyOptional
Responses
200

Successful Response

application/json
modelstringRequired
objectconst: listOptional

The type of object returned.

Default: list
idstring · nullableOptional

A unique identifier for the request.

Other propertiesanyOptional
post/v1/embeddings
POST /v1/embeddings HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 106

{
  "model": "text",
  "input": [
    1
  ],
  "dimensions": 1,
  "encoding_format": "float",
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "data": [
    {
      "embedding": [
        1
      ],
      "index": 1,
      "object": "text",
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "model": "text",
  "object": "list",
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0,
    "cost": 0,
    "impacts": {
      "kWh": 0,
      "kgCO2eq": 0,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "id": "text",
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Last updated

Was this helpful?