---
title: "OpenAI compatible route. Returns a 424 status code if the model is not an embedding model."
method: POST
path: "/v1/embeddings"
tags: ["Text Embeddings Inference"]
---

# OpenAI compatible route. Returns a 424 status code if the model is not an embedding model.

`POST /v1/embeddings`

## Request body

- OpenAICompatRequest
  - `dimensions` integer, nullable
  - `encoding_format` 'float' | 'base64'
  - `input` union, required
    - union
      - string
      - integer[]
    - InputType[]
      - union
        - string
        - integer[]
  - `model` string, nullable
  - `user` string, nullable

## Response `200`

Embeddings

- OpenAICompatResponse
  - `data` OpenAICompatEmbedding[], required
    - `embedding` union, required
      - number[]
      - string
    - `index` integer, required
    - `object` string, required
  - `model` string, required
  - `object` string, required
  - `usage` OpenAICompatUsage, required
    - `prompt_tokens` integer, required
    - `total_tokens` integer, required

## Other responses

- `400` — Batch is empty
- `413` — Batch size error
- `422` — Tokenization error
- `424` — Embedding Error
- `429` — Model is overloaded

## Changes

- **2025-09-01** `9988d0e89620` — 4 warning, 2 info
  - added the new `Empty` enum value to the `error_type` response property for the response status `413`
  - added the new `Empty` enum value to the `error_type` response property for the response status `422`
  - added the new `Empty` enum value to the `error_type` response property for the response status `424`
  - added the new `Empty` enum value to the `error_type` response property for the response status `429`
  - …2 more
- **2024-06-28** `b923798e3868` — 1 info
  - endpoint added
- **2023-10-13** `8c00768ef703` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/huggingface/apis/text-embeddings-inference/changes/v1/embeddings/post.md)

---

[API](https://skmtc.dev/huggingface/apis/text-embeddings-inference.md) · [All operations](https://skmtc.dev/huggingface/apis/text-embeddings-inference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/huggingface/text-embeddings-inference/revisions/f4c15add6d2b/schema)
