Provider System
Egregore’s provider system offers a unified interface for interacting with 30+ AI providers including OpenAI, Anthropic, Google, Mistral, Cohere, and more. Write your code once, and it works seamlessly across all providers.The Provider Problem
Different AI providers have different APIs, formats, and capabilities:Write code once using Egregore’s Agent API, and it works identically across all 30+ providers. Switch providers by changing a single string.
Using Providers
Provider String Format
Providers use the formatprovider:model:
Supported Providers
Egregore supports 30+ providers:View All
Complete list of 30+ supported providers and models
API Key Configuration
Providers require API keys set via environment variables:Provider Interface
Unified Methods
All providers implement the same interface:Model Parameters
Configure model-specific parameters:Egregore passes parameters directly to providers. Unsupported parameters are ignored gracefully.
Provider Features
Universal Token Counting
Egregore provides accurate token counting across all providers:Streaming Support
All providers support streaming:Tool/Function Calling
Providers with tool support work identically:Multimodal Support
Providers supporting images, audio, or video use the same API:Provider Switching
Runtime Provider Change
Switch providers without recreating the agent:Fallback Providers
Implement provider fallback for reliability:Model Comparison
Compare responses from multiple providers:Provider Configuration
Parameter Merging
Egregore uses 3-tier parameter merging:OAuth Interceptors
Premium models (GPT-5, Claude, etc.) use OAuth automatically:OAuth is automatic for premium tier models. Egregore handles authentication flows transparently.
Provider Properties
Accessing Provider Info
Provider Capabilities
Check what a provider supports:Best Practices
Use provider-agnostic code
Use provider-agnostic code
Write code that works across all providers:
Set API keys via environment
Set API keys via environment
Use environment variables for security:
Monitor token usage
Monitor token usage
Track usage to control costs:
Test provider switches
Test provider switches
Ensure your code works with multiple providers:
Use appropriate models
Use appropriate models
Choose models based on task requirements:
Common Patterns
Provider Selection by Task
A/B Testing Providers
Cost-Optimized Provider Selection
Multi-Provider Ensemble
Performance Considerations
Streaming for Long Responses
Use streaming for better perceived performance:Provider Latency
Different providers have different latencies:What’s Next?
Supported Providers
Complete list of 30+ providers and models
Provider API Reference
Detailed API documentation for providers
Token Counting
Universal token counting across providers
Adding Providers
Guide for contributing new provider integrations

