> ## 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 JetBrains AI Assistant with your own local model

> Point JetBrains AI Assistant's OpenAI-compatible provider at Tokios so IntelliJ, PyCharm, GoLand, and Rider reach a local model on Ollama, LM Studio, or vLLM.

JetBrains AI Assistant has a built-in **OpenAI-compatible endpoints** field for custom providers. Tokios gives you a stable, authenticated URL to put there: pair the connector next to your model, register a deployment name, and hand AI Assistant that URL with an `sk-tok-…` key. No tunnel to babysit, no unauthenticated port on your machine.

This works the same way across JetBrains IDEs that ship AI Assistant — IntelliJ IDEA, PyCharm, GoLand, WebStorm, Rider, and others.

## 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)
* A JetBrains IDE with the AI Assistant plugin installed

## Point AI Assistant at Tokios

**1. Open AI Assistant's provider settings**

Open **Settings | Tools | AI Assistant | Providers & API keys**. JetBrains has moved this setting between releases, so confirm the exact menu path and label for your installed AI Assistant version.

**2. Find the OpenAI-compatible endpoints section**

Look for the **OpenAI-compatible endpoints** section, used for third-party OpenAI-compatible servers — the exact field labels shown here can vary by version, so check yours.

**3. Enter the Tokios URL**

Set the endpoint URL to:

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

**4. Paste your Tokios API key**

Paste your `sk-tok-…` key into the API key field for this endpoint. AI Assistant sends it as a Bearer token on every request.

**5. Add your deployment as the model**

Enter the **public deployment name** you registered in the [Models](https://tokios.com/console/models) tab — for example, `gemma-tunnel` — as the model for this endpoint. This is the value AI Assistant sends in the `model` field; it is not Ollama's, llama.cpp's, vLLM's, or LM Studio's local model id.

**6. Toggle tool calling if you need it**

If AI Assistant exposes a toggle for tool/function calling on this endpoint, enable it. Whether the model actually acts on tool calls depends on the underlying model itself.

> [!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]
>
> AI Assistant's custom-provider support in JetBrains IDEs is documented as an OpenAI-compatible slot. There is no confirmed custom Anthropic-compatible base URL field, so connect through the OpenAI-compatible endpoint above rather than Tokios's Anthropic-style endpoint.

> [!NOTE]
>
> A custom endpoint does not power every AI Assistant feature. As of the 2026.1 releases, JetBrains documents third-party and local models as working in **AI Chat**, while Junie and next-edit suggestions still require JetBrains' cloud models. Expect chat to switch over and inline suggestions to stay on the built-in provider.

Use **Test Connection** in the provider settings to confirm the endpoint answers before assigning models to features.

## Why this beats a bare tunnel

Without something in front of it, a local model server only listens on `localhost` or your LAN, and JetBrains' cloud-hosted AI Assistant backend can't reach either. A raw tunnel (for example `ngrok`) can expose the port, but it typically leaves the model listening with no authentication behind a URL that changes on every restart.

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:

* **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 AI Assistant 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 AI Assistant 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 AI Assistant sent doesn't match a registered deployment. Confirm the model name you entered in AI Assistant 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] [Quickstart](https://docs.tokios.com/quickstart.md)
>
> Set up the connector, register a model, and create a key from scratch.

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


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