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

# Create embeddings.

`POST /v1/embeddings`

Generate OpenAI-compatible embeddings for the given input using the specified model.

## Request body

- OpenAIEmbeddingsRequestWithExtraBody — Request parameters for OpenAI-compatible embeddings endpoint.
  - `model` string, required — The identifier of the model to use.
  - `input` union, required — Input text to embed, encoded as a string or array of tokens.
    - string
    - string[]
    - integer[]
    - array[]
      - integer[]
  - `encoding_format` 'float' | 'base64' — The format to return the embeddings in.
  - `dimensions` integer — The number of dimensions for output embeddings.
  - `user` string — A unique identifier representing your end-user.

## Response `200`

An OpenAIEmbeddingsResponse containing the embeddings.

- OpenAIEmbeddingsResponse — Response from an OpenAI-compatible embeddings request.
  - `object` 'list' — The object type.
  - `data` OpenAIEmbeddingData[], required — List of embedding data objects.
    - `object` 'embedding' — The object type.
    - `embedding` union, required — The embedding vector as a list of floats (when encoding_format='float') or as a base64-encoded string.
      - number[]
      - string
    - `index` integer, required — The index of the embedding in the input list.
  - `model` string, required — The model that was used to generate the embeddings.
  - `usage` OpenAIEmbeddingUsage, required — Usage information for an OpenAI-compatible embeddings response.
    - `prompt_tokens` integer, required — The number of tokens in the input.
    - `total_tokens` integer, required — The total number of tokens used.

## Other responses

- `400` — The request was invalid or malformed
- `429` — The client has sent too many requests in a given amount of time
- `500` — The server encountered an unexpected error
- `default` — An error occurred

---

[API](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis.md) · [All operations](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ogx-ai/ogx-specification-stable-experimental-apis/versions/f3f783962256/schema)
