---
title: "Create embeddings for text and images"
method: POST
path: "/v1/embeddings"
---

# Create embeddings for text and images

`POST /v1/embeddings`

Create embeddings for text or images using the specified model, encoding format, and normalization.

Args:
    params: The parameters for creating embeddings.

Returns:
    EmbeddingCreateResponse: The response containing the embeddings.

## Request body

- EmbeddingCreateParams — Parameters for creating embeddings.
  - `model` string, required — The model to use for creating embeddings.
  - `input` union, required — The input to create embeddings for.
    - string
    - string[]
  - `dimensions` integer, nullable — The number of dimensions to use for the embeddings.
  - `prompt` string, nullable — The prompt to use for the embedding creation.
  - `normalized` boolean — Whether to normalize the embeddings.
  - `encoding_format` union — The encoding format(s) of the embeddings. Can be a single format or a list of formats.
    - 'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8' — Enumeration of encoding formats.
    - EncodingFormat[]

## Response `200`

The embeddings for the input text or image

- EmbeddingCreateResponse
  - `usage` Usage, required
    - `prompt_tokens` integer, required — The number of tokens used for the prompt
    - `total_tokens` integer, required — The total number of tokens used
    - `completion_tokens` integer, nullable — The number of tokens used for the completion
  - `model` string, required — The model used
  - `data` union, required — The created embeddings.
    - Embedding[]
      - `embedding` union, required — The encoded embedding data by encoding format.
        - number[]
        - integer[]
        - string
      - `index` integer, required — The index of the embedding.
      - `object` 'embedding' — The object type of the embedding.
    - MultiEncodingEmbedding[]
      - `embedding` MultipleEncodingsEmbeddingItem, required
        - `float` number[]
        - `int8` integer[]
        - `uint8` integer[]
        - `binary` integer[]
        - `ubinary` integer[]
        - `base64` string
      - `index` integer, required — The index of the embedding.
      - `object` 'embedding_dict' — The object type of the embedding.
  - `object` 'list' — The object type of the response
  - `normalized` boolean, required — Whether the embeddings are normalized.
  - `encoding_format` union, required — The encoding formats of the embeddings.
    - 'float' | 'float16' | 'base64' | 'binary' | 'ubinary' | 'int8' | 'uint8' — Enumeration of encoding formats.
    - EncodingFormat[]
  - `dimensions` integer, nullable, required — The number of dimensions used for the embeddings.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mixedbread/apis/mxbai-omni.md) · [All operations](https://skmtc.net/mixedbread/apis/mxbai-omni/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mixedbread/mxbai-omni/versions/2eece97b5ae5/schema)
