Home / Learn / Unlimited Roo Code with the Claude API
Unlimited Roo Code with the Claude API — Roo Code Extension Guide

Unlimited Roo Code with the Claude API

Roo Code is a powerful agentic coding extension for VS Code that separates concerns into distinct operational modes — Architect, Code, Debug, and Ask — each configurable with its own model, temperature, and provider settings. Its Orchestrator feature spawns subtasks that multiply API consumption dramatically. Connecting Roo Code to a flat-rate unlimited Claude gateway means you can assign Opus to your Architect mode, Sonnet to your Code mode, and never worry about the compounding cost of orchestrated workflows.

How Roo Code Multiplies API Consumption

Roo Code's architecture is fundamentally different from simple chat-based AI editors. Each operational mode (Architect, Code, Debug, Ask) maintains its own context and can be assigned a different model. When Orchestrator mode is active, it decomposes a complex task into subtasks and delegates each to the appropriate mode — effectively spawning parallel conversations that each consume their own token budget independently.

A single Orchestrator-driven task like 'refactor the authentication module' might spawn an Architect subtask to plan the new structure, three Code subtasks to implement different components, and a Debug subtask to verify the result. Each subtask carries its own system prompt, tool definitions, and conversation history. The total token consumption is not additive — it is multiplicative because each subtask starts fresh with full context injection.

This is compounded by Roo Code's use of native tool calling exclusively. Unlike some agents that fall back to XML-based tool invocation when native calls fail, Roo Code requires native function-calling support from the API. Each tool invocation (file read, write, terminal command) is a structured tool call and response pair, adding overhead to every interaction. The combination of per-mode models, Orchestrator subtasks, and native tool calls makes Roo Code one of the heaviest API consumers in the VS Code ecosystem.

Setting Up API Configuration Profiles

Roo Code organizes provider settings into API Configuration Profiles. Each profile bundles a provider type, base URL, API key, model identifier, and optional parameters like temperature and thinking budget. Open the Roo Code settings panel in VS Code and navigate to API Configuration. Click Create New Profile to start.

For the Anthropic provider path, set Provider to Anthropic, enter https://unlimited.aiprimetech.io as the Base URL (root host, no /v1 — the Anthropic SDK appends the path), and paste your AI Prime Tech Unlimited key. Select your model — claude-sonnet-4-5 for a balanced profile or claude-opus-4-6 for maximum reasoning power. Set temperature between 0 and 1 based on your preference for determinism versus creativity.

Create multiple profiles for different scenarios: a fast profile using Haiku for quick questions, a standard profile using Sonnet for daily coding, and a power profile using Opus for architectural decisions. Name them clearly (e.g., 'Unlimited-Sonnet', 'Unlimited-Opus') because you will assign these profiles to specific modes in the next step.

Per-Mode Model Assignment Strategy

Roo Code's killer feature for unlimited users is per-mode model assignment. In settings, each mode (Architect, Code, Debug, Ask) has a dropdown to select which API Configuration Profile it uses. The optimal strategy on unlimited is aggressive: assign Opus to Architect and Debug modes where deep reasoning matters most, and Sonnet to Code and Ask modes where speed and volume dominate.

Architect mode plans complex changes before execution. It benefits enormously from Opus's superior ability to reason about system-wide implications, dependency chains, and architectural patterns. Debug mode similarly benefits from Opus because diagnosing bugs often requires holding multiple hypotheses in mind simultaneously and reasoning through execution paths.

Code mode handles the actual file edits and is called most frequently. Sonnet is fast enough to keep the feedback loop tight while still producing high-quality code. Ask mode is for quick questions and explanations — Sonnet handles these efficiently. On unlimited, there is no cost penalty for using Opus everywhere, but the latency difference matters for interactive workflows. This split gives you the best of both worlds: deep reasoning where it counts, fast responses where speed matters.

Orchestrator and Boomerang Subtasks

The Orchestrator mode (sometimes called Boomerang) is Roo Code's task decomposition engine. When you describe a complex task in Orchestrator mode, it breaks the work into discrete subtasks and delegates each to the appropriate mode. The subtask results 'boomerang' back to the Orchestrator, which synthesizes them and decides the next step.

Each subtask runs in its own conversation context with its own token budget. This means a single Orchestrator task might spawn five separate Claude conversations, each consuming tens of thousands of tokens independently. On per-token billing, an Orchestrator session for a medium-complexity feature can easily cost several dollars. On unlimited, it costs exactly the same as a single chat message — nothing extra.

To use Orchestrator effectively with unlimited access, do not constrain it. Let it spawn as many subtasks as the problem requires. Enable automatic mode — where the Orchestrator decides the decomposition without asking for confirmation at each step. This produces better results because the Orchestrator can iterate freely, re-planning and re-executing subtasks as it discovers new information during the process.

Custom Modes with .roomodes

Roo Code supports project-level custom modes defined in a .roomodes file at the project root. Each custom mode specifies a name, description, system prompt additions, allowed tools, and which API Configuration Profile to use. This lets you create specialized agents for your specific project — a 'Database Migration' mode that only has access to SQL files and migration tools, or a 'Documentation' mode focused on markdown with a writing-optimized prompt.

Create a .roomodes JSON file in your project root. Each mode entry includes roleDefinition (the system prompt), allowedTools (array of tool names the mode can use), and apiConfiguration (which profile to use). Custom modes appear alongside the built-in modes in the mode selector.

On unlimited, custom modes unlock creative workflow patterns. Create a 'Research' mode that uses Opus for deep analysis of unfamiliar codebases. Create a 'Quick Fix' mode that uses Haiku for trivial one-line changes. Create a 'Review' mode that reads code and produces feedback without making edits. The flat-rate model means you can experiment freely with mode configurations without worrying about the cost of getting it wrong.

Native Tool Calling Requirements

Roo Code uses native function calling exclusively — it does not fall back to XML-based tool invocation like some other agents. This means the API provider must support the tools parameter in the Messages API correctly, including multi-turn tool_use and tool_result blocks. The AI Prime Tech Unlimited gateway supports this fully for all Claude models.

If you encounter tool-calling errors, they are almost always caused by one of two issues: using an older model version that has weaker tool-calling support, or a base URL misconfiguration that routes requests to the wrong endpoint. Verify your profile's model identifier matches a current Claude model and that the base URL is correct for your chosen provider type.

Roo Code's tool repertoire includes file operations (read, write, list), terminal commands (execute, read output), browser actions (when enabled), and MCP tools (when configured). Each tool call adds structured data to the conversation — typically 200-500 tokens per tool invocation including the result. Over a complex task with dozens of tool calls, this accumulates significantly.

Troubleshooting Roo Code Configuration

The most common issue is mode-profile mismatch: you created profiles but forgot to assign them to modes. Check each mode's API Configuration dropdown in settings — if it says 'Default' and you have not set a default profile, requests will fail. Assign a profile explicitly to each mode you plan to use.

If Orchestrator subtasks fail while direct mode usage works, the issue is usually that subtask modes inherit the Orchestrator's profile unless explicitly configured otherwise. Make sure each mode that might be called by Orchestrator has its own valid profile assignment. A common pattern is to set the default profile to your Sonnet configuration and only override Architect and Debug with Opus.

Connection timeout errors during long Orchestrator sessions usually indicate that too many subtasks are running concurrently and hitting rate limits. The gateway queues excess requests and returns them as they become available, but VS Code may interpret the delay as a timeout. Reduce Orchestrator concurrency in settings if you hit this consistently, or simply wait — the gateway will process all requests eventually within fair-use limits.

# Roo Code -> Settings -> API Configuration -> Create New Profile
#
# Profile: Unlimited-Sonnet
#   Provider:  Anthropic
#   Base URL:  https://aiprimetech.io
#   API Key:   <your AI Prime Tech Unlimited key>
#   Model:     claude-sonnet-4-5
#
# Profile: Unlimited-Opus
#   Provider:  Anthropic
#   Base URL:  https://aiprimetech.io
#   API Key:   <your AI Prime Tech Unlimited key>
#   Model:     claude-opus-4-6
#
# Mode Assignment:
#   Architect -> Unlimited-Opus
#   Code      -> Unlimited-Sonnet
#   Debug     -> Unlimited-Opus
#   Ask       -> Unlimited-Sonnet

Frequently asked questions

What is the advantage of per-mode model assignment on unlimited?
You can assign expensive models like Opus to reasoning-heavy modes (Architect, Debug) without cost concern, while keeping faster models on high-frequency modes (Code, Ask) for better latency. On per-token billing this strategy is costly; on unlimited it is free to optimize for quality.

How does Orchestrator mode affect API usage?
Orchestrator decomposes tasks into subtasks, each running in its own conversation with its own token budget. A single complex task might spawn 5-10 separate Claude conversations. On per-token billing this multiplies cost dramatically; on unlimited it is covered by the flat rate.

Does Roo Code work with the OpenAI-compatible endpoint?
Yes. Create a profile with Provider set to OpenAI Compatible, Base URL set to https://unlimited.aiprimetech.io/v1, and enter the model ID manually. However, the Anthropic provider path is recommended for best tool-calling compatibility.

What are .roomodes and should I use them?
A .roomodes file at your project root defines custom modes with specific tools, prompts, and model assignments. On unlimited, use them freely to create specialized agents for different workflows — research, review, migration, documentation — without worrying about the extra token cost of rich system prompts.

Why do I get tool-calling errors with Roo Code?
Roo Code requires native function calling with no XML fallback. Ensure your model identifier is a current Claude model (claude-sonnet-4-5 or newer) and that your base URL is correctly configured for the provider type you selected. Older model versions may have weaker tool-calling support.

Start using Claude in minutes

Get an API key — no Anthropic account or waitlist required.

Get your API key

AI Prime Tech is an independent API gateway. It is not affiliated with, endorsed by, or a reseller of Anthropic. Claude and related model names are trademarks of their respective owners.