Skip to main content
Expose recipes over localhost HTTP so polyglot services call the same sidecar process.
The user POSTs to the sidecar; the agent runtime executes the recipe and returns JSON.
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

  • 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

1

Install with Serve Dependencies

2

Start the Sidecar Server

3

Verify Server Health

Expected response:
4

List Available Recipes

5

Run a Recipe

API Reference

Production-Ready Example

Docker Deployment

Troubleshooting

Ensure the server is running:
If auth is enabled, provide the API key:
Or set the environment variable:
Ensure you’re using the correct endpoint and headers:
Start the server with CORS enabled:

Security & Ops Notes

Security Considerations
  • Bind to localhost - Default 127.0.0.1 prevents external access
  • API key auth - Enable --auth api-key for production
  • HTTPS - Use a reverse proxy (nginx, traefik) for TLS
  • Rate limiting - Configure rate_limit in serve.yaml
  • Request size limits - Default 10MB, adjust via max_request_size

Best Practices

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.
Start with --auth api-key and pass the key via X-API-Key. Keep the key in PRAISONAI_API_KEY, never in client code.
Use /v1/recipes/stream with Accept: text/event-stream so callers see incremental output instead of waiting for the full response.
Poll /health in Docker/Compose so the platform restarts the sidecar automatically when it becomes unhealthy.

Remote Managed Runner

Managed, multi-tenant recipe execution

Plugin Mode

Embed recipes into IDEs and chat apps