# Use Xantly with Cline (VS Code)

Cline is the most popular AI coding agent for VS Code, full autonomous agent mode, file editing, terminal commands, plan/act split. Point it at Xantly and you get smart routing, semantic cache, and memory on every completion.

## Prerequisites

- VS Code with the [Cline extension](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev) installed
- A Xantly API key, [create one](/dashboard/api-keys)

## Setup

1. Open Cline's settings panel (gear icon in the Cline sidebar).
2. Under **API Provider**, select **OpenAI Compatible**.
3. Fill in:

| Field | Value |
|---|---|
| Base URL | `https://api.xantly.com/v1` |
| API Key | `xantly_sk_...` (your Xantly key) |
| Model ID | `xantly/auto-quality` (or any catalog model, see below) |

4. Hit **Save**. Cline reloads the model list from `/v1/models` and you're done.

## Model choice

Cline's agent mode (plan → act → verify loop) benefits from strong tool-calling. Recommended:

| Model ID | Why |
|---|---|
| `xantly/auto-quality` | BaRP routes from the T1 pool. Best agent performance. |
| `anthropic/claude-sonnet-4.6` | Pinned Claude. Strong tool-calling, great for complex multi-file refactors. |
| `openai/gpt-5.4` | Pinned GPT. Excellent at structured JSON outputs. |
| `xantly/auto-value` | Budget-conscious daily driver. |

**Don't** use `xantly/auto-speed` for agent mode, T3 models trade tool-calling reliability for speed. Fine for inline chat, not for multi-step plans.

## Verify tool-calling works

Cline's agent mode depends on OpenAI tool-call format. Xantly speaks it natively, but let's confirm end-to-end:

1. Open a project in VS Code.
2. Launch Cline, type: *"Read package.json and tell me which dependencies are outdated. Then patch them."*
3. Cline should call the `read_file` tool, think, and propose a patch.

If Cline silently stops after the first tool call, your model doesn't support parallel tool calls. Switch to `xantly/auto-quality` or `anthropic/claude-sonnet-4.6`.

## What you get

- **Waterfall fallback.** Cline requests that error out (provider 500, timeout) are silently retried against the next-best model in the same tier.
- **Semantic cache.** Cline often re-asks similar questions across sessions ("how does this file work?"). L2 semantic cache returns instantly at near-zero cost.
- **Memory across sessions.** Xantly's L3 graph memory remembers prior project context. Cline can surface it via `X-Xantly-Memory-Mode: recall` (see [Memory & Context](/docs/memory-and-context)).
- **Cost transparency.** Every Cline request shows up in your Xantly dashboard with cost, model, cache status.

## Gotchas

**"Model ID must include provider prefix."** Cline expects OpenRouter-style IDs (`anthropic/...`, `openai/...`). Use the `provider/model` format, not bare model names. Xantly's `xantly/auto-*` aliases also work.

**Base URL needs `/v1` suffix.** Don't use `https://api.xantly.com` (bare), Cline expects the full OpenAI-compatible base URL with `/v1`.

**Auto-completion dropdown shows stale models.** Cline caches the `/v1/models` response per session. Restart VS Code after you add new models to your Xantly catalog.

## Next steps

- [Roo Code](/docs/use-with-roo-code), Cline fork with extra multi-agent features. Same config pattern.
- [Kilo Code](/docs/use-with-kilo-code), another Cline fork, #1 IDE Extension on OpenRouter by token volume.
- [Continue.dev](/docs/use-with-continue-dev), per-role config (chat / edit / autocomplete separately). Great for "Xantly for chat, Ollama for autocomplete" hybrid setups.
- [Bring Your Own Key](/docs/bring-your-own-key), use your own provider credits through Xantly's routing.
