Skip to main content
Get started with PraisonAI and OpenAI in under 5 minutes, with instructions that work on Windows, macOS, and Linux.
The user installs PraisonAI, sets an API key, and runs their first agent in one session.

Quick Start

1

Simple Usage

Get your API key from OpenAI Dashboard and set it as an environment variable before running.
Use pip install praisonai instead if you need CLI tools and YAML workflows.
2

With Configuration

Verify your setup with the CLI:
On PraisonAI 4.6.104+, you can also run praisonai doctor --live --json to validate your OpenAI key against the API (not just check its presence).
Get your API key from OpenAI Dashboard. Never commit API keys to version control.

How It Works

The agent workflow follows these steps:

Configuration Options

Environment Variables

Agent Configuration


Common Patterns

Simple Q&A Agent

Agent with Memory

CLI Usage (requires pip install praisonai)


Advanced Features

Multi-agent functionality requires the latest version. If you encounter issues, ensure you have the newest release.

Troubleshooting

Windows doesn’t recognize the export command. Use these alternatives:PowerShell:
Command Prompt:
Permanent solution: Use a .env file in your project directory.
This means you installed praisonaiagents (Python SDK only) but need the CLI tools.Solution:
The packages serve different purposes:
  • praisonaiagents - Python SDK for scripting
  • praisonai - CLI tools and YAML workflows
If praisonai doctor env shows API key errors:
  1. Check the key format: Should start with sk-
  2. Verify environment: Run echo $OPENAI_API_KEY (bash) or echo $env:OPENAI_API_KEY (PowerShell)
  3. Use .env file: More reliable than environment variables
  4. Check permissions: Ensure you have valid OpenAI credits/usage limits
If you see garbled text or encoding errors:
  1. Use JSON output: Add --json flag to CLI commands
  2. Check terminal encoding: Use Windows Terminal instead of Command Prompt
  3. Set encoding: Add chcp 65001 before running commands

Best Practices

  • Never hardcode API keys in source code
  • Use .env files for local development
  • Set proper file permissions: chmod 600 .env
  • Use environment variables in production
  • Rotate keys regularly
  • gpt-4o-mini - Fast and cost-effective for simple tasks
  • gpt-4o - Best performance for complex reasoning
  • gpt-3.5-turbo - Good balance of speed and capability
  • Start with gpt-4o-mini and upgrade as needed
  • Use temperature=0 for consistent, factual responses
  • Use temperature=0.7-1.0 for creative tasks
  • Set appropriate max_tokens to control response length
  • Enable memory=True for conversational agents
  • Check your OpenAI dashboard regularly
  • Set usage alerts in OpenAI console
  • Use shorter prompts when possible
  • Cache responses for repeated queries

Next Steps

Advanced Agent Features

Explore planning, reflection, and advanced reasoning capabilities

Multi-Agent Teams

Build collaborative agent teams for complex workflows

Tools & Integrations

Add web search, file tools, and custom integrations

Memory & Knowledge

Implement persistent memory and knowledge bases

Installation Guide

Complete installation instructions for all platforms

CLI Reference

Full command-line interface documentation