Models and BYOK
Set default models and effort per runtime, add your own provider keys, and choose what happens when a provider or subscription runs out.
On this page
Every agent runs one model through its runtime. Settings → Models sets the defaults for each runtime, the providers that serve them, and whether model calls bill to Duun credits or to your own keys (BYOK, bring your own keys).
Models per runtime
Each CLI runtime supports its own set of models:
| Runtime | Models |
|---|---|
| Claude Code | opus-5.5, sonnet-5.5, haiku-5.5 |
| Codex CLI | gpt-6-codex, gpt-6, gpt-6-mini |
| Gemini CLI | gemini-3-pro, gemini-3-flash |
| OpenCode | sonnet-5.5, opus-5.5, gpt-6, gemini-3-pro |
Under Defaults per runtime, pick the model and reasoning effort a runtime uses when an agent doesn’t choose one. Agents can override the default, and a workflow step can override the agent for that step.
Reasoning effort
| Effort | When to use it |
|---|---|
| Default | The runtime’s own default |
| Low | Fastest and cheapest: formatting, small edits, lookups |
| Medium | Most implementation work |
| High | Best for plans and reviews |
| Max | Slow; hard problems only |
Higher effort uses more tokens, which shows up in the run’s cost meter. A good pattern is High for a Plan step, Medium for Implement and Low for a Notify or Transform step.
Model providers
By default every model call goes through Duun and uses Duun credits. To use your own provider accounts, select Add model provider and pick one:
| Provider | Stored as | Extra field |
|---|---|---|
| Anthropic | ANTHROPIC_API_KEY | |
| OpenAI | OPENAI_API_KEY | |
| Google Gemini | GEMINI_API_KEY | |
| AWS Bedrock | AWS_BEDROCK_ACCESS_KEY | Region |
| Azure OpenAI | AZURE_OPENAI_API_KEY | Base URL |
| OpenRouter | OPENROUTER_API_KEY | |
| OpenAI-compatible | CUSTOM_LLM_API_KEY | Base URL (an https:// endpoint) |
“The key is stored as a workspace secret and used for every runtime that supports this provider.” You can see and rotate it in Settings → API keys & secrets under the name in the table. Select Test connection on a provider row to check the key; a healthy provider shows its latency.
Each provider row shows where its calls bill: “Billed to: Duun credits” or “Billed to your key”, with month-to-date spend (an estimate when billed to your key).
Remove a provider
Choose Remove provider… from the row’s menu. Runtimes that use it switch to Duun credits. The secret stays in API keys & secrets until you delete it there.
Bring your own keys
The Bring your own keys switch decides where model calls bill:
- On: model calls through a provider above bill to your account. Duun records an estimate and charges no credits. Sandboxes still use credits.
- Off: every model call uses Duun credits, even if provider keys are stored.
BYOK costs appear in usage as “billed by provider”, greyed out, so you can still see the total cost of a run without being charged twice. See Usage and budgets for the billed_to field.
When a subscription runs out
Claude Code, Codex and Gemini CLI plans have their own limits. If a runtime is signed in with a personal or team subscription, choose what happens when that subscription runs out:
- Use Duun credits: runs continue on Duun credits.
- Pause: runs pause when a subscription runs out, and wait with an ask in Inbox.
Fallback model
The Fallback model is used when the primary provider is rate-limited. Pick one from a different provider than your main models if you can, so an outage at one provider doesn’t stall every run. The run transcript notes when a step switched to the fallback.
Choosing models for a workflow
| Step | Suggested model | Why |
|---|---|---|
| Plan, Decide | opus-5.5 or gpt-6 at High effort | Plans are cheap compared with redoing work |
| Implement | Agent default at Medium | Most of the tokens; keep it predictable |
| Transform, Notify | haiku-5.5, gpt-6-mini or gemini-3-flash | Short, structured output |
| Review | sonnet-5.5 at High | Reads a lot, writes little |
Change one thing at a time and compare runs in the factory’s Report tab before and after.
Related
- Runtimes
- Agents
- Security and data handling
- Credits and auto-recharge in the help center