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

Cursor

Use Northern Inference as your Cursor backend

Get going in 30 seconds

  1. Cursor → Settings → Cursor Settings → Models → API Keys section:

- Enable OpenAI API Key, paste your ni_live_... key. - Enable Override OpenAI Base URL, set https://northerninference.ca/v1. - Click Save.

  1. In Add or search model, type bedrock/global.anthropic.claude-sonnet-4-6-global and add it.
  2. Select that entry from Cursor's model picker (not Cursor's built-in Claude entry).
  3. Open a chat and ask: What model are you? Then confirm the request appears at

northerninference.ca/portal → Usage.


Cursor speaks OpenAI-compatible API. NI's gateway is OpenAI-compatible, so it slots in directly.

1. Get an NI API key

northerninference.ca/portalKeysCreate key. Copy the ni_live_... string (you won't see it again).

Optional: toggle BYOK on the key if you want to use your own OpenAI / Anthropic keys at a reduced routing-only fee (NI still handles the custody chain + PII + residency layer).

2. Configure Cursor

Cursor → Settings (cog top-right) → Cursor Settings → Models.

In the API Keys section:

  1. Enable OpenAI API Key
  2. Paste your ni_live_... key
  3. Enable Override OpenAI Base URL
  4. Set URL: https://northerninference.ca/v1
  5. Click Save

3. Add NI models to Cursor's model list

Scroll up on the same panel to Add or search model. Enter the NI model ID, click Add, toggle it on. (Cursor may ask you to verify, type any text into the chat once to confirm.)

Popular model IDs to start with:

bedrock/global.anthropic.claude-sonnet-4-6-global
bedrock/global.anthropic.claude-opus-4-8-global
bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0-global
vertex_ai/gemini-2.5-pro-ca
vertex_ai/gemini-2.5-flash-ca
azure/gpt-4.1-mini-ca
bedrock/mistral.mistral-large-2402-v1:0-ca
bedrock/meta.llama3-70b-instruct-v1:0-ca

Full catalog: northerninference.ca/portal → Models shows every model ID your account can currently call, with pricing and route tier. You can also hit the public catalog directly:

curl https://northerninference.ca/api/billing/models | jq '.models[].model_id'

That prints every provider/model-name routing key the gateway recognizes. Pick the ones you want; add each one to Cursor's model list.

IMPORTANT: add as custom OpenAI models, not Cursor's built-in entries

Cursor's Override OpenAI Base URL setting is scoped to the OpenAI provider slot only. If you pick a model from Cursor's built-in picker that Cursor classifies as Anthropic, Google, or xAI (e.g. "Gemini 2.0 Flash", "Claude Sonnet 4.5"), Cursor will call that provider directly and your request will not hit NI at all. No custody chain, no residency guarantee, no PII substitution, no usage row in your NI portal.

To route Gemini / Claude / Mistral / Llama through NI, you must:

  1. Add the NI canonical model name (e.g. vertex_ai/gemini-2.5-flash-ca) under

the Model Names list in the OpenAI panel above.

  1. Select that custom entry from Cursor's model picker, not Cursor's

built-in "Gemini 2.0 Flash" / "Claude Sonnet" entries.

A quick way to verify: after sending a request, open northerninference.ca/portalUsage and confirm the request shows up within a few seconds. If it doesn't, Cursor sent it somewhere else.

Cursor tracks this as a known limitation; there is currently no per-model base-URL override, and no way to force "route everything through the OpenAI slot."

4. Pick your route

Use the exact model route key you add in settings. Copy route keys from /models. Your API key's allowed route tiers control which routes the key may call.

5. Verify it's working

Open a chat in Cursor, type:

What model are you?

You should see the model name in the response, and the request should appear at northerninference.ca/portal → Usage within a few seconds.

You can also curl the same endpoint to confirm the routing:

curl https://northerninference.ca/v1/chat/completions \
  -H "Authorization: Bearer $NI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "bedrock/global.anthropic.claude-sonnet-4-6-global",
    "messages": [{"role": "user", "content": "say hi"}],
    "max_tokens": 10
  }'

The response headers will include X-NI-Custody-Path, X-NI-Resolved-Jurisdiction, X-NI-Request-ID.

Images / vision

NI passes images through to vision-capable routes (Gemini, Claude, Gemini 2.5 Pro-class). But Cursor keeps a built-in table of which models accept images, keyed on standard names. An NI route ID like vertex_ai/gemini-2.5-pro-ca is custom, so Cursor may not recognize it as vision-capable and will refuse to attach the image (NI then receives text only).

If Cursor exposes a per-model "supports images" / "vision" toggle for a custom model, turn it on for the NI route. To confirm a route accepts images, check its supports_vision flag:

curl -sS https://northerninference.ca/v1/models \
  -H "Authorization: Bearer $NI_API_KEY" \
  | jq '.data[] | select(.supports_vision) | .id'

Full details, including the raw image_url request shape, are in vision-and-capabilities.md.

Troubleshooting

"Invalid API key" in Cursor but curl works. Cursor caches the old key. Quit and relaunch.

Requests don't show up in the NI Usage dashboard. You almost certainly picked a model from Cursor's built-in picker (Gemini, Claude, xAI) that routes to the native provider, not through NI. See "the base-URL override only applies to custom OpenAI models" above. Fix: add the NI canonical model name as a custom OpenAI model and pick that entry instead.

"...isn't one of the exact route ids your key can call" from NI. You reached NI (good, the base-URL override is working) but the exact model string you picked isn't one of your callable routes. NI replies as a normal assistant message (not an error) with the closest match as a numbered suggestion plus the full numbered list of routes your key can call. Reply with that number to map your pinned model name to that route for your account, or set your tool's model to one of the exact route ids. You can also list them with GET /api/billing/models, the portal Models page, or by sending ni-models as a prompt.

Completions are slow on first request after a gap. That's normal cold-start latency on the provider side (especially for Bedrock). Subsequent requests in the same conversation reuse the warm path.

Want to use Cursor's Composer / Cmd+K with NI? Those both go through the same OpenAI-compatible pipe, so once the Models panel is configured you get them for free.

Want to scope spend per project? Issue a separate API key per project from the portal, and use the Max spend per day field on the key create form.


Source: tests/user_run_tests/integrations/cursor.md. Spot a problem? Let us know.