Request
Response
Parameters
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays.The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request.Supported formats:
string: The string that will be turned into an embedding.array of strings: The array of strings that will be turned into an embedding.array of numbers: The array of integers (tokens) that will be turned into an embedding.array of arrays of numbers: The array of arrays containing integers (tokens) that will be turned into an embedding.
ID of the model to use.Supported models:
text-embedding-ada-002text-embedding-3-smalltext-embedding-3-large
The number of dimensions the resulting output embeddings should have. Only supported in
text-embedding-3 and later models.The format to return the embeddings in.Options:
floatbase64
A unique identifier representing your end-user, which can help monitor and detect abuse.
Returns
The response is aCreateEmbeddingResponse object containing the generated embeddings and usage statistics.
The object type, which is always
"list".The list of embeddings generated by the model.
The name of the model used to generate the embedding.
The usage information for the request.
