---
title: "Create embeddings"
method: POST
path: "/2/ai/{product_id}/openai/v1/embeddings"
tags: ["Usage > V2 > OpenAI-compatible"]
---

# Create embeddings

`POST /2/ai/{product_id}/openai/v1/embeddings`

OpenAI compatible embeddings, see the [OpenAI documentation](https://platform.openai.com/docs/api-reference/embeddings/create).
<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`](/docs/api/get/1/ai/models) to check what model are in **beta**
and see our [General Terms and Conditions](https://www.infomaniak.com/gtl/rgpd.documents).

## Path parameters

- `product_id` integer, required

## Request body

- object
  - `dimensions` integer — The number of dimensions the resulting output embeddings should have. May not be supported by all the available models.
  - `encoding_format` string — *Defaults to* `float`<br>The format to return the embeddings in. Can be either `float` or `base64`.
  - `input` string, 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](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) 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.
  - `model` string, required — Model name to use. You can use the endpoint [GET `/1/ai/models`](/docs/api/get/1/ai/models) to see all our available models with various informations.

## Response `200`

OK

- 4cee7ea0OpenAiV1Embeddings — OpenAI embeddings collection format of /v1/embeddings
  - `object` string, required — The object type, which is always `list`.
  - `data` 4cee7ea0OpenAiV1EmbeddingsEmbedding, required — Represents an embedding vector returned by embedding endpoint.
    - `object` string, required — The object type, which is always `embedding`.
    - `embedding` number[], required — The embedding vector, which is a list of floats. The length of vector depends on the model.
    - `index` integer, required — The index of the embedding in the list of embeddings.
  - `model` string, required — The model used to create the embeddings.
  - `usage` 4cee7ea0OpenAiV1EmbeddingsUsage, required — Usage statistics for the embeddings request.
    - `prompt_tokens` integer, required — Number of tokens in the prompt.
    - `total_tokens` integer, required — Total number of tokens used in the request, same as `prompt_tokens` for embeddings.

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infomaniak/api-reference-developer-tools/revisions/667aae28fec6/schema)
