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

# Create embeddings

`POST /v1/embeddings`

This endpoint follows the OpenAI API format for generating vector embeddings from input text.
The handler receives pre-processed metadata from middleware and forwards the request to
the selected node.

# Returns
* `Ok(Response)` - The embeddings response from the processing node
* `Err(AtomaProxyError)` - An error status code if any step fails

## Errors
* `INTERNAL_SERVER_ERROR` - Processing or node communication failures

## Request body

- CreateEmbeddingRequest — Request object for creating embeddings
  - `dimensions` integer, nullable — The number of dimensions the resulting output embeddings should have.
  - `encoding_format` string, nullable — The format to return the embeddings in. Can be "float" or "base64". Defaults to "float"
  - `input` union, required
    - string
    - string[]
  - `model` string, required — ID of the model to use.
  - `user` string, nullable — A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

## Response `200`

Embeddings generated successfully

- CreateEmbeddingResponse — Response object from creating embeddings
  - `data` EmbeddingObject[], required — List of embedding objects
    - `embedding` number[], required — The embedding vector
    - `index` integer, required — Index of the embedding in the list of embeddings
    - `object` string, required — The object type, which is always "embedding"
  - `model` string, required — The model used for generating embeddings
  - `object` string, required — The object type, which is always "list"
  - `usage` EmbeddingUsage, required — Usage information for the embeddings request
    - `prompt_tokens` integer, required — Number of tokens in the prompt
    - `total_tokens` integer, required — Total tokens used in the request

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `500` — Internal server error

## Changes

- **2025-01-25** `d714acb641bd` — 4 breaking, 9 info
  - added the new required request property `input`
  - added the new required request property `model`
  - the request's body type changed from no type to `object`
  - the response's body type changed from no type to `object` for status `200`
  - …9 more
- **2024-12-12** `444230182e5e` — 1 info
  - api tag `Embeddings` added
- **2024-12-06** `45e3254839bd` — 6 breaking, 5 warning, 3 info
  - the request's body type changed from `object` to no type
  - the response's body type changed from `object` to no type for status `200`
  - removed the required property `data` from the response with the `200` status
  - removed the required property `model` from the response with the `200` status
  - …10 more

[Change history](https://skmtc.dev/atomaai/apis/atoma-proxy/changes/v1/embeddings/post.md)

---

[API](https://skmtc.dev/atomaai/apis/atoma-proxy.md) · [All operations](https://skmtc.dev/atomaai/apis/atoma-proxy/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/atomaai/atoma-proxy/revisions/07694b7228b0/schema)
