OpenRouter-compatible API
Found this helpful? Share it:
Found this helpful? Share it:
idapt ships an OpenRouter-compatible API at base URL
https://idapt.app/api/openrouter/v1. It speaks both the OpenAI wire
shape and the Anthropic Messages shape, so apps and SDKs built for
OpenRouter migrate by changing one URL.
idapt.app/api/openai/v1idapt.app/api/anthropic/v1idapt.app/api/openrouter/v1Copy-paste setup for a specific framework lives in the AI Gateway quickstarts: /developers/ai-gateway-quickstarts.
An API key with the completions scope. See API keys and scopes.
The base URL https://idapt.app/api/openrouter/v1.
A Credit balance, or your own provider key.
curl https://idapt.app/api/openrouter/v1/chat/completions \
-H "Authorization: Bearer uk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "z-ai/glm-5.2",
"messages": [{"role": "user", "content": "Hello!"}]
}'curl https://idapt.app/api/openrouter/v1/anthropic/v1/messages \
-H "x-api-key: uk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "z-ai/glm-5.2",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'The provider routing object: order, only, ignore, allow_fallbacks, sort, and max_price.
A models array as an ordered fallback list, tried in the order you list them.
The reasoning parameter, passed to adapters that support it.
Model suffixes like :nitro, :free, and :online.
usage.cost in responses, in USD.
Key and credits management: GET /key, GET /credits, GET /keys, POST /keys, GET /keys/{hash}, PATCH /keys/{hash}, and DELETE /keys/{hash}.
Some OpenRouter endpoints are explicit 501 stubs: POST /rerank and the POST /auth/keys OAuth and PKCE key exchange. Streaming Responses is also 501. Each error carries metadata.roadmap_url pointing at the public migration page, so you can see when the feature ships.
Completions on this gateway bill your Credit balance at the prices
shown in the app, with no separate API pricing, or run on your own
provider key (BYOK draws no idapt credits). A key with no credits and
no BYOK gets a 403 with code insufficient_credits. Completions
are limited to 300 requests per minute.
You can cap what a single key spends on the AI Routing page. See per-key spend caps, and read Plans, credits, and the welcome credit for how billing fits together.
Related articles
OpenAI-compatible API
Use idapt's 200+ models from any app that speaks the OpenAI API format.
Anthropic-compatible API
Use idapt's 200+ models from Claude Code or any app that speaks the Anthropic Messages API.
Switch from OpenRouter
Swap the OpenRouter base URL for idapt's. Provider routing, model fallbacks, and key management work the same way.
Was this helpful?
curl https://idapt.app/api/openrouter/v1/chat/completions \
-H "Authorization: Bearer uk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "z-ai/glm-5.2",
"messages": [{"role": "user", "content": "Hello!"}]
}'curl https://idapt.app/api/openrouter/v1/chat/completions \
-H "Authorization: Bearer uk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "z-ai/glm-5.2",
"messages": [{"role": "user", "content": "Hello!"}]
}'curl https://idapt.app/api/openrouter/v1/anthropic/v1/messages \
-H "x-api-key: uk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "z-ai/glm-5.2",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'curl https://idapt.app/api/openrouter/v1/anthropic/v1/messages \
-H "x-api-key: uk_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "z-ai/glm-5.2",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'