Roo Code
Connect Roo Code to Mixen — pay from your balance in roubles, with a catalog of 105+ models.
Installation
Section titled “Installation”Roo Code is an agentic extension for VS Code (a fork of Cline). Install it from the VS Code Marketplace: Extensions → search for “Roo Code” → Install.
Configuration
Section titled “Configuration”- Open Roo Code in the VS Code sidebar, then open the settings — the gear icon.
- In the API Provider field, select OpenAI Compatible.
- Fill in the connection fields:
Base URL: https://api.mixen.ai/v1API Key: your-api-keyModel: anthropic/claude-opus-5- In Model Configuration, you can set the Context Window, Max Output Tokens, and Input/Output prices — Roo Code will then track spend itself; use the model’s card in the catalog as a reference.
Unlike Cline, Roo Code has no XML fallback for tools: the model must support native tool calling (the OpenAI tools API). Mixen supports it on /v1/chat/completions, so any tool-calling model from the catalog works.
Verifying the connection
Section titled “Verifying the connection”Before setting up the provider, you can check the key and balance with a minimal generating request:
curl https://api.mixen.ai/v1/chat/completions \ -H "Authorization: Bearer your-api-key" \ -H "Content-Type: application/json" \ -d '{"model":"z-ai/glm-5.3-flash","messages":[{"role":"user","content":"ping"}],"max_tokens":5}'200 with a response — the key and balance work; 401 invalid api key — the key was copied incompletely or isn’t a Mixen API key; 402 — no funds on the balance.
GET /v1/models does not verify the key — it responds without one; use it only to check that the API is reachable.
Picking a model per task
Section titled “Picking a model per task”Roo Code runs long agent cycles of “read → think → edit”, and the input price matters more than the output price. Prices below are per 1M tokens, input/output; full tables with cache columns — in the catalog.
| Task | Model | Input / output |
|---|---|---|
| Ask and Architect modes: questions, plans, review | GLM 5.3 Flash (z-ai/glm-5.3-flash) |
8.4 / 27.9 ₽ |
| Everyday edits in Code | GLM 5.3 (z-ai/glm-5.3) |
156 / 490.2 ₽ |
| Complex multi-step tasks in Code | GPT-5.6 Sol (openai/gpt-5.6-sol), Claude Sonnet 5 (anthropic/claude-sonnet-5) |
213.9 / 1069.5 ₽ |
Roo Code modes each remember their last-used model — assign a cheap one to Ask/Architect and a strong one to Code once, and from then on switching modes switches the model automatically.
| Mode | What it does | Model |
|---|---|---|
| Ask | code questions, read-only | z-ai/glm-5.3-flash |
| Architect | plans and design, edits markdown only | z-ai/glm-5.3-flash |
| Code | file edits and terminal commands | z-ai/glm-5.3, openai/gpt-5.6-sol |
| Debug | systematic diagnostics of tricky bugs | openai/gpt-5.6-sol |
| Orchestrator | breaks a task into subtasks and delegates to other modes | openai/gpt-5.6-sol |
Saving on sessions
Section titled “Saving on sessions”Every Roo Code step sends the accumulated context in full — system prompt, rules, history, read files. Mixen caches that repeating prefix on its own; nothing to enable.
- Cached input is ~10% of the regular price: for GPT-5.6 Sol, input is 213.9 ₽ per 1M tokens and 21.4 ₽ from cache; for GLM 5.3 Flash — 8.4 and 1.7 ₽.
- The cache lives 5 minutes, and every hit extends that window. In a continuous session the cache doesn’t expire from the first turn to the last.
- A pause over 5 minutes — the first turn after it pays the full input price; that’s expected behavior, not a double charge.
What follows in practice:
- Plan on a cheap model, edit on an expensive one — both warm the same cache, because the context is shared.
- Don’t stretch a task with pauses: the same ten turns in a row cost noticeably less than the same ten turns scattered across the evening.
- Responses stream as real per-symbol deltas; this doesn’t affect the price.
What a typical session costs
Section titled “What a typical session costs”Let’s price a working day in Code on GLM 5.3 (input 156 ₽ per 1M, from cache — 29 ₽): 30 turns, each sending ~50K tokens of context.
| Scenario | Session input |
|---|---|
| Without cache | 1.5M tokens × 156 ₽ ≈ 234 ₽ |
| With cache | first turn in full, then the prefix at 29 ₽ ≈ 68 ₽ |
The cache discount depth differs per model: for GLM 5.3 repeated input costs ~19% of full price, for GPT-5.6 Sol ~10% of an already higher full price. The exact “full/cache” pair for each model — in the catalog. The numbers are indicative: real volumes depend on the project and the number of open files.
The cache share of a response is visible in usage.prompt_tokens_details.cached_tokens. And since you enter the prices in Model Configuration manually, take them from the catalog too — then Roo Code’s built-in spend tracker will show plausible roubles, cache discount included.
Reasoning depth
Section titled “Reasoning depth”The OpenAI Compatible provider in Roo Code’s settings has a Reasoning Effort selector — the chosen value goes into our reasoning_effort parameter. Mixen accepts off, low, medium, high, xhigh, and max — which of these a given model supports is listed in GET /v1/models → capabilities.reasoning_efforts (the can_disable_reasoning flag shows whether it accepts off).
Keep in mind:
- Reasoning is billed as output tokens and eats the response-length limit — long edits need headroom on Max Output Tokens, or generation stops mid-way.
- High depth pays off in Debug and on unfamiliar code; for simple edits
low/mediumis enough.
Tips for agentic work
Section titled “Tips for agentic work”- Modes per turn type. Code — edits and commands; Ask — code questions (read-only, doesn’t touch files); Architect — plans and design (edits markdown files only); Debug — systematic diagnostics; Orchestrator (Boomerang) — breaks a large task into subtasks and delegates them to other modes. Switch via the dropdown next to the input field or slash commands
/code,/ask,/architect,/debug,/orchestrator. - A model per mode. Roo remembers each mode’s last-used model and selects it on switching; the active mode also persists between sessions. The saving scheme: Ask/Architect — GLM 5.3 Flash, Code — GLM 5.3 or GPT-5.6 Sol.
- Rules live in
.roo/rules/. A.roo/rules/directory at the project root (or a single.roorulesfile if the directory doesn’t exist); mode-specific rules —.roo/rules-code/and so on; global —~/.roo/rules/. Files are read recursively and alphabetically;AGENTS.mdat the root is picked up automatically. Project rules override global ones.
A typical project rules layout:
.roo/ rules/ # rules for all modes 01-style.md 02-tests.md rules-code/ # Code mode only hotfixes.md rules-architect/ # Architect only adr-template.md- Tools are native. Roo works only with the OpenAI tools API, and Mixen supports
toolsandtool_choiceon/v1/chat/completions— including multi-turn scenarios withrole: 'tool'. The single limitation: the model itself must support tool calling.
Frugal session checklist
Section titled “Frugal session checklist”- Ask and Architect — on GLM 5.3 Flash, Code and Debug — on GLM 5.3 or GPT-5.6 Sol; modes remember their models.
- Do reconnaissance in Ask — read turns are cheap and warm the shared cache.
- Reasoning Effort —
low/mediumfor routine edits,high+ for Debug and unfamiliar code. - Prices in Model Configuration — from the model’s card in the catalog.
- A new task means a fresh session in the right mode, not a continuation of a bloated history.
Useful documentation
Section titled “Useful documentation”- Using Modes — modes, model pinning, slash commands.
- Custom Instructions —
.roo/rules/and mode rules. - Mixen catalog — model IDs, prices, and cache columns.
Recommended models
Section titled “Recommended models”| Model | ID |
|---|---|
| GPT-5.6 Sol | openai/gpt-5.6-sol |
| Claude Opus 5 | anthropic/claude-opus-5 |
| GLM 5.3 | z-ai/glm-5.3 |
| DeepSeek V4 Pro | deepseek/deepseek-v4-pro |
| Kimi K3 | moonshotai/kimi-k3 |
Full list — in the catalog.
Troubleshooting
Section titled “Troubleshooting”- “Invalid API Key” / 401 — the key must be from Mixen (starts with
mxn-) and copied in full; check that the OpenAI Compatible provider is selected. - “Model Not Found” / 404 — the Model ID is entered manually and must exactly match the catalog, including the provider prefix.
- Errors when calling tools — Roo Code works with native tool calling only; if a model misbehaves on tools, switch to another one from the catalog.
- The mode uses a different model than the one you picked — modes remember their models: you switched to Ask and found last week’s cheap model there — by design. Change the model while in that mode.
- The first turn after a pause costs more than the rest — the cache went stale after 5+ minutes of idle time, so the turn paid the full input. The next turns get cheap again.