Skip to content

Embeddings

Create embeddings
embeddings.create(EmbeddingCreateParams**kwargs) -> CreateEmbeddingResponse
POST/embeddings
ModelsExpand Collapse
class CreateEmbeddingResponse:
data: List[Embedding]

The list of embeddings generated by the model.

embedding: List[float]

The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the embedding guide.

index: int

The index of the embedding in the list of embeddings.

object: Literal["embedding"]

The object type, which is always "embedding".

model: str

The name of the model used to generate the embedding.

object: Literal["list"]

The object type, which is always "list".

usage: Usage

The usage information for the request.

prompt_tokens: int

The number of tokens used by the prompt.

total_tokens: int

The total number of tokens used by the request.

class Embedding:

Represents an embedding vector returned by embedding endpoint.

embedding: List[float]

The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the embedding guide.

index: int

The index of the embedding in the list of embeddings.

object: Literal["embedding"]

The object type, which is always "embedding".

Literal["text-embedding-ada-002", "text-embedding-3-small", "text-embedding-3-large"]
Accepts one of the following:
"text-embedding-ada-002"
"text-embedding-3-small"
"text-embedding-3-large"