Claude Code
Use Claude Code with AutoDo
AutoDo adaptation
limitedClaude Code workflows that require an Anthropic-native gateway are reference-only unless AutoDo adds an Anthropic-compatible endpoint. Prefer tools that can use an OpenAI-compatible base URL.
Warning: Claude Code with AutoDo is only guaranteed to work with the Anthropic first-party provider. For maximum compatibility, we recommend setting Anthropic 1P as top priority provider when using Claude Code.
Why Use AutoDo with Claude Code?
AutoDo adds a reliability and management layer between Claude Code and Anthropic's API, giving you and your organization several key benefits.
Provider Failover for High Availability
Anthropic's API occasionally experiences outages or rate limiting. When you route Claude Code through AutoDo, your requests automatically fail over between multiple Anthropic providers. If one provider is unavailable or rate-limited, AutoDo seamlessly routes to another, keeping your coding sessions uninterrupted.
Organizational Budget Controls
For teams and organizations, AutoDo provides centralized budget management. You can set spending limits, allocate credits across team members, and prevent unexpected cost overruns. This is especially valuable when multiple developers are using Claude Code across your organization.
Usage Visibility and Analytics
AutoDo gives you complete visibility into how Claude Code is being used across your team. Track usage patterns, monitor costs in real-time, and understand which projects or team members are consuming the most resources. All of this data is available in your AutoDo Activity Dashboard.
Quick Start
This guide will get you running Claude Code powered by AutoDo in just a few minutes.
Step 1: Install Claude Code
Native Install (Recommended)
**macOS, Linux, WSL:**
```bash
curl -fsSL https://claude.ai/install.sh | bash
```
**Windows PowerShell:**
```powershell
irm https://claude.ai/install.ps1 | iex
```
npm
Requires [Node.js 18 or newer](https://nodejs.org/en/download/).
```bash
npm install -g @anthropic-ai/claude-code
```
Step 2: Connect Claude to AutoDo
Instead of logging in with Anthropic directly, connect Claude Code to AutoDo. This requires setting a few environment variables.
Requirements:
- Use
https://autodo.work/v1for the base url - Provide your AutoDo API key as the auth token
- Important: Explicitly blank out the Anthropic API key to prevent conflicts
Shell Profile
Add these environment variables to your shell profile:
```bash
# Open your shell profile in nano
nano ~/.zshrc # or ~/.bashrc for Bash users
# Add these lines to the file:
export AUTODO_API_KEY="<your-autodo-api-key>"
export ANTHROPIC_BASE_URL="https://autodo.work/v1"
export ANTHROPIC_AUTH_TOKEN="$AUTODO_API_KEY"
export ANTHROPIC_API_KEY="" # Important: Must be explicitly empty
# After saving, restart your terminal for changes to take effect
```
Note: Persistence: We recommend adding these lines to your shell profile (
~/.bashrc,~/.zshrc, or~/.config/fish/config.fish).
Project Settings File
Alternatively, you can configure Claude Code using a project-level settings file at `.claude/settings.local.json` in your project root:
```json
{
"env": {
"ANTHROPIC_BASE_URL": "https://autodo.work/v1",
"ANTHROPIC_AUTH_TOKEN": "<your-autodo-api-key>",
"ANTHROPIC_API_KEY": ""
}
}
```
Replace `<your-autodo-api-key>` with your actual AutoDo API key.
Note: Note: This method keeps your configuration scoped to the project, making it easy to share AutoDo settings with your team via version control (just be careful not to commit your API key).
Warning: Variable Location: Do not put these in a project-level
.envfile. The native Claude Code installer does not read standard.envfiles.
Step 3: Clear any cached Anthropic login
If you were previously logged in to Claude Code with an Anthropic account, you must run /logout once to remove the cached session. Claude Code warns about auth conflicts when both a cached login and ANTHROPIC_AUTH_TOKEN are present, and the conflict can cause unexpected behaviour on startup — typically surfacing as confusing model-not-found errors (e.g. for autodo/auto, autodo/pareto-code, or any other AutoDo-only model).
> /logout
Then quit and re-launch claude so it picks up the new environment variables.
Note: If you have never logged in to Claude Code with Anthropic, you can skip this step.
Step 4: Start your session
Navigate to your project directory and start Claude Code:
cd /path/to/your/project
claude
If your client accepts this gateway configuration, prompts will be routed through AutoDo. Verify with a small request first.
Step 5: Verify
You can confirm your connection by running the /status command inside Claude Code.
> /status
Auth token: ANTHROPIC_AUTH_TOKEN
Anthropic base URL: https://autodo.work/v1
You can also check the AutoDo Activity Dashboard to see your requests appearing in real-time.
How It Works
This workflow assumes an Anthropic-compatible gateway. AutoDo currently documents the OpenAI-compatible /v1 API, so validate this workflow before publishing it as fully supported.
- Direct Connection: When you set
ANTHROPIC_BASE_URLtohttps://autodo.work/v1, Claude Code speaks its native protocol directly to AutoDo. No local proxy server is required. - Anthropic Skin: An Anthropic-compatible AutoDo route would need to preserve model mapping, thinking blocks, and native tool use before this workflow can be considered fully supported.
- Billing: You are billed using your AutoDo credits. Usage (including reasoning tokens) appears in your AutoDo dashboard.
Configuring Models
Claude Code uses several environment variables to determine which models to use for different tasks. You can override these to route each role through a specific model:
export ANTHROPIC_DEFAULT_OPUS_MODEL="~anthropic/claude-opus-latest"
export ANTHROPIC_DEFAULT_SONNET_MODEL="~anthropic/claude-sonnet-latest"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="~anthropic/claude-haiku-latest"
export CLAUDE_CODE_SUBAGENT_MODEL="~anthropic/claude-opus-latest"
| Variable | Description |
|---|---|
ANTHROPIC_DEFAULT_OPUS_MODEL | The model used for Opus-class tasks (e.g. complex reasoning) |
ANTHROPIC_DEFAULT_SONNET_MODEL | The model used for Sonnet-class tasks (e.g. general coding) |
ANTHROPIC_DEFAULT_HAIKU_MODEL | The model used for Haiku-class tasks (e.g. quick completions) |
CLAUDE_CODE_SUBAGENT_MODEL | The model used for sub-agent tasks spawned by Claude Code |
Add these to the same shell profile or project settings file where you set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.
Claude Code is optimized for Anthropic models and may not work correctly with other providers.
Fast Mode
Anthropic's fast mode provides up to 2.5x faster output at premium pricing. Fast mode is only available on Claude Opus 4.6, Claude Opus 4.7, and Claude Opus 4.8 — no other Anthropic models support it.
For each supported Opus version, there are two equivalent ways to request fast mode on AutoDo:
- Send
speed: "fast"withanthropic/claude-opus-4.8,anthropic/claude-opus-4.7, oranthropic/claude-opus-4.6— AutoDo reroutes the request to the matching*-fastmodel (for example,anthropic/claude-opus-4.6→anthropic/claude-opus-4.6-fast). - Call the
*-fastmodel directly —anthropic/claude-opus-4.8-fast,anthropic/claude-opus-4.7-fast, oranthropic/claude-opus-4.6-fast.
Both options route through the Anthropic first-party provider, and the required beta header is injected automatically.
Using /fast in Claude Code
Claude Code has a built-in /fast command that toggles fast mode. When enabled, Claude Code sends speed: "fast" in its requests alongside the configured Opus model. AutoDo fully supports this parameter — you just need to set the following environment variable:
export CLAUDE_CODE_SKIP_FAST_MODE_ORG_CHECK=1
Note: Requires Claude Code v2.1.96 or newer.
Pricing
Fast mode is priced at a premium over the underlying Claude Opus model's standard token rates. See Anthropic's fast mode pricing for current rates. When fast mode is active, the response's usage object includes "speed": "fast" to confirm the request was processed at the higher speed tier.
Note: If
speed: "fast"is sent for a model that does not support fast mode, AutoDo silently drops the parameter and the request proceeds at standard speed with standard pricing.
Routing behavior
Fast mode is only served by the Anthropic first-party provider, since other providers (e.g. Amazon Bedrock, Google Vertex) do not support it.
Agent SDK
The Anthropic Agent SDK lets you build AI agents programmatically using Python or TypeScript. Since the Agent SDK uses Claude Code as its runtime, you can connect it to AutoDo using the same environment variables described above.
For complete setup instructions and code examples, see our Anthropic Agent SDK integration guide.
GitHub Action
You can use AutoDo with the official Claude Code GitHub Action.To adapt the example workflow for AutoDo, make two changes to the action step:
- Pass your AutoDo API key via
anthropic_api_key(store it as a GitHub secret namedAUTODO_API_KEY) - Set the
ANTHROPIC_BASE_URLenvironment variable tohttps://autodo.work/v1
- name: Run Claude Code
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.AUTODO_API_KEY }}
env:
ANTHROPIC_BASE_URL: https://autodo.work/v1
Cost Tracking Statusline
You can add a custom statusline to Claude Code that tracks your AutoDo API costs in real-time. The statusline displays the provider, model, cumulative cost, and cache discounts for your session.
Download the statusline scripts from the autodo-examples repository, make them executable, and add the following to your ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "/path/to/statusline.sh"
}
}
The script uses your ANTHROPIC_AUTH_TOKEN environment variable, which should already be set to your AutoDo API key if you followed the setup above.
Troubleshooting
- Model-not-found errors for AutoDo models (e.g.
autodo/auto,autodo/pareto-code): Usually caused by a credential conflict that surfaces as auth-conflict warnings on startup. There are two distinct scenarios. (1) If you have a cached Anthropic OAuth login from before switching to AutoDo, run/logoutinside Claude Code, then quit and re-launchclaudeto clear the cached session. (2) If your shell profile still has a realANTHROPIC_API_KEYset (e.g. an old Anthropic console key),/logoutwill not help — it only clears the cached OAuth session, not shell environment variables. Instead, ensureANTHROPIC_API_KEY=""is set in your shell profile per Step 2, then restart your terminal. Verify with/statusthat the auth token isANTHROPIC_AUTH_TOKENand the base URL ishttps://autodo.work/v1. - Auth Errors: Ensure
ANTHROPIC_API_KEYis set to an empty string (""). If it is unset (null), Claude Code might fall back to its default behavior and try to authenticate with Anthropic servers. If you still see auth errors after setting it, run/logout(see above). - Context Length Errors: If you hit context limits, consider breaking your task into smaller chunks or starting a new session.
- Privacy: AutoDo does not log your source code prompts unless you explicitly opt-in to prompt logging in your account settings. See our Privacy Policy for details.