Official npm package @routerbrain/sdk for Node.js / TypeScript. It wraps the OpenAI-compatible HTTP APIs described in the gateway reference.
When to use it
| Good fit | Poor fit |
|---|
| Node backends, workers, CLI | Browser with exposed keys |
| Built-in SSE streaming | Anthropic-only apps (use Anthropic SDK + base URL) |
| Files + model list | Embeddings via SDK (use raw HTTP) |
vs raw HTTP / OpenAI SDK
┌──────────────────┐ ┌─────────────────────┐
│ @routerbrain/sdk │ │ OpenAI SDK │
│ chat / files / │ │ baseURL → gateway │
│ models │ │ │
└────────┬─────────┘ └──────────┬──────────┘
└──────────┬───────────────┘
▼
https://51kik.com/v1
- Official SDK: better for RouterBrain-specific options (PDF plugin, headers).
- OpenAI SDK: change
baseURL + apiKey for most chat migrations (From OpenAI).
Surface
| API | HTTP |
|---|
client.chat.send | POST /chat/completions |
client.files.* | /files |
client.models.list | GET /models |
client.chat.messages (Node) | Path/PDF helpers |
Next
Installation → Initialization → Chat and streaming