Anthropic with DevFlow: setup, scope and limits
An Anthropic key lets DevFlow's OpenCode agents call Claude models on your own account instead of through OpenRouter. Every run whose model ID starts with anthropic/ uses it. Setup is 5 steps in Workspace Settings → Billing → Model access.
- Kind
- Model provider
- Where to set it up
- Workspace Settings → Billing → Model access
- Plan
- All plans
- Agent roles
- Any OpenCode role set to an anthropic/ model
- Verified
- 1 Oct 2026
Setup steps
- Create an API key. In your Anthropic console, create a key dedicated to DevFlow.
- Open the Billing tab. As an owner, open the Billing tab and find "Model access"; click "Manage keys" if the provider cards are folded away.
- Add the key under Add provider. First-party cards stay hidden until a key exists, so use "Add provider" at the bottom: type
ANTHROPIC_API_KEYas the name, paste the secret into "API key" and click "Add". - Test the key. On the card that now appears, click "Test". DevFlow lists models at
https://api.anthropic.com/v1/models, sending the key in thex-api-keyheader, and reports the answer. A key typed into the field but not yet saved is tested in place of the stored one, so a replacement can be checked before it goes live. - Choose Claude models. In the Execution tab, set "OpenCode Model", a tier or a single role to an ID such as
anthropic/claude-sonnet-4-6.
What it does
DevFlow has two agent backends. OpenCode, the default, reads the stored key; the Claude Code CLI backend stays off unless the operator sets CLAUDE_BACKEND_ENABLED, and even then it signs in with the server's own CLI session rather than a per-workspace key.
While that second backend is off, a run configured for it is moved to OpenCode with the workspace default, so a leftover setting can never start a run with nothing to call. The settings page also hides the Claude Code option.
IDs take the form provider/model, for example anthropic/claude-sonnet-4-6. One ID can be the default OpenCode Model, back a whole tier, or be pinned to a single role or to one task.
Planning and verification always request the highest reasoning effort. Rate-limit, overload and unavailable answers (429, 529 and 503) are retried with exponential backoff up to 4 attempts in all, while any other failure ends the run.
Anthropic is one of two providers, with OpenAI, that the optional context-compression proxy can front. Requests then pass through a proxy such as Headroom before reaching Anthropic; lossy compression rewrites the start of each request, which can turn prompt-cache hits into misses, so compare total spend per task before keeping it.
When an operator enables it, the Claude Code backend uses the Landlock sandbox path and is never containerized, while OpenCode runs can use a per-invocation container instead.
A single run may last up to 90 minutes and is stopped after 45 minutes without output, whatever the provider. Only the operator can change either limit, through AGENT_TIMEOUT_MINUTES and AGENT_IDLE_TIMEOUT_MINUTES.
Requirements
- The owner role in the DevFlow workspace; members do not see the Billing tab.
- The env name typed exactly as shown: names must be upper case letters, digits and underscores, and only that name feeds the matching models.
- An account with API access to the Claude models you select.
Limits
- The server operator can also supply a key of that name through the server environment; a stored key always wins.
- With the model relay on, which container mode enforces, the secret stays inside DevFlow: each run holds a short-lived token, and the relay adds the stored key on the way to Anthropic.
- The monthly spend cap is checked before each task launch, whatever the provider, so a task over the cap fails with a reason before any run starts, and the model relay answers further calls with HTTP 402.
FAQ
Can a DevFlow workspace use an Anthropic key and an OpenRouter key together?
Yes. The prefix of each model ID decides which stored key a DevFlow run uses, so different roles can run on different providers inside one task.
Does storing an Anthropic key make DevFlow switch to Claude models?
No. Storing the key only makes Claude IDs usable; the workspace default, the tiers and any per-role or per-task override still decide what each DevFlow run calls.
Sources
Every fact above comes from these files in the DevFlow repository.
internal/relay/providers.gointernal/agent/opencode_backend.gointernal/agent/backend.gointernal/agent/transient_error.gointernal/api/opencode_key_tester.gointernal/api/handlers_opencode_keys.gointernal/api/server.goweb/src/lib/components/ApiKeysManager.svelteweb/src/lib/components/billing/ModelAccess.svelteweb/src/lib/components/WorkspaceSettings.svelteCLAUDE.md