API reference.
One OpenAI-compatible endpoint. Point your existing SDK at ProRouter and every model in the catalogue is reachable.
Quickstart
Create an API key in the dashboard, set it as an environment variable, and make your first call.
curl https://api.prorouter.com/v1/chat/completions \
-H "Authorization: Bearer $PROROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "beam",
"messages": [{ "role": "user", "content": "Hello!" }]
}'Or use the official OpenAI SDK — only the base URL and key change.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.PROROUTER_API_KEY,
baseURL: "https://api.prorouter.com/v1",
});
const res = await client.chat.completions.create({
model: "deepseek-v4.1-flash",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(res.choices[0].message.content);Authentication
Send your key as a bearer token. Keys are shown once at creation and stored only as a hash — we cannot recover a lost key, only rotate it.
Authorization: Bearer pro_sk_live_...
Keys can carry an expiry, a spending limit and an allow-list of models, configurable per key.
Chat completions
POST /v1/chat/completions accepts the standard OpenAI body: a model, a message array, and optional sampling parameters.
modelmessagestemperaturetop_pmax_tokensstoptoolstool_choiceresponse_formatseedstream
Usage metadata is returned on every response. Streaming responses include a final chunk with usage and routing details.
Streaming
Set stream: true to receive server-sent events. Deltas arrive in choices[0].delta.content, terminated by data: [DONE].
const stream = await client.chat.completions.create({
model: "beam",
messages: [{ role: "user", content: "Count to five." }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}Models
GET /v1/models lists every model available to your key. Model ids are the same slugs shown in the catalogue.
Each model may be served by more than one upstream provider. Routing and fallback happen inside ProRouter and are transparent to your integration.
Errors & limits
Errors use a single normalized shape with a machine-readable code and a request id for support.
{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded for this model.",
"request_id": "req_01J..."
}
}Per-model rate limits are published on each model page. Exceeding them returns 429 with a retry-after header.
Try it without writing code
Send a streaming request from the playground using your own key.