Docs
Embeddings
A vector per input, OpenAI-compatible. No streaming, and charged on input only.
POST
https://iranrouter.com/v1/embeddingsA vector per input, OpenAI-compatible. No streaming — one request, one answer. The same ir- key and the same wallet.
bash
curl https://iranrouter.com/v1/embeddings \
-H "Authorization: Bearer ir-..." \
-H "Content-Type: application/json" \
-d '{
"model": "openai/text-embedding-3-small",
"input": ["سلام دنیا", "hello world"]
}'A few things to know
- input may be a string, an array of strings, or an array of tokens. You are charged on input only; there is no completion.
- The response is the provider's own, plus
usage.cost_rialand anx-request-idheader — the same id you will see under Usage. - Not every catalogue model is an embedding model. A model that cannot serve this path answers 503 with no_capacity.
- With
Idempotency-Keya retry is never billed twice. If the original response was too large to store for replay — a large embeddings batch usually is — the retry gets a 409 with codeidempotency_completed_unreplayable, meaning the original completed — you choose, with a fresh key, whether a re-run is worth paying for.