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

# Create Embeddings

`POST /v1/embeddings`

## Request body

- object
  - `model` string, required — The embedding model to use. See the [Models page](/overview/models) for current embedding model IDs.
  - `input` union, required — The text to embed. Can be a single string, an array of strings, or an array of token arrays. Each input must not exceed the model's maximum token limit (8,191 tokens for `text-embedding-3-*` models).
    - string — A single text string to embed.
    - string[] — An array of strings to embed in a single request. Each string can be up to 8,191 tokens.
    - array[] — An array of token arrays.
      - integer[]
  - `encoding_format` 'float' | 'base64' — The format of the returned embedding vectors. `float` returns an array of floating-point numbers. `base64` returns a base64-encoded string representation, which can reduce response size for large batches.
  - `dimensions` integer — The number of dimensions for the output embedding vector. Only supported by `text-embedding-3-*` models. Reducing dimensions can lower storage costs while maintaining most of the embedding's utility.
  - `user` string — A unique identifier for your end-user, which can help monitor and detect abuse.

## Response `200`

A list of embedding vectors for the input text(s).

- object
  - `object` 'list' — The object type, always `list`.
  - `data` object[] — An array of embedding objects, one per input text. When multiple inputs are provided, results are returned in the same order as the input.
    - `object` 'embedding' — The object type, always `embedding`.
    - `index` integer — The index of this embedding in the input array (starting from 0).
    - `embedding` number[] — The embedding vector as an array of floating-point numbers. The length depends on the model and `dimensions` parameter.
  - `model` string — The model used to generate the embeddings.
  - `usage` object — Token usage statistics for this request.
    - `prompt_tokens` integer — The number of tokens in the input text(s).
    - `total_tokens` integer — The total number of tokens processed (same as `prompt_tokens` for embeddings).

---

[API](https://skmtc.net/cometapi/apis/create-api-key.md) · [All operations](https://skmtc.net/cometapi/apis/create-api-key/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cometapi/create-api-key/versions/0863102dbf34/schema)
