# Northern Inference > Sovereign AI infrastructure for Canadian teams. One approved, OpenAI-compatible and Anthropic-compatible AI API with exact-route selection, fail-closed Tier 3 Canadian routes, and a signed request-level chain-of-custody record of the route Northern Inference selected up to the third-party provider boundary. Built and operated in Canada for federal, provincial, territorial and municipal use, and for regulated industries. Northern Inference is a single OpenAI-compatible and Anthropic-compatible API for developers and autonomous agents that want sovereign control over AI routing. Instead of trusting that a request stayed in the right place, the customer selects an exact route and receives the provider, region, jurisdiction and credential source Northern Inference recorded for that request, plus a canonical custody digest and, when signing is available, Northern Inference's Ed25519 signature. The signed record attests the path Northern Inference selected up to the provider boundary. Provider documentation, attestations and contracts govern execution and data handling inside the provider. Northern Inference is onboarding teams now. ## Sovereignty and data residency - Sovereign routing: choose an eligible Tier 3 route to require the Northern Inference controlled path and the selected provider region to stay in Canada. Tier 3 fails closed instead of silently rerouting outside Canada. - Exact-route selection: the customer picks a specific deployed route, not a generic model name that a router may satisfy from anywhere. The route is the contract. - Auditable route evidence: routed model responses carry unsigned route-summary headers. The portal and custody API provide the canonical digest and, when signing is available, Northern Inference's Ed25519 signature. This attests the route Northern Inference selected and recorded up to the provider boundary; it is not independent proof of provider-internal execution. - Canadian data residency available. PIPEDA and Privacy Act jurisdiction. Built and operated in Canada. - Security and sovereignty model: https://northerninference.ca/security.html - Trust and data residency: https://northerninference.ca/trust.html - Defence and aerospace capabilities: https://northerninference.ca/defence.html - Privacy policy: https://northerninference.ca/privacy.html ## Privacy tiers Every route carries a privacy tier, and the tier is a property of the route the customer selected rather than a request-time preference. - Managed Cloud (Tier 3), available now: the selected provider region is Canadian and the provider operates under contractual terms that do not permit training on customer data. Some providers may retain prompts for a limited abuse-monitoring window unless modified abuse monitoring has been approved; see the trust and privacy pages for the current position. - Provider API (Tier 4), available now: the broadest model selection, including routes whose provider regions are outside Canada. Jurisdiction is recorded per request so the customer can see exactly where a request went. - Self-Hosted Hardware and Sovereign Hardware tiers are on the roadmap. ## Who Northern Inference is for Northern Inference is open to everyone. Anyone can sign up and call the same API: individual developers, startups, students, researchers and academic institutions, non-profits, and the general public. Every customer gets the same exact-route selection and the same per-request custody records. ## Built for Canadian government and public sector Northern Inference is purpose-built for organizations with Canadian data-sovereignty and data-residency requirements: the Government of Canada and the broader public sector across the federal, provincial, territorial and municipal levels; federal agencies and departments such as Health Canada and Indigenous Services Canada; provincial ministries and Crown corporations; the defence and aerospace sector, including organizations under the Controlled Goods Program; education and research institutions; and regulated industries including healthcare, finance, legal and insurance. It supports PIPEDA and Privacy Act data-residency expectations with fail-closed Canadian routing and signed, auditable records of the route Northern Inference selected up to the provider boundary. Provider evidence remains authoritative for execution inside the provider. Northern Inference is working toward a Government of Canada Authority to Operate (ATO), with controls designed and self-assessed against the ITSG-33 control catalogue at the Protected B (PBMM) profile. An ATO is a department's risk acceptance of a specific deployment, not a portable vendor certification, so the assessment is completed together with the customer department. The trust page sets out the full compliance posture, including what is inherited from the underlying cloud provider and what Northern Inference built itself: https://northerninference.ca/trust.html ## Capabilities - Chat completions, streaming, and tool or function calling through the OpenAI-compatible and Anthropic-compatible surfaces. - Embeddings, reranking, and multimodal routes, subject to what each deployed route supports. The live catalog is authoritative. - Optional PII substitution: named entities can be substituted before a request leaves Northern Inference's infrastructure and restored in the response. - Bring your own key: customers may route through their own provider credentials, and the credential source is recorded per request. - Per-request cost records: provider cost and Northern Inference's fee are recorded separately so spend can be reconciled rather than taken on trust. ## Models The live catalog is authoritative and lists every route with its privacy tier, jurisdiction, pricing and capabilities. Families served at the time of writing: - Frontier models: Anthropic Claude (Opus 5, Sonnet 5, Fable 5, Opus 4.8, Sonnet 4.6, Haiku 4.5), OpenAI GPT-5.6 (Luna, Sol, Terra) and GPT-4.1 (mini, nano), xAI Grok 4.6. - Open-weight models: DeepSeek V4 (Pro, Flash), DeepSeek V3.2 and R1, Zhipu GLM-5, OpenAI gpt-oss-120b, Meta Llama 3, Mistral and Mixtral, Google Gemma 3, Amazon Nova. - Embeddings, reranking, image embeddings and text-to-speech routes. - Planned Canadian-owned capacity for GLM-5.3 Flash, Kimi K3, DeepSeek V4 Flash and Qwen 3.8. ## API endpoints - OpenAI-compatible base URL: `https://northerninference.ca/v1` (for example, POST `https://northerninference.ca/v1/chat/completions`) - Anthropic-compatible: `https://northerninference.ca/v1/messages` (set `ANTHROPIC_BASE_URL=https://northerninference.ca`) - Authentication: `Authorization: Bearer ni_live_...` - Live model catalog (machine-readable): https://northerninference.ca/v1/models - Model catalog (web): https://northerninference.ca/models/ - Pricing (machine-readable, no API key required): https://northerninference.ca/api/billing/models returns JSON listing every public route with its input, output and cache rates in USD per million tokens, its privacy tier, jurisdiction and capabilities. This is the machine-readable source behind the human pricing page, so an agent should read it directly rather than parsing HTML. - Currency conversion used for billing: https://northerninference.ca/api/billing/fx-rate - Pricing (human): https://northerninference.ca/pricing.html Route identifiers are the authoritative model names and are listed in the live catalog. Copy the exact route from the catalog rather than assuming a provider-prefixed or unsuffixed name will resolve. ## Agent self-service An AI agent can request access to a Northern Inference account, get the account owner's approval, manage that account's inference keys itself and, when the operator has agent payments switched on, start card setups and credit purchases that the owner completes on Stripe. The agent never holds the owner's password, a browser session or card details. - Base path: `https://northerninference.ca/api/agent/v1/` - Machine-readable description (OpenAPI 3.1): https://northerninference.ca/docs/agent-openapi.yaml - Guide with curl examples: https://northerninference.ca/docs/agents.html Steps: 1. Make a random PKCE code verifier (43 to 128 characters of `A-Za-z0-9-._~`) and its S256 challenge (unpadded base64url SHA-256 of the verifier). 2. `POST /api/agent/v1/enrollments` with JSON `email` (the owner's address), `agent_label` (1 to 80 characters, shown to the owner), `scopes`, `code_challenge`, `code_challenge_method` set to `S256`, and optionally `account_name`. Send an `Idempotency-Key` header (8 to 200 printable ASCII characters). The answer is 202 with `enrollment_id`, `status_url` and `claim_url`. Scopes: `account:read`, `keys:read`, `keys:write`, and the payment scopes `billing:read`, `billing:setup`, `billing:topup`. A payment scope is accepted only while agent payments are switched on; otherwise the request answers 422 `scope_not_available`. The owner sees each scope in plain language and approves or declines the whole request. 3. Northern Inference emails the owner a single-use link to `https://northerninference.ca/agent-approve.html`. The owner approves or declines. A new owner sets a password and accepts the Terms, Privacy Policy and Acceptable Use Policy first. The agent cannot approve its own request. The request expires after 24 hours. 4. Poll `GET /api/agent/v1/enrollments/{enrollment_id}` until `status` is `approved`. Other statuses are `pending`, `declined`, `expired` and `claimed`. 5. `POST /api/agent/v1/enrollments/{enrollment_id}/claim` with JSON `code_verifier`. The answer is 201 with a management credential beginning `ni_mgmt_`, shown once and valid for 90 days. Store it at once. A second claim answers 409 `already_claimed`. 6. Send it as `Authorization: Bearer ni_mgmt_...` to manage the account: `GET /account` (`account:read`), `GET /keys` (`keys:read`), `POST /keys`, `PATCH /keys/{id}`, `POST /keys/{id}/rotate` and `DELETE /keys/{id}` (`keys:write`). Creating and rotating a key need an `Idempotency-Key`. The new key's secret (`ni_live_...`) is returned once; a retry with the same `Idempotency-Key` returns `secret_already_issued: true` and no secret, and rotating recovers a lost one. The payment endpoints are described under Funding below. `DELETE /api/agent/v1/credential` ends the agent's own credential. 7. Call models with the `ni_live_` key on the OpenAI-compatible API above. A `ni_mgmt_` credential cannot call models, and a `ni_live_` key cannot change the account. Funding: a new agent-created account starts with no credit, and inference needs a funded balance. An agent that holds the payment scopes can start the funding, but the owner always completes it on Stripe, and Northern Inference sends the owner the Stripe link by email. The agent never receives the link and never sees or enters card details. 1. Optional, `billing:setup`: `POST /api/agent/v1/billing/setup-sessions` (send an `Idempotency-Key`, no body) starts adding a payment method. The owner enters the card on Stripe; adding a card does not charge it. 2. `billing:topup`: `POST /api/agent/v1/billing/topups` with JSON `amount_cents` (the credits; a whole number from 2500, which is CA$25.00, up to CA$500 by default) and an `Idempotency-Key`. The owner receives an email with the credits, the service fee and the total, and pays on Stripe. Nothing is charged unless the owner pays. Agents cannot turn on automatic top-up or charge a saved card. 3. The answer is 201 with `payment_id` (or `setup_id`), `session_id`, `display_status`, `expires_at`, the amounts as exact decimal strings and `delivery`. It never contains a payment link: do not look for one. `delivery` is `owner_email` when the email was sent. If it is `email_failed`, the checkout exists but the email did not go out; repeat the same request with the same `Idempotency-Key` to try the email again (no second checkout is made). A retry with the same key and body returns 200 and sends no second email; the same key with a different body answers 409 `idempotency_key_reused`. 4. Poll `GET /api/agent/v1/billing/topups/{payment_id}` or `GET /api/agent/v1/billing/setup-sessions/{setup_id}` (`billing:read`) every few seconds. They read Northern Inference's own records, not Stripe. A top-up is paid when `display_status` is `succeeded` and `credited` is true. It has ended unpaid when `display_status` is `expired_unpaid`; links last 60 minutes by default. A setup is done when `status` is `completed`. Poll these, not `GET /api/agent/v1/billing`, which makes a live read of the saved card and is limited to 4 per hour per account. 5. `GET /api/agent/v1/billing` (`billing:read`) shows the balance, the top-up terms, open top-ups, the 10 latest payments and the saved card as brand, last four digits and expiry. `GET /api/agent/v1/account` reports `available_balance_cents`. When it is above zero, create a key and call models. After Stripe, the owner lands on https://northerninference.ca/agent-payment.html, a temporary page that shows whether the payment was received. The page is for the owner, not the agent. Payment limits: 10 new links per hour per credential and 30 per day per account, 3 open top-ups and 3 open card setups per account, links valid for 60 minutes, and no more than 4 live saved-card reads per hour per account. A 429 carries `Retry-After`; `too_many_open_checkouts` means pay or wait for an open link to expire. Limits: enrollment requests are limited to 5 per hour across all callers, 5 per hour per email address and 10 per hour per IP address, and one IP address can request access for only one distinct email address per 24 hours (429 `agent_enrollment_ip_email_limit`). Every 429 carries `Retry-After` in seconds. Turning off agent sign-ups makes the enrollment, status, approval and claim calls answer 403 `agent_registration_disabled`; it does not cut off a credential that was already issued. The operator can also pause all agent access: every call with a `ni_mgmt_` credential then answers 403 `agent_access_blocked` until the pause is lifted, and the credential is not revoked. While agent payments are off, billing calls answer 403 `agent_billing_disabled`. Owners can see and revoke agent access in the portal, on the API Keys page under Agent access. Revoking ends that agent's access; keys it already created keep working until the owner revokes them, and a Stripe link already emailed to the owner still works until it expires. Errors use the standard error envelope: branch on the HTTP status and `error.code`. ## Documentation and integrations - Integration guides index: https://northerninference.ca/docs/ - AI agent self-service (agents request access and manage their own keys): https://northerninference.ca/docs/agents.html - Claude Code: https://northerninference.ca/docs/claude-code.html - Anthropic SDK: https://northerninference.ca/docs/anthropic-sdk.html - OpenAI Codex: https://northerninference.ca/docs/codex.html - Cursor: https://northerninference.ca/docs/cursor.html - Continue (VS Code and JetBrains): https://northerninference.ca/docs/continue.html - Aider: https://northerninference.ca/docs/aider.html - Zed: https://northerninference.ca/docs/zed.html - Open WebUI: https://northerninference.ca/docs/openweb_ui.html - LibreChat: https://northerninference.ca/docs/librechat.html - LangChain and LlamaIndex: https://northerninference.ca/docs/langchain.html - curl and HTTPie (OpenAI SDK shape): https://northerninference.ca/docs/curl.html - pi coding agent: https://northerninference.ca/docs/pi.html - OpenClaw: https://northerninference.ca/docs/openclaw.html - OpenCode: https://northerninference.ca/docs/opencode.html - Hermes Agent: https://northerninference.ca/docs/hermes.html - Speech and transcription (text-to-speech and audio transcription routes): https://northerninference.ca/docs/audio.html - Vision and per-model capabilities: https://northerninference.ca/docs/vision-and-capabilities.html - In-chat NI commands (ni-help, ni-models, ni-map-model): https://northerninference.ca/docs/ni-commands.html - Public data-use posture per route: https://northerninference.ca/data-use/ ## Optional - Acceptable use policy: https://northerninference.ca/aup.html - Terms of service: https://northerninference.ca/terms.html - Service status: https://northerninference.ca/status.html - Contact: https://northerninference.ca/contact.html - Sitemap: https://northerninference.ca/sitemap.xml ## For autonomous agents Northern Inference is a drop-in sovereign provider for any OpenAI-compatible or Anthropic-compatible client or agent framework. To use it: get an API key at https://northerninference.ca, set the base URL above, and call any route in the live catalog. An agent can also request its own account and API keys, with the owner's approval by email, through https://northerninference.ca/api/agent/v1/ (see "Agent self-service" above and https://northerninference.ca/docs/agent-openapi.yaml). Each routed model response includes unsigned route-summary headers. The portal and custody API provide a digest and, when signing is available, Northern Inference's signature for the route Northern Inference selected up to the provider boundary. If a requested route is unknown, Northern Inference never silently substitutes a different model: the request fails with HTTP 404 and `error.code` `model_not_found`, in the same error envelope as any other API error, with the header `x-ni-model-not-found: 1`. An id that matches several deployed routes fails with 400 `ambiguous_model_route`. `GET /v1/models` lists every route the key can call. A key with Detailed error guidance turned on also receives that list, numbered, in `error.ni_guidance`. Northern Inference's own refusals are real HTTP errors, never model answers. A key whose policy does not allow a route's privacy tier gets 403 `privacy_tier_not_allowed`. A request to a route that would not keep your prompts zero-retention gets 403 with the header `x-ni-non-zdr-consent-required: 1`. Branch on the status and `error.code`. Northern Inference answers with HTTP 200 itself only for an in-chat command such as `ni-help`, or a numbered reply to one of its offers. That response `id` begins with `nicmd-` on the OpenAI chat completions endpoint and `msg_nicmd_` on the Anthropic messages endpoint, it reports `usage` of zero, and it is never billed. Detect it by the `id`, not the `model` field, which echoes the route you named.