localhost or your private LAN — they need a public HTTPS endpoint. Tokios gives you one at https://api.tokios.com/v1: pair the connector next to your model, register a deployment name, and hand Cursor that URL with an sk-tok-… key. No ngrok tunnel to keep open, no unauthenticated port.
Prerequisites
- A running Tokios connector paired with your local model — see Connector install
- A registered model deployment name — see Register a model
- A Tokios API key (
sk-tok-…) — see API Keys - Cursor installed
Why Cursor can’t just use localhost
Cursor’s model requests are made from Cursor’s backend, not from the code editor process on your laptop. That backend has no route to127.0.0.1 or to a machine on your home or office network — it can only call an endpoint reachable on the public internet over HTTPS. This is why pointing Cursor at a bare http://localhost:11434 or a LAN IP doesn’t work, and why any working setup — Tokios included — has to put a public HTTPS URL in front of your local model.
Point Cursor at Tokios
1
Open Cursor's model settings
Open settings with Cmd+, (macOS) or Ctrl+, (Windows/Linux), then choose Models in the sidebar. Field labels shift between Cursor versions, so check yours if the names below don’t match.
2
Override the base URL
Set Override OpenAI Base URL to:Keep the
/v1 suffix — Cursor appends /chat/completions to whatever you enter here.3
Add your deployment as a custom model
Add a custom model using the public deployment name you registered in the Models tab — for example,
gemma-tunnel. This is the value Cursor sends in the model field; it is not Ollama’s, llama.cpp’s, vLLM’s, or LM Studio’s local model id.4
Paste your Tokios API key
Paste your
sk-tok-… key into Cursor’s API key field for the custom model. Cursor sends it as a Bearer token on every request.Replace
gemma-tunnel with the deployment name you registered, and sk-tok-YOUR_KEY with your own key. Never commit either into a shared config file.Why this beats an ngrok tunnel
Cursor’s cloud-only architecture is exactly why the common workaround isngrok http 11434 plus OLLAMA_HOST=0.0.0.0 (or OLLAMA_ORIGINS=*) to make Ollama reachable at all. That combination works, but it leaves your model listening with no authentication behind a URL that changes every time you restart the tunnel — anyone who finds that URL while it’s live can call your model.
Tokios’s connector is outbound-only, so your model never opens an inbound port, and every request to it carries a scoped sk-tok-… key instead of nothing at all:
- No unauthenticated exposure — the connector dials out to Tokios; it never listens on a port, and requests need a valid key.
- Stable URL —
https://api.tokios.com/v1doesn’t change between restarts, so you set it in Cursor once. - Scoped keys — a key can be limited to specific deployments and revoked instantly if it leaks, without touching your local model or connector.
Troubleshooting
401 error
401 error
The API key Cursor sent is missing, malformed, or has been revoked. Confirm you pasted the full
sk-tok-… key with no extra whitespace, and check its status on the Keys tab.404 error
404 error
The
model value Cursor sent doesn’t match a registered deployment. Confirm the custom model name in Cursor exactly matches the public name on the Models tab — not your Ollama/llama.cpp/vLLM/LM Studio local model id.503 error
503 error
The connector for that deployment is offline or at its concurrency cap. Check the Connectors tab — the connector needs to show as Online, and the machine running it needs to still be up and reachable.
Next steps
Compatible clients
See base URL and key setup for other OpenAI- and Anthropic-compatible clients.
API keys
Create, scope, and rotate
sk-tok-… keys for teammates and agents.