When to Use: Microservices architectures, non-Python applications, or when you need HTTP-based integration without deploying to the cloud.
How It Works
The sidecar runs as a local HTTP server, exposing recipes via REST API. Your application communicates over localhost—no external network required.Pros & Cons
- Pros
- Cons
- Polyglot - Any language with HTTP client can use it
- Process isolation - Recipes run in separate process
- Standard HTTP - Familiar REST/JSON interface
- Streaming support - SSE for real-time events
- Auth built-in - API key and JWT authentication
- Hot reload - Update recipes without restart
Step-by-Step Tutorial
API Reference
| Endpoint | Method | Description |
|---|---|---|
/health | GET | Health check |
/v1/recipes | GET | List recipes |
/v1/recipes/{name} | GET | Describe recipe |
/v1/recipes/{name}/schema | GET | Get recipe schema |
/v1/recipes/run | POST | Run recipe (sync) |
/v1/recipes/stream | POST | Run recipe (SSE) |
/v1/recipes/validate | POST | Validate recipe |
Production-Ready Example
Docker Deployment
Troubleshooting
Connection refused
Connection refused
Ensure the server is running:
SSE streaming not working
SSE streaming not working
Ensure you’re using the correct endpoint and headers:
CORS errors in browser
CORS errors in browser
Start the server with CORS enabled:
Security & Ops Notes
Security Considerations
- Bind to localhost - Default
127.0.0.1prevents external access - API key auth - Enable
--auth api-keyfor production - HTTPS - Use a reverse proxy (nginx, traefik) for TLS
- Rate limiting - Configure
rate_limitin serve.yaml - Request size limits - Default 10MB, adjust via
max_request_size
Best Practices
Bind to localhost unless you need remote access
Bind to localhost unless you need remote access
The default
127.0.0.1 keeps the sidecar off the network. Only bind to 0.0.0.0 behind a reverse proxy that terminates TLS and auth.Enable API-key auth for anything beyond local dev
Enable API-key auth for anything beyond local dev
Start with
--auth api-key and pass the key via X-API-Key. Keep the key in PRAISONAI_API_KEY, never in client code.Stream long-running recipes
Stream long-running recipes
Use
/v1/recipes/stream with Accept: text/event-stream so callers see incremental output instead of waiting for the full response.Add a health check to your orchestrator
Add a health check to your orchestrator
Poll
/health in Docker/Compose so the platform restarts the sidecar automatically when it becomes unhealthy.Related
Remote Managed Runner
Managed, multi-tenant recipe execution
Plugin Mode
Embed recipes into IDEs and chat apps

