Provider Trait
All providers implementLlmProvider:
AnthropicProvider
Auth Refresh
GeminiProvider
OpenAIProvider
Uses the OpenAI Responses API.Environment Variables
| Variable | Required | Default |
|---|---|---|
OPENAI_API_KEY | Yes | — |
OPENAI_MODEL | Yes | — |
OPENAI_BASE_URL | No | https://api.openai.com/v1/responses |
OPENAI_MAX_TOKENS | No | 32000 |
Custom Base URL
The base URL is configurable, which makes it easy to point the provider at a local proxy, Azure OpenAI, or any OpenAI-compatible endpoint:Dynamic Auth (Proxy / JWT)
Notes
- Thinking / reasoning:
ThinkingConfigis fully supported. The budget maps to OpenAI’sreasoning.effortparameter (low,medium,high) and reasoning summaries are streamed as thinking blocks. See Extended Thinking for budget-to-effort mapping. - Prompt caching: OpenAI does not use Anthropic-style prompt caching. Disable it in
AgentConfigto avoid unnecessary overhead: - Tool schema: Tools are translated to OpenAI function definitions automatically. Optional parameters are supported (strict mode is disabled).
SwappableLlmProvider
Change LLM at runtime:Extended Thinking
Supported by all three providers:Provider Differences
AnthropicProvider: Uses the budget directly as thinking tokens. GeminiProvider: Automatically converts budget to the appropriate format:- Gemini 3 models: Budget maps to thinking levels (
minimal,low,medium,high)0-512→minimal513-2048→low2049-8192→medium8193+→high
- Gemini 2.5 models: Uses numeric budget directly
reasoning.effort and automatically requests reasoning summaries:
0-2048→low2049-8192→medium8193+→high
ContentBlock::Thinking blocks, and reasoning tokens are tracked in Usage.thoughts_token_count.
The conversion is automatic based on the provider, so you use the same .with_thinking() API for all three providers.