Create Embeddings

POST/v1/embeddings
Convert text input into vector embeddings.

Request Body

application/json
model:optionalstring

Model identifier used for this request.

Exampletext-embedding-ada-002
input:optionalstring

Text, message, image, or file input supplied to the model.

Examplestring
encoding_format:optionalstring

Format used to encode the returned embeddings.

Allowedfloatbase64
Examplefloat
dimensions:optionalinteger

Number of dimensions in the returned embedding vectors.

Example0

Response

200

A successful request returns a JSON response. The complete example is shown in the code panel.