Quickstart
Use RouterBase as an OpenAI-compatible gateway
RouterBase exposes an OpenAI-compatible API at
https://routerbase.com/v1. For many chat-completions integrations, the first experiment is a base URL,
API key, and model id change.
Minimal request
curl 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": "Explain RouterBase in one sentence." }
]
}'
Node.js pattern
const response = await fetch("https://routerbase.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ROUTERBASE_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: process.env.ROUTERBASE_MODEL || "google/gemini-2.5-flash",
messages: [
{ role: "user", content: "Draft a short product update." }
]
})
});
Rollout notes
- Keep the model id configurable.
- Test one workflow before changing production traffic.
- Track latency, cost, error rate, and output quality.
- Use the API collections for a request smoke test before writing code.