> ## 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 Cline with your own local model

> Set Cline's OpenAI Compatible provider Base URL to Tokios and drive a local model on Ollama, LM Studio, or vLLM from VS Code — reachable from anywhere.

Cline talks to Tokios through its **OpenAI Compatible** provider. Set the provider's **Base URL** to `https://api.tokios.com/v1`, the **API Key** to your `sk-tok-…` key, and the **Model ID** to your registered Tokios deployment name — Cline then routes every request down your private tunnel to your local model.

## 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 — see [API Keys](https://docs.tokios.com/setup/api-keys.md)
* The Cline extension installed in VS Code (or a compatible editor)

## Configure the OpenAI Compatible provider in Cline

**1. Open Cline's settings**

Click the gear icon in the Cline panel to open **Settings**.

**2. Select the OpenAI Compatible provider**

In the **API Provider** dropdown, choose **OpenAI Compatible**.

**3. Set the Base URL**

In the **Base URL** field, enter:

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

**4. Set the API Key**

In the **API Key** field, paste your Tokios key:

```text theme={"theme":{"light":"github-light","dark":"css-variables"}}
sk-tok-YOUR_KEY
```

**5. Set the Model ID**

In the **Model ID** field, enter your Tokios **deployment** name — the public name you registered in the [Models](https://tokios.com/console/models) tab, for example `gemma-tunnel`. This is not the local/upstream model id your backend uses.

**6. Set context window and max output manually**

The OpenAI Compatible provider doesn't auto-detect model limits. Fill in **Context Window** and **Max Output Tokens** to match your deployment's underlying model so Cline sizes requests correctly.

> [!TIP]
>
> The `Model ID` field is always your registered **deployment** name, never the upstream model id served by Ollama, llama.cpp, vLLM, or LM Studio. See [Register a model](https://docs.tokios.com/setup/register-model.md).

## If it worked in curl but returns 400 errors in Cline

If a plain `curl` request to `https://api.tokios.com/v1/chat/completions` succeeds but Cline returns a 400, work through these in order:

> [accordion] Base URL is the /v1 root, not the full chat/completions path
>
> Cline appends `/chat/completions` to whatever you put in **Base URL**. Enter `https://api.tokios.com/v1` — if you paste the full path (`https://api.tokios.com/v1/chat/completions`), Cline will request a doubled-up path and Tokios returns an error. Tokios serves a stable `/v1` OpenAI surface, so the root is unambiguous: it's always `https://api.tokios.com/v1`, nothing appended.

> [accordion] Model ID doesn't match your deployment name exactly
>
> The **Model ID** field must be the exact public deployment name shown in the [Models](https://tokios.com/console/models) tab — not the upstream model id, and not a typo'd variant. A mismatched name typically surfaces as a 404, but malformed model strings (extra whitespace, wrong casing your deployment is picky about) can also come back as a 400.

> [accordion] Streaming
>
> Cline requests streaming responses by default. Tokios returns standard OpenAI-format SSE for `"stream": true` on `/v1/chat/completions`, so this should work out of the box. If a request parameter Cline sends isn't supported by your local backend, the backend can reject it as a 400 before Tokios ever sees a routing problem.

> [accordion] Malformed request body
>
> A 400 is Tokios reporting the request body itself couldn't be processed. If the base URL and model ID both check out, check for a stray provider-specific option in Cline's advanced settings (a field that a generic OpenAI Compatible backend doesn't expect).

## Error reference

| Status | Meaning | Fix |
| - | - | - |
| `401` | Missing or invalid API key | Confirm **API Key** is your full `sk-tok-…` key, pasted with no extra whitespace |
| `403` | Key not allowed for that model, or account suspended | Check the key's model-pattern scope on the [Keys](https://tokios.com/console/keys) tab, or that it covers the deployment in **Model ID** |
| `404` | Deployment not found | Confirm **Model ID** matches a name registered on the [Models](https://tokios.com/console/models) tab exactly |
| `503` | Connector offline or at capacity (`connector_unavailable` / `connector_busy`) | Check the connector is **Online** on the [Connectors](https://tokios.com/console/connectors) tab; if busy, wait or raise `ConcurrencyCap` — see [Connector config](https://docs.tokios.com/reference/connector-config.md) |

## Next steps

Once Cline is pointed at Tokios, the same Base URL, API key, and deployment name work for any other OpenAI-compatible tool you run alongside it — no extra tunnels or port forwarding per client.

> [card] [Compatible clients](https://docs.tokios.com/guides/compatible-clients.md)
>
> See the base URL and key settings for every other supported client.

> [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.