Guide
Virouter exposes one OpenAI-compatible base URL for both OpenAI and Anthropic models. Point your existing client athttps://virouter.com and authenticate with your Virouter API key.
https://virouter.com/api/v1/chat/completionsAuthorization: Bearer vr_sk_xxxxxxxxxxxxVirouter keys start with the vr_sk_ prefix. Generate them under the Dashboard and treat them like any other secret: keep them in environment variables only.
The OpenAI Chat Completions JSON shape works as-is. The same structure routes to Anthropic models when you pass a Claude model id.
curl https://virouter.com/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer vr_sk_xxxxxxxxxxxx" \
-d '{
"model": "gpt-5.5",
"messages": [
{ "role": "user", "content": "Summarize what Virouter does." }
]
}'Set baseURL on the OpenAI client. No other code changes are required.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.VIROUTER_API_KEY,
baseURL: "https://virouter.com/api/v1",
});
const reply = await client.chat.completions.create({
model: "claude-sonnet-4-6",
messages: [{ role: "user", content: "Hello Virouter" }],
});