/v1 host by setting base_url and api_key on the Agent — bare catalog model ids are fine, no provider/ prefix required.
Quick Start
1
Simplest form
Pass
base_url and api_key at the top level with a bare model id.2
Environment-variable variant
Set the host once with environment variables, then keep the code clean.
3
Dict form (equivalent)
The dict form does the same thing when you prefer to bundle connection settings inside
llm.How It Works
PraisonAI routes a bare model id plus abase_url through the OpenAI-compatible client.
Configuration Options
Set these top-levelAgent parameters for any OpenAI-compatible host.
Agent SDK Reference
Full parameter surface for the Agent class.
Common Patterns
Every host uses the same 5-line pattern — onlybase_url and the catalog id change.
- P0 / pzero.studio
- DeepInfra
- Fireworks
- Together AI
- vLLM
- LM Studio
- Company gateway
Choosing Which Style to Use
Pick the routing style that matches what you connect to.Best Practices
Use base_url at the top level for one-off hosts
Use base_url at the top level for one-off hosts
The top-level
base_url is cleaner than the dict form for single-agent scripts. Reach for the dict form only when you want connection settings bundled inside llm.Use env vars when the host is fixed
Use env vars when the host is fixed
Set
OPENAI_API_BASE and OPENAI_API_KEY when the host stays the same across runs. This keeps code portable across environments.Keep embeddings on their own provider
Keep embeddings on their own provider
Most OpenAI-compatible chat hosts don’t serve embeddings. Configure embeddings separately — see the Embeddings docs.
Don't add openai/ yourself
Don't add openai/ yourself
PraisonAI adds the
openai/ prefix internally when base_url is set. Adding it manually is harmless but unnecessary.Don't mix base_url with Anthropic, Gemini, or Ollama models
Don't mix base_url with Anthropic, Gemini, or Ollama models
Those keep their native adapters. Use
base_url only for OpenAI-compatible Chat Completions hosts.Related
OpenAI
First-party OpenAI models.
LiteLLM Proxy
Route through a self-hosted LiteLLM proxy gateway.
Ollama
Local Ollama models.
Custom Provider
Register a fully custom Python provider.

