Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Embeddings

Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

Create embeddings
POST/embeddings
ModelsExpand Collapse
CreateEmbeddingResponse object { data, model, object, usage }
data: array of Embedding { embedding, index, object }

The list of embeddings generated by the model.

embedding: array of number or string

The embedding vector, returned as a list of floats when encoding_format is float (the default), or as a base64-encoded string when encoding_format is base64. The length of the vector depends on the model as listed in the embedding guide.

One of the following:
array of number
string
index: number

The index of the embedding in the list of embeddings.

object: "embedding"

The object type, which is always “embedding”.

model: string

The name of the model used to generate the embedding.

object: "list"

The object type, which is always “list”.

usage: object { prompt_tokens, total_tokens }

The usage information for the request.

prompt_tokens: number

The number of tokens used by the prompt.

total_tokens: number

The total number of tokens used by the request.

Embedding object { embedding, index, object }

Represents an embedding vector returned by embedding endpoint.

embedding: array of number or string

The embedding vector, returned as a list of floats when encoding_format is float (the default), or as a base64-encoded string when encoding_format is base64. The length of the vector depends on the model as listed in the embedding guide.

One of the following:
array of number
string
index: number

The index of the embedding in the list of embeddings.

object: "embedding"

The object type, which is always “embedding”.

EmbeddingModel = "text-embedding-ada-002" or "text-embedding-3-small" or "text-embedding-3-large"
One of the following:
"text-embedding-ada-002"
"text-embedding-3-small"
"text-embedding-3-large"