Skip to main content
The user hits the recipe server over HTTP; Python serve() config controls auth, CORS, and ports. Expose recipe workflows over HTTP — configure auth, CORS, and deployment from Python or YAML.

How It Works

Quick Start

1

Simple Usage

Start a local recipe server:
Or via CLI:
2

With Configuration

Load settings from serve.yaml and override auth:

How It Works

create_app() builds a Starlette ASGI application; serve() runs it with uvicorn. Configuration merges file, environment variables, and Python overrides — CLI flags take highest precedence.

Configuration Options

serve.yaml example

Set PRAISONAI_API_KEY in the environment instead of hardcoding keys.

Common Patterns

ASGI app for custom deployment

Unified agents.yaml config

Test with TestClient


Best Practices

Set auth: api-key and load the key from PRAISONAI_API_KEY. Never expose an unauthenticated recipe server on a public network.
Set preload: true to warm recipes at startup and eliminate cold-start latency on the first request.
Set cors_origins to your exact frontend domain in production rather than "*".
Use the /health endpoint in Docker, Kubernetes, and load-balancer health checks.

Recipe Serve Advanced

Rate limiting, metrics, admin reload, and OpenTelemetry

Endpoints Code

Client-side code for calling recipe endpoints