routerbase-model-gateway
यह क्या करती है
RouterBase एक अनुवादक की तरह काम करता है, ताकि अलग-अलग AI मॉडल (जैसे GPT, Claude और Gemini) आपके application से बात कर सकें। इससे आप अपनी access keys सीधे दिखाए बिना, एक ही entry point से कई मॉडल इस्तेमाल कर सकते हैं।
कब इस्तेमाल करें
- ✓जब कोई application, जो पहले से OpenAI API इस्तेमाल कर रहा है, उसे RouterBase पर ले जाना हो।
- ✓जब यह तय करना हो कि अलग-अलग काम (text, image, audio) के लिए कौन सा AI मॉडल इस्तेमाल करना है।
- ✓जब real-time responses या किसी खास format जैसे फीचर्स के लिए RouterBase सेट करने को टेस्ट करना हो।
Skill का लिंक
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/routerbase-model-gateway/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं अपने application को सीधे OpenAI API की जगह RouterBase इस्तेमाल करने के लिए कैसे सेट करूँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
आपका application एक request RouterBase को भेजता है, जो उसे सबसे उपयुक्त AI मॉडल तक पहुँचा देता है। यह अलग-अलग मॉडलों के साथ बातचीत संभालता है और आपकी access keys को सुरक्षित रखता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
RouterBase Model Gateway
Overview
Use routerbase when an application needs one OpenAI-compatible API surface for model routing across GPT, Claude, Gemini, image, video, audio, and embedding workloads. This skill helps agents migrate existing OpenAI SDK calls, document model-selection tradeoffs, and produce safe implementation snippets without exposing credentials.
RouterBase model availability, pricing, and provider capabilities can change, so treat examples as starting points and verify current catalog data before production recommendations.
When to Use This Skill
- Use when migrating an OpenAI-compatible client to RouterBase by changing the base URL and model ID.
- Use when selecting primary and fallback models for chat, reasoning, vision, media generation, audio, or embeddings.
- Use when debugging RouterBase request setup, headers, environment variables, streaming, tool calls, JSON mode, or multimodal payloads.
- Use when documenting an internal model-routing plan that balances cost, latency, quality, and provider redundancy.
How It Works
Step 1: Classify the Workload
Identify the modality and hard constraints before choosing a model:
- Modality: chat, vision, image, video, audio, embeddings, or mixed.
- Quality target: draft, production, high-stakes review, or automated background task.
- Runtime constraints: latency budget, context length, streaming, JSON mode, tool calling, and retry tolerance.
- Business constraints: price ceiling, provider preference, regional requirements, and fallback rules.
Step 2: Configure the OpenAI-Compatible Client
Keep the RouterBase API key server-side in an environment variable such as ROUTERBASE_API_KEY. Do not put keys in browser, mobile, or public repository code.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["ROUTERBASE_API_KEY"],
base_url="https://routerbase.com/v1",
)
response = client.chat.completions.create(
model="google/gemini-2.5-flash",
messages=[{"role": "user", "content": "Write one sentence about model routing."}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.ROUTERBASE_API_KEY,
baseURL: "https://routerbase.com/v1",
});
const response = await client.chat.completions.create({
model: "google/gemini-2.5-flash",
messages: [{ role: "user", content: "Write one sentence about model routing." }],
});
console.log(response.choices[0].message.content);
Step 3: Validate Model IDs and Capabilities
When credentials and network access are available, check the live catalog before locking in a model ID or price-sensitive recommendation.
curl "https://routerbase.com/api/v1/models?task=chat" \
-H "Authorization: Bearer $ROUTERBASE_API_KEY"
Confirm feature assumptions with a small request fixture:
- Streaming works when
stream: trueis set. - Tool calling accepts the exact schema used by the app.
- JSON mode returns parseable output and still passes application validation.
- Vision or media payloads use the expected OpenAI-compatible content shape.
Step 4: Design Fallbacks Conservatively
Use explicit application-level fallbacks unless the user's RouterBase account already has a smart-routing policy configured.
const modelPlan = [
"anthropic/claude-sonnet-4-6",
"google/gemini-2.5-flash",
];
for (const model of modelPlan) {
try {
return await client.chat.completions.create({ model, messages });
} catch (error) {
if (!isRetryableRouterBaseError(error)) throw error;
}
}
Treat transient network errors, timeouts, rate limits, and server errors as candidates for retry. Do not blindly retry authentication failures, invalid model IDs, validation errors, or policy refusals.
Examples
Migration Checklist
When converting an existing OpenAI SDK integration:
- Change the base URL to
https://routerbase.com/v1. - Read
ROUTERBASE_API_KEYfrom server-side environment configuration. - Replace the model name with a RouterBase model ID that matches the task.
- Preserve standard OpenAI request fields unless RouterBase documentation says otherwise.
- Run one minimal smoke test before shipping.
Routing Plan Format
Use this table when recommending a model strategy:
| Use case | Primary model | Fallback model | Reason | Validation |
|---|
…
अक्सर पूछे जाने वाले सवाल
'मॉडल' क्या होते हैं?
मॉडल अलग-अलग तरह की आर्टिफिशियल इंटेलिजेंस होते हैं, जो आपकी requests को प्रोसेस कर सकते हैं, जैसे text, images या audio बनाने वाले मॉडल।
API keys को कोड में क्यों नहीं डालना चाहिए?
API keys को सीधे कोड में डालना सुरक्षा का खतरा है। कोड तक जिस किसी की पहुँच हो, वह आपकी keys देख और इस्तेमाल कर सकता है, जिससे खर्च बढ़ सकता है या अनधिकृत पहुँच हो सकती है।
'OpenAI client माइग्रेट करना' का क्या मतलब है?
इसका मतलब है ऐसे application को ढालना जो पहले से OpenAI API के साथ काम करने के लिए बना था, ताकि वह RouterBase के साथ भी चल सके। आमतौर पर इसके लिए बस कुछ settings बदलनी पड़ती हैं।
जानकारी
लेखक का मूल विवरण
Integrate RouterBase as an OpenAI-compatible model gateway for routing GPT, Claude, Gemini, media, audio, and embedding requests.
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #5647
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।