Reference

Model providers

Agent Zero supports native OpenAI, Anthropic, and Google Generative AI adapters, Vercel AI Gateway, and arbitrary OpenAI-compatible endpoints — all behind one ModelProvider contract in packages/models, sharing one structured-output, usage-accounting, timeout, and error-redaction path.

Agent Zero supports native OpenAI, Anthropic, and Google Generative AI adapters, Vercel AI Gateway, and arbitrary OpenAI-compatible endpoints — all behind one ModelProvider contract in packages/models, sharing one structured-output, usage-accounting, timeout, and error-redaction path.

Select a provider

The transport is selected in repository policy; the credential comes only from the environment:

model:
  provider: anthropic
  name: claude-sonnet-4-5
model.providerCredential environment variableModel example
ai-gatewayAI_GATEWAY_API_KEY or Vercel OIDCanthropic/claude-sonnet-4.5
anthropicANTHROPIC_API_KEYclaude-sonnet-4-5
googleGOOGLE_GENERATIVE_AI_API_KEYgemini-2.5-pro
openaiOPENAI_API_KEYgpt-5
openai-compatibleOPENAI_COMPATIBLE_API_KEY (or legacy OPENAI_API_KEY)provider-specific

The AI Gateway accepts provider/model identifiers and exposes the broader AI SDK provider catalog without adding provider-specific logic to the Agent Zero runtime.

Custom endpoints

AGENT_ZERO_MODEL_BASE_URL is an optional operator environment variable for custom gateways and self-hosted endpoints. Endpoint URLs and credentials cannot be named or embedded in .agent-zero.yml, so untrusted repository policy cannot redirect a provider secret.

Cost accounting

To record cost, configure explicit rates — Agent Zero never guesses provider pricing:

model:
  provider: openai-compatible
  name: gpt-5
  inputCostPerMillionTokens: 1.25
  outputCostPerMillionTokens: 10

Usage (tokens and, when configured, cost) is accounted per run and carried in the task result.

Guarantees

  • Credentials are read only from the provider's documented environment variable and are never persisted with task evidence.
  • The agent runtime sees neither SDK objects nor credentials — packages/models keeps AI SDK types behind the adapter boundary.
  • Errors are redacted before they surface, so a provider exception cannot leak a credential into logs or evidence.
Copyright © 2026