> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokios.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Tokios exposes private local models through https://api.tokios.com using an outbound-only connector tunnel.
> Use 'connector' for the local tokios-connector process.
> Use 'deployment' for the public model name in the API model field.
> Use 'upstream model id' for the model served by Ollama, llama.cpp, vLLM, LM Studio, or another local backend.
> API keys use the prefix sk-tok-. Connector tokens use the prefix ct-tok-.

# Use Cursor with your own local model

> Point Cursor's OpenAI-compatible base URL at Tokios so its completion and agent features can reach a local model on Ollama, LM Studio, llama.cpp, or vLLM.

Cursor's completion and agent features run through Cursor's cloud, not your machine, so they can't reach a model on `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](https://docs.tokios.com/setup/connector-install.md)
* A registered model deployment name — see [Register a model](https://docs.tokios.com/setup/register-model.md)
* A Tokios API key (`sk-tok-…`) — see [API Keys](https://docs.tokios.com/setup/api-keys.md)
* 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 to `127.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 <kbd>Cmd</kbd>+<kbd>,</kbd> (macOS) or <kbd>Ctrl</kbd>+<kbd>,</kbd> (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:

```text theme={"theme":{"light":"github-light","dark":"css-variables"}}
https://api.tokios.com/v1
```

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](https://tokios.com/console/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.

> [!NOTE]
>
> 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.

> [!WARNING]
>
> The override applies to Cursor's chat and agent panel (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd>+<kbd>L</kbd>). Tab autocomplete and inline edit keep running on Cursor's own models regardless of this setting, so those 2 features never reach your local model.

## Why this beats an ngrok tunnel

Cursor's cloud-only architecture is exactly why the common workaround is `ngrok 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/v1` doesn'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

> [accordion] 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](https://tokios.com/console/keys) tab.

> [accordion] 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](https://tokios.com/console/models) tab — not your Ollama/llama.cpp/vLLM/LM Studio local model id.

> [accordion] 503 error
>
> The connector for that deployment is offline or at its concurrency cap. Check the [Connectors](https://tokios.com/console/connectors) tab — the connector needs to show as **Online**, and the machine running it needs to still be up and reachable.

## Next steps

> [card] [Compatible clients](https://docs.tokios.com/guides/compatible-clients.md)
>
> See base URL and key setup for other OpenAI- and Anthropic-compatible clients.

> [card] [API keys](https://docs.tokios.com/setup/api-keys.md)
>
> Create, scope, and rotate `sk-tok-…` keys for teammates and agents.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.