Skip to main content
Switch between any LLM provider — OpenAI, Anthropic, Google, and more — without changing your agent code.

Quick Start

1

Simple Usage

2

With Configuration

3

Switch Providers with One Line


How It Works


Supported Providers


Common Patterns

Agent with Tools

Structured Output

outputSchema takes a JSON Schema object (not a Zod schema) and is wired to OpenAI as response_format: { type: 'json_schema', … }, constraining the model to matching JSON. OpenAI-only — other providers log a warning and skip it. See Structured Output.
outputSchema is OpenAI-only. On a non-OpenAI provider the agent warns loudly and proceeds without structured output rather than silently dropping the schema. Reasoning families (gpt-5*, o1*, o3*, o4*) omit temperature automatically. See Output → Schema-constrained output.

Multi-Agent Pipeline

Environment Variables


Best Practices

Always use "provider/model" strings ("openai/gpt-4o-mini") rather than provider-specific config objects. Switching providers is a one-line change.
Core PraisonAI bundles OpenAI support. For other providers install @ai-sdk/anthropic, @ai-sdk/google, etc. only when you use them.
For quick tasks use openai/gpt-4o-mini or google/gemini-2.0-flash. For complex reasoning use anthropic/claude-3-5-sonnet-latest or openai/gpt-4o. Mix providers across agents in multi-agent workflows.
Never hard-code API keys. Use environment variables (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.). For production deployments use a secrets manager.

Providers

Full provider reference and configuration

Structured Output

Type-safe JSON responses