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:

RuntimeModels
Claude Codeopus-5.5, sonnet-5.5, haiku-5.5
Codex CLIgpt-6-codex, gpt-6, gpt-6-mini
Gemini CLIgemini-3-pro, gemini-3-flash
OpenCodesonnet-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

EffortWhen to use it
DefaultThe runtime’s own default
LowFastest and cheapest: formatting, small edits, lookups
MediumMost implementation work
HighBest for plans and reviews
MaxSlow; 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:

ProviderStored asExtra field
AnthropicANTHROPIC_API_KEY
OpenAIOPENAI_API_KEY
Google GeminiGEMINI_API_KEY
AWS BedrockAWS_BEDROCK_ACCESS_KEYRegion
Azure OpenAIAZURE_OPENAI_API_KEYBase URL
OpenRouterOPENROUTER_API_KEY
OpenAI-compatibleCUSTOM_LLM_API_KEYBase 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

StepSuggested modelWhy
Plan, Decideopus-5.5 or gpt-6 at High effortPlans are cheap compared with redoing work
ImplementAgent default at MediumMost of the tokens; keep it predictable
Transform, Notifyhaiku-5.5, gpt-6-mini or gemini-3-flashShort, structured output
Reviewsonnet-5.5 at HighReads a lot, writes little

Change one thing at a time and compare runs in the factory’s Report tab before and after.

    Type to search the docs, help center and blog.