एक OpenAI-compatible API। हर frontier model। सस्ता।
Updated 2026-07-15
APIsRouter एक single /v1 endpoint expose करता है जो OpenAI SDK के साथ fluently बात करता है — same request body, same response shape, same tool-call format — Claude, GPT, Gemini, DeepSeek और 20+ के लिए।
"OpenAI-compatible" अलग-अलग vendors पर अलग-अलग मतलब होता है।
आपने शायद कुछ "OpenAI-compatible" APIs try किए हैं और पाया है कि वे केवल नाम में compatible हैं। कुछ format accept करते हैं लेकिन केवल एक single model return करते हैं। कुछ tool calls support नहीं करते। कुछ तब choke करते हैं जब context 100k tokens exceed करता है। कुछ specific model-name prefix demand करते हैं जो आपके existing SDK config को तोड़ता है। APIsRouter एक true drop-in होने के लिए बनाया गया है। OpenAI Python SDK बिना modification के काम करता है। Anthropic SDK /v1/messages के against काम करता है। Streaming, tool calls, vision, JSON mode, structured outputs — सभी direct के identical काम करते हैं। आप exactly एक line बदलते हैं — base_url — और ship करते हैं।
वही SDK, वही code, अलग host।
OpenAI Python (सबसे common path):
from openai import OpenAI
client = OpenAI(
api_key="sk-APIsRouter-...",
base_url="https://api.apisrouter.com/v1", # <-- only change
)
response = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Hello"}],
tools=[...], # standard tool format works
)क्या support है (और क्या नहीं, अभी तक)।
हमारे base_url के साथ Anthropic का official SDK use करें और Claude models natively काम करते हैं। OpenAI का official SDK use करें और GPT models natively काम करते हैं। उन्हें same project में mix करें — same key, दोनों SDKs, कोई context switching नहीं।
- Identically काम करता है: /v1/chat/completions (OpenAI format), /v1/messages (Anthropic format), /v1/images/generations, /v1/embeddings।
- Tool / function calling — OpenAI और Anthropic दोनों formats।
- Streaming (SSE), Vision / multimodal, JSON mode + structured outputs।
- Anthropic का prompt caching (cache_control headers)।
- Roadmap (Q3 2026): /v1/audio/* (TTS / Whisper)। अभी नहीं: Fine-tuning APIs, Assistants API।
जब "एक OpenAI-compatible key" वास्तव में matter करती है।
- Multi-model agent chains — planning के लिए GPT, reasoning के लिए Claude Opus, vision के लिए Gemini। एक key, तीन models, एक bill।
- Provider-agnostic codebases — OpenAI SDK के against build करें, `model` string बदलकर models switch करें।
- Drop-in migration — महीनों पहले OpenAI के against लिखा? Refactor न करें। base_url को APIsRouter पर point करें, model name के रूप में `claude-sonnet-4-6` use करें।
- Cost-aware fallback — Premium tasks → Claude Opus। Low-stakes → Haiku या DeepSeek V4। सभी same client से।
- Local + cloud agents एक billing surface share करते हैं — Codex CLI, Hermes, OpenClaw — सभी एक key के through।
अक्सर पूछे जाने वाले प्रश्न
APIsRouter और OpenRouter में क्या अंतर है?
OpenRouter pass-through है — यह upstream prices के ऊपर ~5% margin add करता है। दोनों OpenAI-compatible APIs expose करते हैं। अलग pricing models। वैश्विक मॉडल्स पर आधिकारिक मूल्य से 20% की छूट, चीनी मॉडल्स आधिकारिक मूल्य से कम। कोई सब्सक्रिप्शन नहीं, जितना उपयोग उतना भुगतान। पहला टॉप-अप +50% बैलेंस देता है।
क्या response shape OpenAI के exactly identical है?
हां — id, choices array, usage object, सभी fields present और correctly typed। हम OpenAI spec को strictly implement करते हैं। यही /v1/messages के लिए भी लागू होता है जो Anthropic के spec से match करता है।
आप model-name overlap कैसे handle करते हैं (जैसे gpt-5.5 vs claude-sonnet)?
Standard convention — हर model का एक canonical ID है। Full mapping के लिए हमारा /models page देखें। हम alias या rename नहीं करते — जो आप pass करते हैं वही हम route करते हैं।
क्या मेरा custom SDK middleware टूट जाएगा?
नहीं होना चाहिए — middleware request/response semantics पर operate करता है, जिसे हम exactly preserve करते हैं। अगर आप behavioral difference देखते हैं, issue file करें और हम upstream से match करेंगे।
Proxy overhead कितना fast है?
APIsRouter typically प्रति request ~30-80ms routing latency add करता है (आपके region vs हमारे edge के आधार पर)। Streaming के लिए, time-to-first-token upstream को closely track करता है। हम mid-stream buffer या transform नहीं करते।
क्या मैं self-host या private instance चला सकता हूं?
अभी नहीं — APIsRouter एक hosted aggregator है। Self-hosted के लिए, LiteLLM या one-api (open source) देखें। उनके पास discount channels नहीं हैं लेकिन वे run करने के लिए free हैं।