Recipe Serve
Thepraisonai serve recipe command starts an HTTP server that exposes recipe endpoints for remote invocation.
Quick Start
Command Options
Security
Host Binding Safety
By default, the server binds to127.0.0.1 (localhost only). Binding to 0.0.0.0 (all interfaces) requires authentication.
Authentication Modes
Supported Auth Modes
The recipe server accepts exactly three auth modes, defined as a single source of truth inpraisonai.recipe.serve:
create_app(config) validates the auth value at construction time and raises ValueError for anything else — including typos (apikey, apiKey), empty strings (""), and non-strings (False, []).
auth is one of the supported non-none modes (or --api-key is passed on the CLI). The CLI runs its checks in this order:
1
Load config
Read
serve.yaml (or CLI flags) into the config.2
Validate auth mode
Reject any
auth value outside SUPPORTED_AUTH_TYPES before binding.3
Bind guard
Refuse a non-localhost bind that resolves to
auth: none with no --api-key.4
Serve
Start the server only after all checks pass.
API Key Authentication
X-API-Key header:
Configuration File
Create aserve.yaml file for persistent configuration:
Configuration Precedence
- CLI flags (highest priority)
- Environment variables
- Config file
- Defaults (lowest priority)
API Endpoints
Health Check
List Recipes
Describe Recipe
Get Recipe Schema
Run Recipe
Stream Recipe (SSE)
Examples
Development Mode
Production Mode
Using with Docker
Client Examples
curl
Python
JavaScript
Environment Variables
Troubleshooting
Port Already in Use
Missing Dependencies
Auth Required for Public Binding
Unsupported Auth Mode
none, api-key, or jwt). Typos like apikey, api_key, or apiKey fail closed rather than downgrading to no auth.
