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-V3.2",
name: "azure/DeepSeek-V3.2 (NI)",
reasoning: true,
input: ["text"],
contextWindow: 200000,
maxTokens: 64000,
},
],
},
},
},
agents: {
defaults: {
model: { primary: "northerninference/azure/DeepSeek-V3.2" },
},
},
}
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.
Privacy tier handling
OpenClaw does not forward extra_body to custom base URLs, and has no documented hook for adding custom HTTP headers. So you cannot set a per-request privacy_tier through OpenClaw.
Two ways to pin a tier when using OpenClaw:
- Issue a key with a default tier baked in. NI portal. Keys. Create
key. Set Default privacy tier to managed_canadian_cloud (or whichever tier you want all OpenClaw traffic on). Every request from that key lands at that tier regardless.
- Use tier-suffixed model IDs. NI exposes variants like
anthropic/claude-sonnet-4.5:tier-provider_api. Register that model ID directly in OpenClaw's models list if you want a specific non default tier on a specific model.
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 region-suffixed variants of each model
(e.g. anthropic/claude-sonnet-4.5-ca for Canadian, -us for US direct). Use the suffixed form when you want to make jurisdiction explicit in your config. Unsuffixed names still work as aliases.
- Fallback and PII substitution toggles come from the NI key settings,
not per-request. Configure them on the key in the portal.