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

> Point Aider at a local model running on Ollama, LM Studio, or vLLM by setting OPENAI_API_BASE and OPENAI_API_KEY to your Tokios endpoint and key.

Aider talks to models through the OpenAI API, so it reads `OPENAI_API_BASE` and `OPENAI_API_KEY` from your environment. Set `OPENAI_API_BASE` to `https://api.tokios.com/v1`, set `OPENAI_API_KEY` to your `sk-tok-…` key, and select your model with the `openai/` prefix — for example, `aider --model openai/gemma-tunnel`.

## 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)
* Aider installed

## Configure Aider

Export the two environment variables, then run Aider with the `openai/` model prefix followed by your deployment name.

```bash macOS / Linux theme={"theme":{"light":"github-light","dark":"css-variables"}}
export OPENAI_API_BASE=https://api.tokios.com/v1
export OPENAI_API_KEY=sk-tok-YOUR_KEY

aider --model openai/gemma-tunnel
```

```powershell Windows theme={"theme":{"light":"github-light","dark":"css-variables"}}
$env:OPENAI_API_BASE = "https://api.tokios.com/v1"
$env:OPENAI_API_KEY = "sk-tok-YOUR_KEY"

aider --model openai/gemma-tunnel
```

Replace `gemma-tunnel` with the public deployment name you registered in the console.

> [!NOTE]
>
> Aider may print a warning that it doesn't recognize the model name and can't confirm its context window or cost. This happens because `gemma-tunnel` isn't in Aider's built-in model metadata list — it's expected for any local or private deployment name, and it's harmless. Aider still sends requests to `OPENAI_API_BASE` normally.

## If something doesn't work

* **401 from Tokios** — `OPENAI_API_KEY` is missing, mistyped, or the key was revoked. Confirm the key is active on the [Keys](https://tokios.com/console/keys) tab.
* **404 deployment not found** — the name after `openai/` doesn't match a registered deployment. Check the exact public name on the [Models](https://tokios.com/console/models) tab.
* **403** — the key isn't scoped to that deployment's model pattern, or the account is suspended. Check the key's model patterns on the [Keys](https://tokios.com/console/keys) tab.
* **503 connector\_unavailable / connector\_busy** — the connector paired with that deployment is offline, or it's already handling its concurrency cap of requests. Confirm the connector is running and connected on the [Connectors](https://tokios.com/console/connectors) tab.

## Your model never leaves your machine — your endpoint works everywhere

Aider only ever talks to `https://api.tokios.com/v1`. Your model, its weights, and your code stay on the machine running the connector. By default Tokios stores no prompt or response bodies, only usage counts and metadata. If your workspace admin turns on [request logging](https://docs.tokios.com/setup/request-logging.md), request bodies (never responses) are kept encrypted for 7 days, readable only in your own dashboard — and with a coding agent, those bodies include the files it read.

> [card] [Compatible clients](https://docs.tokios.com/guides/compatible-clients.md)
>
> See the base URL and API key setting for every 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.