curl --request POST \
--url https://api.openai.com/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": "The quick brown fox jumped over the lazy dog",
"model": "text-embedding-3-small",
"encoding_format": "float",
"dimensions": 2,
"user": "user-1234"
}'
{
"data": [
{
"index": 123,
"embedding": [
123
],
"object": "embedding"
}
],
"model": "<string>",
"object": "list",
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}
Creates an embedding vector representing the input text.
curl --request POST \
--url https://api.openai.com/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": "The quick brown fox jumped over the lazy dog",
"model": "text-embedding-3-small",
"encoding_format": "float",
"dimensions": 2,
"user": "user-1234"
}'
{
"data": [
{
"index": 123,
"embedding": [
123
],
"object": "embedding"
}
],
"model": "<string>",
"object": "list",
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
OK
The response is of type object
.
Was this page helpful?