Basic
- Code
- No Code
- JavaScript
- TypeScript
Set API Key
Set the key for whichever provider you use — PraisonAI picks the right model automatically:
- OpenAI
- Anthropic
- Gemini
- Groq
- Ollama
No
--model flag needed — the matching provider’s default model is selected automatically. See Provider Auto-Detection for the full list.Prerequisites
- Python 3.10 or higher
- An API key for any supported provider (OpenAI, Anthropic, Google, Groq, Cohere) or a running Ollama instance — OpenAI is not required
- For the full list of providers, see Models
Advanced
Providing Detailed Tasks to Agents (Optional)
- Code
- No Code
Creating Custom Tool for Agents (Optional)
Tools makes the Agent powerful.
- Code
- No Code
How It Works
An Agent takes your instructions, calls the LLM behind the scenes, and returns the result.Best Practices
Set keys in your shell, never inline
Set keys in your shell, never inline
Export
OPENAI_API_KEY (or your provider’s key) in your shell or a .env file. Never paste the raw string into Agent(llm=...).Start with the shortest shape
Start with the shortest shape
Agent(instructions="…").start() is the shortest working agent. Add name, role, tools, or a full Task only when you need them.Skip --model on first runs
Skip --model on first runs
PraisonAI picks the right default for whichever provider credential you set. See Provider Auto-Detection.
Add tools progressively
Add tools progressively
Give an agent a plain Python function via
tools=[...] when it needs to search, fetch, or compute. Keep tool functions small and typed.Related
Models
Choose an LLM provider and model.
Tools
Extend agents with functions and integrations.

