# Use Xantly with Roo Code

[Roo Code](https://github.com/RooCodeInc/Roo-Code) is a Cline fork with extra features for multi-agent orchestration, custom modes, and enterprise workflows. Same Xantly setup as Cline, with one additional pattern: per-mode model assignment.

## Prerequisites

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

## Setup

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

| Field | Value |
|---|---|
| Base URL | `https://api.xantly.com/v1` |
| API Key | `xantly_sk_...` |
| Model ID | `xantly/auto-quality` |

4. Save.

## Custom modes per model (Roo-specific win)

Roo's killer feature is custom modes, configure different personalities (Code, Architect, Reviewer, Debugger) with different models. Xantly pairs perfectly with this:

| Mode | Recommended Model | Why |
|---|---|---|
| Code | `xantly/auto-quality` | Best code generation |
| Architect | `anthropic/claude-sonnet-4.6` | Strong planning/design reasoning |
| Reviewer | `openai/gpt-5.4` | Good at structured output + critique |
| Debugger | `xantly/auto-quality` | Needs tool calling reliability |
| Docs | `xantly/auto-value` | Cheap, fine quality |
| Commit Message | `xantly/auto-speed` | Fast, trivial task |

Configure each mode's model in Roo's settings → Modes → pick mode → API Configuration → override model.

## Verify tool-calling

Same as Cline. Load a project, ask:

```
Read package.json, check which deps are out of date, propose a patch.
```

Roo should fire tool calls (`read_file`, think, `write_to_file`) and land a patch. If tool-calling fails, swap the model to `xantly/auto-quality` or `anthropic/claude-sonnet-4.6`.

## What you get

- **Multi-agent savings.** Roo's multi-agent mode fans out work across 3-5 sub-agents. L2 semantic cache is disproportionately valuable here, sub-agents often re-ask similar questions.
- **Waterfall fallback.** Mid-run provider outages don't break Roo's agent loop.
- **Mode-specific memory.** Each mode can have its own `X-Xantly-Memory-Mode` setting, Code mode uses `recall`, Architect uses `full`, Commit Message uses `none`.
- **Cost by mode.** Roo's dashboard + Xantly's per-key breakdown lets you see exactly which mode spent what.

## Gotchas

**Model ID must include provider prefix.** `anthropic/claude-sonnet-4.6`, not `claude-sonnet-4.6`. Bare slugs that don't match the catalog get rejected.

**Custom modes cache their model choice.** After changing a mode's model, restart VS Code to force Roo to reload.

**Roo is the #1 IDE Extension on OpenRouter by token volume.** Heavy users can blow through T1 credit budgets fast, consider setting a daily USD cap on your Xantly API key (dashboard → API Keys → Edit → Daily Budget USD).

## Next steps

- [Cline](/docs/use-with-cline), the upstream Roo was forked from.
- [Kilo Code](/docs/use-with-kilo-code), another Cline fork, similar pattern.
- [Multi-Agent Orchestration](/docs/multi-agent-orchestration), Xantly's optimizations for multi-agent workloads.
