Run in Apifox
OpenAI
Creates an embedding vector representing the input text. Embeddings are useful for search, clustering, recommendations, and other machine learning tasks. How To Use# Simply specify the model name in your request payload. All other parameters remain the same across different models. Supported Models# Request Provide your bearer token in the Authorization
header when making requests to protected resources. Example: Authorization: Bearer ********************
or
Body Params application/json Required
{
"input" : "The food was delicious and the waiter..." ,
"model" : "text-embedding-ada-002" ,
"encoding_format" : "float"
} Request Code Samples
curl --location '/v1/embeddings' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": "The food was delicious and the waiter...",
"model": "text-embedding-ada-002",
"encoding_format": "float"
}' Responses
{
"object" : "list" ,
"data" : [
{
"object" : "embedding" ,
"embedding" : [
0.0023064255 ,
-0.009327292 ,
-0.0028842222
] ,
"index" : 0
}
] ,
"model" : "text-embedding-ada-002" ,
"usage" : {
"prompt_tokens" : 8 ,
"total_tokens" : 8
}
}
Modified at 2026-07-29 01:22:52