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
  }
}

Authorizations

x-portkey-api-key
string
header
required
x-portkey-virtual-key
string
header
required

Body

application/json

Response

200 - application/json
OK

The response is of type object.