Get going in 30 seconds
Create ~/.openclaw/openclaw.json:
{
env: { NI_API_KEY: "ni_live_YOUR_KEY_HERE" },
models: {
providers: {
northerninference: {
baseUrl: "https://northerninference.ca/v1",
apiKey: "${NI_API_KEY}",
api: "openai-completions",
models: [
{ id: "vertex_ai/gemini-2.5-pro-ca", name: "Gemini 2.5 Pro CA (NI)", input: ["text"], contextWindow: 128000, maxTokens: 16384 },
],
},
},
},
agents: {
defaults: {
model: { primary: "northerninference/vertex_ai/gemini-2.5-pro-ca" },
},
},
}
Then launch OpenClaw. Your NI models appear under the northerninference provider in the model picker.
Verification note: this config follows OpenClaw's documented generic OpenAI-compatible provider shape. If OpenClaw changes its schema, keep thebaseUrl,apiKey, andmodels[].idvalues below, then adjust only the surrounding OpenClaw-specific field names.
OpenClaw uses JSON5 config with an OpenAI-compatible generic provider shape. Drop-in works against NI's /v1 endpoint.
Config file
~/.openclaw/openclaw.json:
{
env: { NI_API_KEY: "ni_live_YOUR_KEY_HERE" },
models: {
providers: {
northerninference: {
baseUrl: "https://northerninference.ca/v1",
apiKey: "${NI_API_KEY}",
api: "openai-completions",
models: [
{
id: "azure/DeepSeek-V4-Pro-global",
name: "azure/DeepSeek-V4-Pro-global (NI)",
reasoning: true,
input: ["text"],
contextWindow: 200000,
maxTokens: 64000,
},
],
},
},
},
agents: {
defaults: {
model: { primary: "northerninference/azure/DeepSeek-V4-Pro-global" },
},
},
}
Env vars (alternative)
Put the API key in an env file OpenClaw reads at startup:
# ~/.openclaw/.env
NI_API_KEY=ni_live_YOUR_KEY_HERE
Precedence (OpenClaw reads in this order, last wins): process env, ./.env, ~/.openclaw/.env, openclaw.json's env block.
Choosing model IDs
models[].id is the NI routing key. It must match the model value you would send to https://northerninference.ca/v1/chat/completions.
List live routing keys:
curl https://northerninference.ca/api/billing/models | jq '.models[].model_id'
Use the exact returned string, case-sensitive. Friendly display names are not routing keys.
Route handling
The selected model ID is the route contract. OpenClaw does not need to send extra_body or custom headers for route selection.
Use both controls together:
- Register exact routing keys from
/modelsin OpenClaw's model list. - Issue NI API keys with allowed route tiers matching those routes. A key that is allowed only managed Canadian cloud routes will get
400if it requests a provider-direct route.
Quirks
- OpenClaw strips OpenAI-only request shaping on custom base URLs
(service_tier, store, reasoning compatibility hints). Harmless for NI. those fields are not part of NI's contract.
- OpenClaw's
model.idmust match NI'smodelfield verbatim, whatever
/api/billing/models returns. Case-sensitive.
- NI exposes route keys with explicit suffixes. Canadian and US direct
routes use -ca and -us; other direct provider regions use the actual region, such as -eu-west-2. Use the full route key from /models when you want a specific jurisdiction or region.
- Fallback and PII substitution toggles come from the NI key settings,
not per-request. Configure them on the key in the portal.