Create embeddings
POST/embeddings
Creates an embedding vector representing the input text.
Body ParametersJSON
dimensions: optional number
The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.
minimum1
user: optional string
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
Returns
Create embeddings
curl https://api.openai.com/v1/embeddings \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"input": "The quick brown fox jumped over the lazy dog",
"model": "text-embedding-3-small",
"encoding_format": "float",
"user": "user-1234"
}'{
"data": [
{
"embedding": [
0
],
"index": 0,
"object": "embedding"
}
],
"model": "model",
"object": "list",
"usage": {
"prompt_tokens": 0,
"total_tokens": 0
}
}Returns Examples
{
"data": [
{
"embedding": [
0
],
"index": 0,
"object": "embedding"
}
],
"model": "model",
"object": "list",
"usage": {
"prompt_tokens": 0,
"total_tokens": 0
}
}