Skip to content
On this page

Inference

Embeddings

Create embeddings with per-token input billing.

POST/v1/embeddingsAPI key

Alias: /api/v1/embeddings. The request and response are passed through to the upstream.

curl -X POST https://api.relayrouter.org/v1/embeddings \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H 'content-type: application/json' \
-d '{
"model": "text-embedding-model",
"input": "the quick brown fox"
}'

Billing

Input tokens are billed at the model's prompt price, multiplied by the model's token_multiplier, plus the network fee. The exact amount is recorded in usage_logs.cost_micro and reflected by /usage.