POST
/
v1
/
embeddings

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request object for creating embeddings

input
required

Input text to get embeddings for. Can be a string or array of strings. Each input must not exceed the max input tokens for the model

model
string
required

ID of the model to use.

dimensions
integer | null

The number of dimensions the resulting output embeddings should have.

Required range: x > 0
encoding_format
string | null

The format to return the embeddings in. Can be "float" or "base64". Defaults to "float"

user
string | null

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.

Response

200 - application/json

Response object from creating embeddings

data
object[]
required

List of embedding objects

model
string
required

The model used for generating embeddings

object
string
required

The object type, which is always "list"

usage
object
required

Usage statistics for the request