Simplest way
import { RouterBrain } from '@router-brain/sdk';
const rb = new RouterBrain('sk-your-api-key');
The gateway URL defaults to https://ai.win10030.com/v1.
With a config object
const rb = new RouterBrain({
apiKey: 'sk-your-api-key',
});
Custom gateway URL
If you're using your own gateway deployment, pass your own baseUrl:
const rb = new RouterBrain({
apiKey: 'sk-your-api-key',
baseUrl: 'https://gateway.your-company.com',
});
You only need to provide the root domain. The SDK automatically appends paths like
/v1,/anthropic/v1,/image/v1/generations, etc.
Options
| Option | Type | Required | What it does |
|---|---|---|---|
apiKey | string | Yes | Your API key, or passed directly as the first argument |
baseUrl | string | No | Custom gateway URL. Defaults to https://ai.win10030.com/v1 |