API Reference
- Introduction
- Authentication
- Headers
- Errors
- Supported Providers
- SDKs
- API Details
Chat Completions
Portkey Endpoints
Embeddings
Other APIs
Completions
Moderations
Fine-tuning
Assistants
- Assistants
- Threads
- Messages
- Runs
- Run Steps
Embeddings
POST
/
embeddings
curl https://api.portkey.ai/v1/embeddings \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "The food was delicious and the waiter...",
"model": "text-embedding-ada-002",
"encoding_format": "float"
}'
{
"data": [
{
"index": 123,
"embedding": [
123
],
"object": "embedding"
}
],
"model": "<string>",
"object": "list",
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}
Body
application/json
Response
200 - application/json
OK
The response is of type object
.
Was this page helpful?
curl https://api.portkey.ai/v1/embeddings \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "The food was delicious and the waiter...",
"model": "text-embedding-ada-002",
"encoding_format": "float"
}'
{
"data": [
{
"index": 123,
"embedding": [
123
],
"object": "embedding"
}
],
"model": "<string>",
"object": "list",
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}