RouterBrain is a managed inference gateway. Your backend calls our HTTP APIs; we route to upstream models, enforce tenant policy, and record usage.
Protocol surfaces
| Surface | Base URL | Typical clients |
|---|---|---|
| OpenAI-compatible | https://51kik.com/v1 | OpenAI SDK, LangChain, most agent frameworks |
| Anthropic-compatible | https://51kik.com/anthropic | Anthropic SDK, Claude Code |
Use one surface per integration path. Model IDs are shared: take id from List models as model on either surface.
HTTP APIs
OpenAI-compatible API
| Capability | Method / path |
|---|---|
| Chat | POST /chat/completions |
| Embeddings | POST /embeddings |
| Files | POST/GET/DELETE /files, GET /files/:id/content |
| Speech | POST /audio/speech |
| Model catalog | GET /models (no API key) |
Anthropic-compatible API
| Capability | Method / path |
|---|---|
| Messages | POST /messages |
| Model catalog | GET /models |
Where the model and route support it, both chat surfaces support streaming, tools / function calling, and multimodal user content (text, images, files). Embeddings, files, and speech are OpenAI-compatible only.
Gateway extensions (OpenAI chat)
| Field | Description |
|---|---|
pdf_preprocess | PDF handling: native / ocr / markdown |
extra_body | JSON merged into upstream body (OpenAI-compatible routes) |
stream_options.include_usage | Gateway always includes usage on streams (Streaming) |
Optional headers (both surfaces)
| Header | Purpose |
|---|---|
x-trace-id | Your correlation id (usage + support) |
x-user-id | End-user id in your product |
x-agent-name | Agent or service name |
Pricing, quotas, and keys are managed in the console.
Suggested path: First request → Create chat completion → Errors