OpenAI-style clientshttps://northerninference.ca/v1 Anthropic SDK / Claude Codehttps://northerninference.cahost root, no /v1 Each guide below shows the right form for its client.

Connect your tool to Northern Inference

Northern Inference exposes both an OpenAI-compatible endpoint (/v1/chat/completions) and an Anthropic-native endpoint (/v1/messages) from a single Canadian base URL. Paste the config for your tool below, replace {NI_API_KEY} with your key, and your requests will route through Canadian data residency infrastructure.

Substitute a model route into all configs:

Claude Code

Anthropic's official CLI coding agent. Point it at Northern Inference so your AI-assisted coding sessions route through Canadian infrastructure.

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://northerninference.ca",
    "ANTHROPIC_AUTH_TOKEN": "{NI_API_KEY}",
    "ANTHROPIC_MODEL": "bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0-global"
  }
}

Cursor

AI-powered code editor with inline chat and autocomplete. Add Northern Inference as a custom OpenAI provider in Cursor Settings.

Cursor Settings > Models (OpenAI API key + base URL)
Override OpenAI Base URL: https://northerninference.ca/v1
OpenAI API Key: {NI_API_KEY}

Add these model IDs under Cursor > Models > Add model:
  bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0-global

Continue

Open-source AI code assistant for VS Code and JetBrains. Add Northern Inference as an OpenAI-compatible provider in your Continue config.

~/.continue/config.yaml
models:
  - name: bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0-global
    provider: openai
    model: bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0-global
    apiBase: https://northerninference.ca/v1
    apiKey: {NI_API_KEY}

Aider

AI pair programming CLI tool that edits code in your local repo. Set the base URL and key via environment variables.

shell env (or ~/.aider.conf.yml)
export OPENAI_API_BASE=https://northerninference.ca/v1
export OPENAI_API_KEY={NI_API_KEY}
aider --model openai/bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0-global

Codex

OpenAI's lightweight coding agent CLI. Add Northern Inference as a named provider in your Codex config file.

~/.codex/config.toml
model_provider = "northerninference"
model = "bedrock/global.anthropic.claude-sonnet-4-6-global"

[model_providers.northerninference]
name = "Northern Inference"
base_url = "https://northerninference.ca/v1"
env_key = "NI_API_KEY"
wire_api = "responses"

# Set NI_API_KEY in your shell:
# export NI_API_KEY={NI_API_KEY}

pi

pi-coding-agent: a fast, local coding agent. Register Northern Inference as a provider in the models config file.

~/.pi/agent/models.json
{
  "providers": {
    "northerninference": {
      "baseUrl": "https://northerninference.ca/v1",
      "api": "openai-completions",
      "apiKey": "{NI_API_KEY}",
      "models": [
        { "id": "vertex_ai/gemini-2.5-pro-ca" }
      ]
    }
  }
}

OpenClaw

Open-source agentic coding environment. Add Northern Inference as a named provider with your preferred model.

~/.openclaw/openclaw.json
{
  env: { NI_API_KEY: "{NI_API_KEY}" },
  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: "vertex_ai/gemini-2.5-pro-ca (NI)", input: ["text"] },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "northerninference/vertex_ai/gemini-2.5-pro-ca" },
    },
  },
}

LangChain (Python)

The popular Python orchestration framework for LLM applications. Use ChatOpenAI with a custom base URL.

your_script.py
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="vertex_ai/gemini-2.5-pro-ca",
    api_key="{NI_API_KEY}",
    base_url="https://northerninference.ca/v1",
)

resp = llm.invoke("What model are you?")
print(resp.content)

LibreChat

Self-hosted open-source chat UI compatible with many LLM backends. Add Northern Inference as a custom endpoint.

librechat.yaml
version: 1.2.1

endpoints:
  custom:
    - name: "Northern Inference"
      apiKey: "{NI_API_KEY}"
      baseURL: "https://northerninference.ca/v1"
      models:
        default:
          - "vertex_ai/gemini-2.5-pro-ca"
        fetch: false
      titleConvo: true
      titleModel: "vertex_ai/gemini-2.5-pro-ca"
      summarize: false
      summaryModel: "vertex_ai/gemini-2.5-pro-ca"
      forcePrompt: false
      modelDisplayLabel: "NI"

Anthropic SDK (Python)

The official Anthropic Python library. Point base_url at Northern Inference and use native Claude model IDs.

your_script.py
from anthropic import Anthropic

client = Anthropic(
    base_url="https://northerninference.ca/v1",
    api_key="{NI_API_KEY}",  # ni_live_... NI key, not an Anthropic key
)

resp = client.messages.create(
    model="bedrock/global.anthropic.claude-sonnet-4-5-20250929-v1:0-global",
    max_tokens=80,
    messages=[{"role": "user", "content": "Which jurisdiction am I in?"}],
)
print(resp.content[0].text)

OpenAI SDK (Python)

The official OpenAI Python library. Works with all OpenAI-compatible routes on Northern Inference.

your_script.py
from openai import OpenAI

client = OpenAI(
    base_url="https://northerninference.ca/v1",
    api_key="{NI_API_KEY}",
)

resp = client.chat.completions.create(
    model="bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0-global",
    messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)

curl

Quick one-shot test from the terminal. Works with any OpenAI-compatible route on Northern Inference.

terminal
curl https://northerninference.ca/v1/chat/completions \
  -H "Authorization: Bearer {NI_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"model":"bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0-global","messages":[{"role":"user","content":"Hello"}]}'

No NI API key yet? Sign in or request access to create one.

Integration guides

Northern Inference exposes an OpenAI-compatible endpoint at https://northerninference.ca/v1. Most tools work with a base URL swap and your NI key. The Anthropic SDK and Claude Code use the host root (https://northerninference.ca) instead. Each guide below shows the correct form for its client.

Claude Code

Use Claude Code through NI (Anthropic SDK client, host-root base URL)

Cursor

Use Northern Inference as your Cursor backend

Continue.dev

Use Northern Inference in Continue (VS Code / JetBrains)

Aider

Use Northern Inference with Aider's pair-programmer CLI

Zed

Use Northern Inference in the Zed editor

Open WebUI

Use Northern Inference with Open WebUI

LibreChat

Use Northern Inference in LibreChat

LangChain / LlamaIndex

Use Northern Inference from LangChain / LlamaIndex

Anthropic SDK

Use the official Anthropic SDK against the /v1/messages endpoint

curl / HTTPie

Talk to Northern Inference directly with curl

Vision & capabilities

Send images and detect per-model capabilities (vision, context window)

Codex

Use Codex with NI's Responses API endpoint

NI Commands (in-chat)

Drive routing from inside any chat client: ni-help, ni-models, ni-map-model, and more

pi (pi-coding-agent)

Use Northern Inference with @mariozechner/pi-coding-agent

OpenClaw

Use Northern Inference with OpenClaw (placeholder)

OpenCode

Use Northern Inference as your OpenCode backend

Hermes Agent

Use Northern Inference as the Hermes Agent backend

Starting from zero

  1. Sign up at northerninference.ca (starter credits on signup, no card required).
  2. In the portal, go to Keys → Create key. Copy the ni_live_… string once shown (it's not displayed again).
  3. Pick an integration above and follow its config snippet. OpenAI-style clients use https://northerninference.ca/v1. Anthropic SDK and Claude Code use https://northerninference.ca (host root). Each guide shows the right form.
  4. Hit your first call. Check the Usage tab in the portal. You'll see the request appear within a few seconds, including the full chain-of-custody record.

Privacy route selection

You pick privacy by picking the model. Northern Inference has no privacy switch in the request body. Every deployed route on /models belongs to exactly one privacy tier (shown on each model card), so choosing a route is choosing the tier. Copy the exact route ID from /models and send it as your model. Your API key can be limited to certain tiers, and a route outside those tiers is refused. Sending privacy_tier or X-Privacy-Tier in the request is rejected, because the route already carries the tier.

TierStatusWho sees your prompts
Tier 1: Self-Hosted HardwareComing SoonOnly you, on your own compute
Tier 2: Nitro EnclaveComing SoonNobody. Cryptographic isolation, where AWS itself cannot read inside
Tier 3: Managed Cloud (default)LiveAWS Bedrock or Azure, in Canadian regions only
Tier 4: Provider APILiveThe upstream provider, in the provider's own region, which may be outside Canada

Need an integration that's not listed? Let us know or open a ticket in the portal. We'll write the guide and publish it here.