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

# Create Embeddings

`POST /v1/embeddings`

## Request body

- CreateEmbeddingsBody
  - `input` union, 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 (call `/v1/models` endpoint to get the `max_context_length` by model) and cannot be an empty string.
    - integer[]
    - array[]
      - integer[]
    - string
    - string[]
  - `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.
  - `dimensions` integer, nullable — The number of dimensions the resulting output embeddings should have.
  - `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` ApiDomainUsageEntitiesUsage
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_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.

---

[API](https://skmtc.net/betagouv/apis/opengatellm.md) · [All operations](https://skmtc.net/betagouv/apis/opengatellm/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/betagouv/opengatellm/revisions/f2624a610e5a/schema)
