API endpoint https://northerninference.ca/v1 Use this as the base URL in every integration.

Aider

Use Northern Inference with Aider's pair-programmer CLI over sovereign Canadian routes, with PIPEDA-aligned residency for government and regulated teams.

Northern Inference is a sovereign Canadian AI API for government, defence, health and regulated teams, including organizations under the Controlled Goods Program. Every route carries PIPEDA-aligned Canadian data residency, an exact path to the latest frontier and open-weight models, and a per-request chain-of-custody record.

Before you start

  1. Create an API key. In the portal, open Keys and click Create Key. Your key starts with ni_live_.
  2. Add credit. New accounts start with a balance of $0, and every request is refused until you add credit. Open Billing and click Buy credits.
  3. Pick a model. Northern Inference model names end in a tier tag, for example claude-sonnet-4-6-t4. See them all on the Models page.

Install Aider

Mac and Linux:

curl -LsSf https://aider.chat/install.sh | sh

Windows PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"

Connect Aider to Northern Inference

Create a file named .env in your home folder (~/.env on Mac and Linux, C:\Users\you\.env on Windows) with these two lines:

OPENAI_API_KEY=ni_live_YOUR_KEY_HERE
AIDER_OPENAI_API_BASE=https://northerninference.ca/v1

Aider reads this file every time it starts, on every operating system. Then go to your project folder and run:

aider --model openai/claude-sonnet-4-6-t4

Send a message. It appears in the portal under Usage within a few seconds.

Why the model starts with openai/

Aider names models as <provider>/<model>. The openai/ part tells Aider to talk to Northern Inference as an OpenAI-compatible service, and Aider sends only the part after it, here claude-sonnet-4-6-t4. Always keep the prefix.

To use a different model, change the name after openai/:

aider --model openai/mistral-large-2402-t3

Names ending in -t3 run in Canada. Aider may say it does not know the model's context window or price; that is expected for Northern Inference names and does not stop it working.

Prefer environment variables?

Mac and Linux:

export OPENAI_API_KEY=ni_live_YOUR_KEY_HERE
export OPENAI_API_BASE=https://northerninference.ca/v1
aider --model openai/claude-sonnet-4-6-t4

Windows PowerShell, then open a new terminal:

setx OPENAI_API_KEY "ni_live_YOUR_KEY_HERE"
setx OPENAI_API_BASE "https://northerninference.ca/v1"

If a model name is not recognized

Northern Inference answers with HTTP 404 and Model 'X' is not a route this key can call. It never swaps in a different model. Use a name from the Models page with openai/ in front, or type ni-models as a message to list the models your key can call.

Troubleshooting

What you seeWhat to do
Aider asks for an OpenAI or Anthropic keyIt did not find your settings. Check the .env file name and location, or open a new terminal after setx.
401The key is wrong or was revoked. Copy it again from the portal under Keys.
402 Insufficient credits. Add credits in the portal under Billing (https://northerninference.ca/portal/?page=billing) to continue.Add credit in the portal under Billing.
404 Model 'X' is not a route this key can call.Check the name after openai/ against the Models page, or type ni-models.

Spot a problem? Write to support at northerninference dot ca.

↑