Supported Providers
OpenAI
GPT models, embeddings, and function calling with full streaming support.
Anthropic
Claude models with OpenAI-compatible API interface.
Quick Start
Provider Features
Authentication
Environment Variables
Set your API keys as environment variables:Explicit API Keys
Pass API keys directly to the provider functions:Common Parameters
All providers support these common parameters:Provider-Specific Features
OpenAI
- Native structured output with
response_format="json_object" - Function calling with full tool support
- Embedding models with automatic batching
- Vision models with multimodal support
Anthropic
- OpenAI-compatible API using compatibility layer
- Function calling via OpenAI SDK
- Streaming support with real-time deltas
- System prompts and message-based conversations
Bring Your Own Provider
Implement theLanguageModel or EmbeddingModel interface – only a handful of methods are required:
generate_text and you instantly get the full SDK experience (tool-calling, streaming, …) without writing another line of glue code.
Error Handling
All providers handle common errors gracefully:- Invalid API key - Check your credentials
- Rate limiting - Implement exponential backoff
- Model not found - Verify model name
- Token limit exceeded - Reduce input length