Endpoint
Request Parameters
string
required
The embedding model to use. Example:
text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002.string | array
required
The text to embed. Pass a single string for one embedding, or an array of strings to embed multiple texts in a single request. Batching multiple inputs is more efficient than making separate requests.
Response Fields
array
An array of embedding objects, one for each input string. The order matches the order of the inputs you provided.
array of floats
The embedding vector for this input — an array of floating-point numbers. The dimensionality depends on the model you chose.
integer
The zero-based index of this embedding in the
data array, corresponding to the position of the input string you submitted.integer
The total number of tokens processed across all inputs in the request.
Code Example
input: