Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

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

Body

application/json
input
required

Input text to embed. Can be a string or array of strings.

model
string
required

ID of the model to use. Use the List embedding models endpoint to see available models.

Example:

"thenlper/gte-large"

encoding_format
enum<string>
default:float

The format to return the embeddings in.

Available options:
float,
base64
dimensions
integer

The number of dimensions the resulting output embeddings should have. Only supported in some models.

user
string

A unique identifier representing your end-user for monitoring and abuse detection.

Response

Successful Response

object
string
default:list
required

The object type, always 'list'

data
OpenAIEmbeddingData · object[]
required

List of embedding objects

model
string
required

The model used for embedding

usage
OpenAIEmbeddingUsage · object
required