← Home Docs

🔧 Provider Configuration

Correctover uses BYOK (Bring Your Own Key) — your API keys connect directly to providers. Zero relay, zero markup, zero data interception. Configure any combination of supported providers.

Supported Providers

ProviderIdentifierAuth Method
OpenAIopenai/*API key
Anthropicanthropic/*API key
Google / Geminigoogle/*API key
DeepSeekdeepseek/*API key
Groqgroq/*API key
Azure OpenAIazure/*API key + endpoint
DashScope (Alibaba)dashscope/*API key

Basic Configuration

from correctover import AIProvider

provider = AIProvider(
    default="openai/gpt-4o",
    fallbacks=[
        "anthropic/claude-3-opus-20250219",
        "google/gemini-2.0-pro-001",
    ],
    credentials={
        "openai": {"api_key": "sk-..."},
        "anthropic": {"api_key": "sk-ant-..."},
        "google": {"api_key": "AIza..."},
    }
)

Environment Variable Configuration

Recommended for production: load API keys from environment variables.

import os
from correctover import AIProvider

provider = AIProvider(
    default="openai/gpt-4o",
    fallbacks=["anthropic/claude-3-opus"],
    credentials={
        "openai": {"api_key": os.environ["OPENAI_API_KEY"]},
        "anthropic": {"api_key": os.environ["ANTHROPIC_API_KEY"]},
        "google": {"api_key": os.environ["GOOGLE_API_KEY"]},
    }
)

Azure OpenAI Configuration

provider = AIProvider(
    default="azure/gpt-4o",
    credentials={
        "azure": {
            "api_key": os.environ["AZURE_OPENAI_KEY"],
            "endpoint": "https://your-resource.openai.azure.com",
            "api_version": "2024-10-21",
        }
    }
)

Failover Chain Strategies

Cost-Optimized Chain

provider = AIProvider(
    default="openai/gpt-4o-mini",
    fallbacks=["deepseek/deepseek-chat", "groq/llama-3.3-70b"],
    contracts=[Contract.cost(max_cents=0.1)]
)

Maximum Reliability Chain

provider = AIProvider(
    default="openai/gpt-4o",
    fallbacks=["anthropic/claude-3-opus", "google/gemini-2.0-pro"],
    contracts=[Contract.latency(max_ms=10000)]
)

Geographic Diversity Chain

provider = AIProvider(
    default="openai/gpt-4o",        # US-West
    fallbacks=[
        "azure/gpt-4o",              # US-East (different region)
        "dashscope/qwen-max",        # Asia (different continent)
    ]
)