Docs
IranRouter docs
Everything about calling IranRouter — from your first request to production agents.
IranRouter speaks the OpenAI API. Any SDK, library or tool that works with OpenAI connects here by changing two values — the base URL and the key. Nothing in your code needs rewriting.
python
client = OpenAI(
api_key="ir-...", # ← your IranRouter key
base_url="https://iranrouter.com/v1", # ← instead of api.openai.com
)Billing is in Rial, an official invoice is issued, and no foreign card is required. You are charged for tokens actually consumed, not a monthly subscription.
Where to start
QuickstartYour first successful response in under five minutes, with curl, Python or Node.Authentication & keysThe ir- key, the Authorization header, rotation, and what each key bounds.Migrating from OpenAIThe two values that change — and an exact list of where we differ from OpenAI.Models & model IDsWhat a model ID looks like, how to list them, and how to pick the right one.Pricing & billingRial pricing, the pre-flight hold, settlement, and plan allowance vs wallet credit.Rate limits & budgetsRate limits, per-key daily budgets, the response headers, and when each resets.
What is supported
| Capability | Status |
|---|---|
POST /v1/chat/completions | Fully supported, streaming and non-streaming |
POST /v1/messages | Anthropic-format compatible |
| Tools / function calling | On both surfaces |
| Vision / image input | On models that support it |
| Prompt caching | Supported and priced separately |
GET /v1/models · /v1/key · /v1/credits | Supported |
What we do not have yet
Stated plainly so nobody buys on a wrong assumption:
/v1/embeddings,/v1/images,/v1/audio,/v1/responses— not offered yet./v1/messages/count_tokens— not implemented.
If you depend on one of these, talk to us before you buy — we would rather you knew first.