Routerbase api integration
Skill zenlee123/routerbase-agent-skills/skills/routerbase-api-integration
Agent skills for integrating, routing, and generating media with RouterBase.
npx -y skills add zenlee123/routerbase-agent-skills --skill routerbase-api-integrationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Integrate applications with RouterBase, the OpenAI-compatible model gateway at https://routerbase.com/v1. Use when migrating OpenAI SDK calls to RouterBase, configuring RouterBase API keys, implementing chat completions, streaming, tool calling, JSON mode, vision inputs, request validation, error handling, or documenting RouterBase setup for Python, JavaScript, curl, LangChain, LlamaIndex, Vercel AI SDK, Cursor, Continue, or other OpenAI-compatible clients.
SKILL.md
3.8 KB, 780 tokens by cl100k_base, as published. Nobody here has run it
RouterBase API Integration
Overview
Use routerbase as an OpenAI-compatible gateway for GPT, Claude, Gemini, and other supported models. This skill helps agents migrate existing OpenAI-compatible code, keep API keys server-side, and produce concise, testable RouterBase integration snippets.
Read references/routerbase-api.md when exact endpoint details, headers, or examples are needed.
Integration Workflow
- Identify whether the user is asking for migration, a new integration, debugging, or documentation.
- Keep credentials out of client/browser code. Prefer
ROUTERBASE_API_KEYin server-side environment configuration. - Reuse the user's existing OpenAI-compatible client when possible. Change the base URL to
https://routerbase.com/v1, then swap themodelto a RouterBase model ID. - Preserve standard OpenAI request shapes unless RouterBase docs or the selected model require a model-specific field.
- For model IDs, use the live model catalog when an API key is available; otherwise use documented examples only as a starting point and tell the user to verify current availability.
- Add a minimal smoke test, but do not run it unless credentials are present and the user expects a live API call.
Common Patterns
Python
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)
JavaScript
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);
curl
curl -X POST https://routerbase.com/v1/chat/completions \
-H "Authorization: Bearer $ROUTERBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-2.5-flash",
"messages": [{"role": "user", "content": "What is 2+2?"}]
}'
Implementation Guardrails
- Never paste or log real API keys. Use placeholders like
sk-rb-...only in docs. - Never put RouterBase keys in browser, mobile, or public repository code.
- Keep examples OpenAI-compatible unless the user asks for a framework-specific adapter.
- For streaming, set
stream: trueand process Server-Sent Events or SDK stream chunks. - For tool calling and JSON mode, keep the standard OpenAI fields
toolsandresponse_format. - For multimodal chat, use OpenAI content parts with
textandimage_url. - If a live request fails, check headers, model ID, endpoint path, rate limits, and account access before changing application logic.
Output Checklist
- Include the changed base URL.
- Include where
ROUTERBASE_API_KEYshould be configured. - Include one minimal request example.
- Include a clear note when model IDs or prices should be checked against the live RouterBase catalog.
- Include a test command or dry-run validation path.
Gives 0 of the 12 instructions most apis services skills give in 780 tokens
Counted across 424 of the 426 authors here whose files we hold, read 2026-08-06
- use plural nouns for resource namesin 41 of 424, across 32 files
- use cursor-based pagination for large datasetsin 35 of 424, across 20 files
- include rate limit headers in responsesin 25 of 424, across 13 files
- Use kebab-case for multi-word resourcesin 23 of 424, across 13 files
- version APIs in the URL pathin 19 of 424, across 9 files
- use semantic HTTP status codesin 18 of 424, across 8 files
- verify webhook signaturesin 18 of 424, across 11 files
- use query parameters for filteringin 17 of 424, across 6 files
- use async database operationsin 14 of 424, across 7 files
- wrap successful responses in a data fieldin 13 of 424, across 3 files
- prefix sorting parameters with a hyphen for descending orderin 13 of 424, across 3 files
- set appropriate HTTP status codesin 13 of 424, across 6 files
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.