---
title: "Create Embeddings"
method: POST
path: "/v1/embeddings"
tags: ["Embeddings"]
---

# Create Embeddings

`POST /v1/embeddings`

## Request

- The document declares no server URL.
- Auth: HTTP bearer

## Request body

- CreateEmbeddingsBody
  - `model` string, required: 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.
  - `input` union: 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[]
    - array[]
      - integer[]
    - string
    - string[]
  - `encoding_format` 'float' | 'base64'

## Response `200`

Successful Response

- EmbeddingsResponse
  - `data` Embedding[], required
    - `embedding` number[], required
    - `index` integer, required
    - `object` 'embedding', required
  - `model` string, required
  - `object` 'list': The type of object returned.
  - `usage` Usage
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_tokens` integer
    - `prompt_tokens_details` PromptTokensDetails
      - `cached_tokens` integer
    - `cost` number
    - `impacts` ApiDomainUsageEntitiesEnvironmentalImpacts
      - `kWh` number
      - `kgCO2eq` number
  - `id` string, nullable: A unique identifier for the request.

## Other responses

- `400`: Insufficient budget.
- `401`: Invalid authentication scheme.<br>Invalid API key.
- `403`: Your account has expired. Please contact support to renew your account.
- `404`: Model {name} not found.
- `422`: Model has wrong type. Expected: {expected_type}. Actual: {actual_type}.
- `429`: Token/request limit per minute/day exceeded.
- `503`: Model is too busy, please try again later.

## Changes

- **2026-09-29** `2f7a4a0aac8f`: 1 info
  - endpoint added
- **2026-09-29** `da70d9cd1957`: 1 breaking
  - api path removed without deprecation
- **2026-09-21** `5fdbd3614b8c`: 1 info
  - added the optional property `usage/prompt_tokens_details` to the response with the `200` status
- **2026-08-20** `0db3023472ef`: 1 breaking, 3 info
  - removed `subschema #1, subschema #2, subschema #3, subschema #4` from the `input` request property `anyOf` list
  - added `subschema #1, subschema #2` to the `input` request property `anyOf` list
  - the request property `input` became optional
  - the `input` request property's minLength was decreased from `1` to `0`
- **2026-07-11** `0fd1d281f985`: 5 breaking, 3 warning, 11 info
  - the `input/anyOf[subschema #2]/items/` request property's minItems was increased to `1`
  - the `input` request property's minLength was increased from `0` to `1`
  - the `model` request property's minLength was increased from `0` to `1`
  - response property `id` list-of-types was widened by adding types `null` to media type `application/json` of response `200`
  - …15 more

[Operation history](https://skmtc.dev/betagouv/apis/opengatellm/changes/v1/embeddings/post.md)

---

[API](https://skmtc.dev/betagouv/apis/opengatellm.md) - [All operations](https://skmtc.dev/betagouv/apis/opengatellm/llms.txt) - [OpenAPI document](https://skmtc.dev/betagouv/apis/opengatellm/revisions/2f7a4a0aac8f?raw)
