Before you begin
Use the v0.13 CLI and authenticate. Run workspace-management and recipe commands from your local terminal. Commands identified as running inside a workspace require its console terminal or SSH session. Replace example resource IDs with the values returned for your account. Start the target workspace first and verify its identity withrig workspace ls. AI calls require managed credits or an appropriately configured provider account.
How It Works
Managed workspaces exposeOPENROUTER_BASE_URL and OPENROUTER_API_KEY to every login shell. The bridge-local proxy at 172.16.0.1:9090 fronts OpenRouter, which in turn routes to the appropriate upstream provider for whatever model you ask for. Your credits cover the usage; provider API keys stay outside the VM.
The built-in coding agents — claude, codex, opencode, kilocode, junie, and pi — each come with a small /etc/profile.d/ script that hands those settings to the agent in the form it expects: Anthropic variables for Claude Code, OpenAI variables for Codex, the Kilo and Junie provider variables for Kilo Code and Junie, while OpenCode and Pi read the OpenRouter variables directly. Install the agent and start it; there is nothing else to configure. Claude Code’s script steps aside when you use your own Claude login or key.
Supported Tools
Quick Setup
Recommended: install via the catalog
Add an agent to a workspace that already exists by its catalog ID:rig app logs --app <APP_NAME> --install. The full ref @rigbox/claude@builtin works too. Inside the workspace itself, pass the workspace’s own name to --workspace.
To create a workspace with agents already installed, name them when you create it:
$PATH and its routing script in /etc/profile.d/. There is no service to start: SSH into the workspace and run the agent. See Catalog Apps → CLI-shape recipes for the routing details and equivalent API call.
Manual install (for tools without a catalog recipe)
For Gemini CLI and Aider, install the package yourself:OPENROUTER_BASE_URL and OPENROUTER_API_KEY at login, so most OpenRouter-aware tools just work. For OpenAI-compatible tools that read OPENAI_BASE_URL and OPENAI_API_KEY instead, run eval "$(rig proxy on)" to set them for your current shell. Anthropic clients take the proxy root, http://172.16.0.1:9090, as their base URL; see base URLs.
Start coding
Tool-Specific Setup
Claude Code
rig recipe app install --ref claude installs Claude Code and a routing script, /etc/profile.d/claude-routing.sh. In a new login shell, the script points Claude Code at the workspace’s OpenRouter settings: ANTHROPIC_BASE_URL becomes the proxy root, http://172.16.0.1:9090 in managed mode (Claude Code adds /v1/messages itself), and ANTHROPIC_AUTH_TOKEN the workspace’s key, which in managed mode is a placeholder the proxy replaces. After SSH-ing in, just run:
- signing in from Claude Code (
/login), which saves~/.claude/.credentials.json(or the same file underCLAUDE_CONFIG_DIR); - an API key or
apiKeyHelpersaved in Claude Code’s configuration; ANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKEN,CLAUDE_CODE_OAUTH_TOKEN, orANTHROPIC_BASE_URLalready set in the environment, for example withrig workspace env set.
hasCompletedOnboarding to ~/.claude.json only when that key is missing, so an existing login and project history stay as they are, and it doesn’t write ~/.claude/settings.json, so permission prompts stay at Claude Code’s defaults.
Claude Code can edit files, run shell commands, manage git, and run tests inside the workspace. The VM provides an isolation boundary, but the agent can access files and credentials available inside that workspace and can act on external services those credentials authorize. See security boundaries.
Claude Code uses Claude Sonnet by default. To use Opus, pass
--model claude-opus-4-20250514. Credit consumption is higher for Opus.Codex CLI
rig recipe app install --ref codex configures the agent to send OpenAI-shape requests to OpenRouter, picking up OPENAI_BASE_URL / OPENAI_API_KEY from the routing shim:
OpenCode
OpenCode readsOPENROUTER_API_KEY natively, so the catalog install only needs to drop the binary in place:
Kilo Code
rig recipe app install --ref kilocode writes a shim that maps OPENROUTER_* to the KILO_* environment variables the agent expects:
Junie
rig recipe app install --ref junie installs JetBrains’ Junie CLI and a shim that copies OPENROUTER_API_KEY to JUNIE_OPENROUTER_API_KEY, which Junie reads first. Its install downloads a larger bundle, so it takes longer than the others.
Pi
rig recipe app install --ref pi installs Pi, which reads OPENROUTER_API_KEY directly:
Gemini CLI
Gemini CLI doesn’t have a catalog recipe yet — install withnpm install -g @google/gemini-cli. Configure the authentication and provider endpoint supported by your installed Gemini CLI. Native Google requests are not automatically translated by the OpenAI-compatible gateway. With your own Google credentials configured, start the agent:
Aider
Aider supports multiple providers. The following examples use provider-native model identifiers and require that provider’s credentials and endpoint configuration. Choose a model available to your provider account; do not assume a native Google request is translated by the managed OpenAI-compatible gateway:Automate with Setup Scripts
To give new workspaces a coding agent from the start, name it with--catalog when you create them, as in Quick Setup. For tools without a catalog recipe, attach a setup script that installs the package:
Monitor Credit Usage
AI coding tools can consume credits quickly — especially agentic tools that make many API calls in a loop. Monitor your balance:BYOK Alternative
If you burn through managed credits quickly, switch to BYOK mode and use your own API keys for unlimited usage. Flip the workspace mode, then set your provider key as a workspace environment variable:ANTHROPIC_API_KEY set, Claude Code’s routing script leaves Claude Code on your own key.
Why Rigbox for AI Coding
Verify and troubleshoot
Inside the workspace, inspectrig proxy status, then make one small request with your chosen tool. Verify the configured endpoint and check the corresponding Rigbox or provider usage. After changing keys or mode, start a fresh shell and restart processes that retained their old configuration. Never print a provider key to verify it.
If Claude Code uses the workspace route when you expected your own login, or the other way round, check the list above and open a new login shell. In a shell where the script routed Claude Code, echo $RIGBOX_CLAUDE_ROUTED prints 1.
For failures, start with runtime logs, health checks, or resource exhaustion.
Next Steps
- Managed AI Proxy - how the OpenRouter-backed proxy and credit system work in detail
- App Catalog → CLI-shape recipes - what each built-in agent installs and how the routing shims translate env vars
- Rigbox CLI - manage workspaces, apps, and recipes from the terminal
- Bring Your Own Keys - use your own API keys for unlimited usage
- Setup Scripts - automate tool installation across workspaces
- Images & Templates - choose the right base image for coding