Usage > V2 > OpenAI-compatible

Create embeddings

OpenAI compatible embeddings, see the OpenAI documentation. <br><br> Creates an embedding vector representing the input text. <br><br> Some models are in beta and may being subject to changes, use GET /1/ai/models to check what model are in beta and see our General Terms and Conditions.

post/2/ai/{product_id}/openai/v1/embeddings

Path parameters

product_idinteger required

AI Tools product identifier: use GET /1/ai to retrieve your product identifier.

Request body

dimensionsinteger

The number of dimensions the resulting output embeddings should have. May not be supported by all the available models.

encoding_formatstring

Defaults to float<br>The format to return the embeddings in. Can be either float or base64.

inputstring required

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 (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. Example Python code for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request.

modelstring required

Model name to use. You can use the endpoint GET /1/ai/models to see all our available models with various informations.

Example request

{
  "encoding_format": "float",
  "model": "bge_multilingual_gemma2"
}

Response

OK

objectstring required

The object type, which is always list.

modelstring required

The model used to create the embeddings.

Example response

{
  "object": "list",
  "data": {
    "object": "embedding"
  },
  "model": "bge_multilingual_gemma2"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.