OpenAI Embeddings
Create OpenAI-compatible text embeddings.
The OpenAI Embeddings API converts one or more inputs into vector representations for semantic search, clustering, recommendations, and vector retrieval. Input limits, output dimensions, and optional parameters depend on the selected embedding model.
/v1/embeddingsCreate vector representations for semantic search, clustering, recommendations, and other retrieval workflows. The API accepts a single text input, a batch of text inputs, a token array, or a batch of token arrays.
Input limits and output dimensions depend on the selected model. For example, text-embedding-ada-002 returns 1,536-dimensional vectors and accepts up to 8,192 tokens; other models may use different limits.
Authorization
bearerAuth Use Bearer your-api-key in the Authorization Header.
In: header
Request Body
Choose a text structure based on the number of inputs. Both views use the same Embeddings endpoint.
application/jsonConvert one non-empty string into an embedding vector for single-item tests or real-time queries.
- model
- An embedding model ID visible to the current API key.
- input
- A single non-empty string to convert into a vector.
- encoding_format
- Vector encoding format. The default is float.
{
"model": "MODEL_ID",
"input": "The food was delicious and the waiter was friendly.",
"encoding_format": "float"
}Token arrays and batched token arrays remain available in the complete field reference. Input count, length, and vector dimensions depend on the selected model limits.
Response Body
application/json
application/json
application/json
application/json
application/json