Obtain a vector representation of the given input, which machine learning models and algorithms can easily use. Related guidelines: [Insert]( https://platform.openai.com/docs/guides/embeddings ) Create an embedding vector representing the input text.
Request
Header Params
Body Params application/json
Example
{"model":"text-embedding-3-large","input":"The food was delicious and the waiter..."}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location-g--request POST '{{BASE_URL}}/v1/embeddings' \
--header'Authorization: Bearer {{YOUR_API_KEY}}' \
--header'Content-Type: application/json' \
--data-raw'{
"model": "text-embedding-3-large",
"input": "The food was delicious and the waiter..."
}'
Responses
🟢200Create embeddings
application/json
Body
Example
{"object":"list","data":[{"object":"embedding","embedding":[0.0023064255,-0.009327292,
.... (1536 floats total for ada-002)
-0.0028842222],"index":0}],"model":"text-embedding-ada-002","usage":{"prompt_tokens":8,"total_tokens":8}}