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

# Connect your local model to Tokios

> Connect a runtime, verify end-to-end, and wire up your client — no inbound ports, public IP, or NAT changes.

Tokios reaches your private model over an outbound-only tunnel — nothing on your machine listens for inbound traffic. This quickstart walks you through 3 milestones: connect your runtime, verify the tunnel works, then connect your client.

Sign in at [tokios.com/console](https://tokios.com/console) and open the **Setup** tab. (First time? Confirm your email from the verification link — it's valid for 24 hours.)

## Milestone 1: Connect your runtime

Get the connector installed and your model registered so Tokios can reach it.

**1. Pair a connector**

On the **Setup** tab, optionally name the connector, then click **Start pairing**. Tokios shows a one-time **claim code** like `TKS-XXXX-XXXX`, valid for about 15 minutes.

The claim code is a pairing handle — it is **not** your API key (you create that in Milestone 3).

**2. Install the connector and approve it**

On the machine next to your model, run the install one-liner the console shows for your OS:

```powershell Windows theme={"theme":{"light":"github-light","dark":"css-variables"}}
irm https://tokios.com/downloads/install/windows | iex; tokios-install -Code 'TKS-XXXX-XXXX'
```

```bash macOS theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl -fsSL https://tokios.com/downloads/install/macos | sh -s -- --code TKS-XXXX-XXXX
```

```bash Linux theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl -fsSL https://tokios.com/downloads/install/linux | sh -s -- --code TKS-XXXX-XXXX
```

Already have `tokios-connector` installed? Skip the installer and pass the claim code directly:

```bash Already installed theme={"theme":{"light":"github-light","dark":"css-variables"}}
tokios-connector TKS-XXXX-XXXX
```

The connector dials out over a single WebSocket — no inbound ports, no public IP. Back in the console, **approve** the device. Your token is delivered securely over the tunnel; you never paste it into a file.

**3. Register your model**

In the [Models](https://tokios.com/console/models) tab, pick the model to expose and the **public name** your clients will use — for example, `gemma-tunnel`. That public name is the `"model"` value in every API request.

> [!NOTE]
>
> **Success state:** your model appears in the [Models](https://tokios.com/console/models) tab with an active connector. The tunnel is live — but you have not tested it yet.

## Milestone 2: Verify end-to-end

Test in the Playground **before** creating an API key. This confirms the tunnel and model work together.

**1. Try it in the Playground**

Open the [Playground](https://tokios.com/console/playground) tab, pick your model, type a prompt, and click **Run**. The Playground authenticates with your current session — no API key needed — so you can confirm the tunnel works before wiring up a client.

**Success state:** you get a response from your local model through the Tokios endpoint. If the Playground returns a completion, the tunnel is healthy and you are ready to connect a client.

> [!TIP]
>
> If the Playground times out, check that your local model is running and the connector shows **Connected** in the console. See [Troubleshooting](https://docs.tokios.com/reference/troubleshooting.md) for common fixes.

## Milestone 3: Connect your client

Create an API key and point your coding agent at Tokios.

**1. Create an API key**

In the [Keys](https://tokios.com/console/keys) tab, click **Create key**. Give it a display name and, optionally, model patterns to scope it (leave `*` to allow all your models). Copy the `sk-tok-…` key immediately — it is shown only once.

**2. Point your client and test**

Pick your client. Each needs the base URL for its dialect, your `sk-tok-…` key, and your public model name:

* **Anthropic style** (Claude Code): `https://api.tokios.com`
* **OpenAI style** (Codex, OpenAI SDKs): `https://api.tokios.com/v1`

```bash Claude Code theme={"theme":{"light":"github-light","dark":"css-variables"}}
export ANTHROPIC_BASE_URL=https://api.tokios.com
export ANTHROPIC_API_KEY=sk-tok-YOUR_KEY
claude --model gemma-tunnel
```

```bash Codex theme={"theme":{"light":"github-light","dark":"css-variables"}}
export OPENAI_API_KEY=sk-tok-YOUR_KEY
# add a Tokios provider to ~/.codex/config.toml:
#   base_url = "https://api.tokios.com/v1"  ·  wire_api = "responses"
codex --profile tokios
```

```bash curl theme={"theme":{"light":"github-light","dark":"css-variables"}}
curl https://api.tokios.com/v1/chat/completions \
  -H "Authorization: Bearer sk-tok-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-tunnel",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

Full setup per client: [Claude Code](https://docs.tokios.com/guides/claude-code.md) · [OpenAI Codex](https://docs.tokios.com/guides/openai-codex.md).

A successful call returns a completion shaped for your client's dialect — for the curl above, an OpenAI-shaped response (abbreviated):

```json theme={"theme":{"light":"github-light","dark":"css-variables"}}
{
  "model": "gemma-tunnel",
  "choices": [
    {
      "message": { "role": "assistant", "content": "Hello! How can I help?" },
      "finish_reason": "stop"
    }
  ]
}
```

**Success state:** your client talks to your local model through Tokios. The response comes back from your own hardware, not a cloud provider.

## What's next?

> [card] [Use with Claude Code](https://docs.tokios.com/guides/claude-code.md)
>
> Point Claude Code at Tokios and run your coding agent against your own local model.

> [card] [Expose more models](https://docs.tokios.com/reference/connector-config.md)
>
> Serve several models through one connector with a config file.


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