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

# Point OpenClaw at your own local model

> Add Tokios as a custom OpenAI-compatible provider in OpenClaw so your AI agent runs on a local model via Ollama, LM Studio, or vLLM — reachable from anywhere.

OpenClaw is a self-hosted, open-source personal AI agent you reach from WhatsApp, Telegram, Discord, and other messaging platforms, with MCP tool support. It picks its model from a **providers** config — add a custom OpenAI-compatible provider pointed at `https://api.tokios.com/v1` with your `sk-tok-…` key, and OpenClaw's agent runs on a model on your own hardware.

## Prerequisites

> [card] [Connector paired](https://docs.tokios.com/setup/connector-install.md)
>
> Install and pair `tokios-connector` next to the model you want OpenClaw to reach.

> [card] [Model registered](https://docs.tokios.com/setup/register-model.md)
>
> Register a deployment (public name) for that model.

> [card] [API key created](https://docs.tokios.com/setup/api-keys.md)
>
> Create an `sk-tok-…` key, optionally scoped to that deployment.

> [card] [Supported backends](https://docs.tokios.com/setup/supported-backends.md)
>
> Confirm your local backend (Ollama, llama.cpp, vLLM, LM Studio) is running.

## Add Tokios as a model provider

**1. Open your OpenClaw config**

Edit OpenClaw's configuration, where model providers are defined under `models.providers`. The exact file path depends on your install — check your OpenClaw setup.

**2. Add a Tokios provider**

Add a provider entry with `api` set to `openai-completions`, `baseUrl` pointed at Tokios, and your deployment listed under `models`:

```json5 theme={"theme":{"light":"github-light","dark":"css-variables"}}
{
  models: {
    providers: {
      tokios: {
        baseUrl: "https://api.tokios.com/v1",
        apiKey: "${TOKIOS_API_KEY}",
        api: "openai-completions",
        models: [{ id: "gemma-tunnel", name: "Gemma (Tokios)" }]
      }
    }
  }
}
```

The `id` under `models` is your **public deployment name** from the [Models](https://tokios.com/console/models) tab, not your backend's local model id.

**3. Make it the agent's model**

Point the agent's default model at the provider you just added, using the `<provider>/<model-id>` form:

```json5 theme={"theme":{"light":"github-light","dark":"css-variables"}}
{
  agents: { defaults: { model: { primary: "tokios/gemma-tunnel" } } }
}
```

**4. Provide the API key**

Set `TOKIOS_API_KEY` in your environment to your `sk-tok-…` key rather than pasting it into the config file, then restart OpenClaw so it reloads the provider.

> [!NOTE]
>
> Replace `gemma-tunnel` with the deployment name you registered, and set `TOKIOS_API_KEY` to your own `sk-tok-…` key. Never commit a real key into the config file. OpenClaw can also speak the Anthropic surface — set `api: "anthropic-messages"` with `baseUrl: "https://api.tokios.com"` (no `/v1`) if you prefer it.

## Your assistant, your model

OpenClaw is the agent you message from your phone; Tokios gives whatever model you're running a stable, authenticated endpoint. The connector next to that model dials out to Tokios, and OpenClaw calls `https://api.tokios.com/v1` with your key — so your personal assistant runs on a model you host, without an inbound port or VPN.

## Troubleshooting

> [accordion] 401 error
>
> The API key OpenClaw sent is missing, malformed, or has been revoked. Confirm `TOKIOS_API_KEY` holds 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 id doesn't match a registered deployment, or `baseUrl` is missing `/v1`. Confirm the `models` id matches the public name on the [Models](https://tokios.com/console/models) tab, and that `baseUrl` is `https://api.tokios.com/v1`.

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