The gateway now ships in the
praisonai-bot package. praisonai serve gateway still works exactly as documented here; for a standalone install see praisonai-bot Migration.This page documents the WebSocket multi-agent Gateway daemon. The canonical CLI command is
praisonai-bot gateway start (bot-tier package). When the praisonai wrapper is co-installed, praisonai gateway start works as a convenience alias.For the UI-Gateway (Pattern C integration), see praisonai serve ui-gateway.For detailed information about channel resilience and operator controls, see Channel Supervision.praisonai gateway start; the CLI launches the daemon, supervises channels, and keeps the WebSocket gateway reachable.
How It Works
Quick Start
The gateway runs in the foreground. The daemon is installed by
praisonai-bot gateway install (or automatically by praisonai-bot onboard).1
Start Gateway
2
Check Status
3
Test Health Endpoint
Commands
Gateway Management
Daemon Service
Channel Control
Inbound Hooks
See Gateway Inbound Hooks for full details.
Testing & Debugging
Command Reference
- start
- stop
- status
- doctor
- channels
- pause
- resume
- reconnect
--reliability overrides the reliability: / gateway.reliability: key in YAML. See Gateway Reliability Presets for profile details and precedence rules.Corporate proxies / SSL-inspecting networks. A preflight failure caused only by
SSLCertVerificationError / certificate_verify_failed does not abort the start — the token is usually valid and the runtime adapter’s SSL stack is more permissive. The gateway prints a one-line warning naming the three CA-bundle env vars and continues.If any channel also fails for a non-SSL reason (bad token, unreachable host, timeout), preflight still hard-aborts — fix that channel or pass --no-preflight. See Corporate CA bundle (SSL-inspecting networks).Pre-flight credential check
praisonai gateway doctor validates every channel’s token before the gateway starts, so a bad or expired credential fails fast with a precise per-channel reason instead of disappearing into the supervisor’s silent reconnect loop.
Examples
Quick health check:Pre-flight gate on start
praisonai gateway start runs the same probe automatically before launch when invoked with --config gateway.yaml:
Corporate CA bundle (SSL-inspecting networks)
On networks that intercept TLS with a corporate CA (proxy / MITM), the probe’s HTTP client can reject the certificate chain even though the token is valid and the runtime adapter connects fine. Preflight classifies these SSL cert-verify failures separately and soft-fails when they are the only failures.
Point the probe at your corporate CA with one of three env vars, highest precedence first:
Token resolution
The probe loads~/.praisonai/.env first, so ${VAR} placeholders set by praisonai onboard resolve exactly like they do at runtime — doctor, channels --probe, and start --preflight all share the same token-resolution path.
Per-channel timeout
Each probe is bounded by a 15-second deadline; a stuck adapter is reported as"probe timed out after 15s" and does not hang the aggregate.
Exit codes
When to use which
Programmatic check (Python)
Programmatic check (Python)
Environment Variables
The
GATEWAY_PORT environment variable is used by start, stop, and status commands when the --port option is not explicitly provided. Invalid values silently fall back to 8765.Single-Instance Enforcement
PraisonAI enforces a single gateway instance per host:port combination using PID locks. Lock File Location:~/.praisonai/gateway-<safe_host>-<port>.pid
The safe_host replaces : and . with _ (so 127.0.0.1 becomes 127_0_0_1). Each host:port combination gets its own lock file, allowing multiple gateways on different ports.
PID-Lock Status Reference
praisonai gateway status prints one PID-lock line before the /health probe. Look up any line you see:
The port line (
Port <host>:<port>: In use / Available) follows the same section unless PID-lock inspection fails, in which case the single PID lock status: Unavailable (<error>) line replaces both.
Restart the Daemon
Use these OS-specific commands to restart the daemon service (same commands shown in the onboard Done panel):- macOS
- Linux
- Windows
Status Output Examples
Healthy Gateway
PID Lock Unavailable (Windows)
On Windows,
os.kill(pid, 0) can raise SystemError. From PraisonAI ≥ v4.6.141 the PID-lock inspection is advisory only — this line replaces Gateway PID lock: … / Port …: … when the check fails, and the /health probe still runs so you still see the real status.Daemon Issues
Not Installed
Platform Support
Gateway CLI works across platforms with native daemon integration:Configuration Files
- agents.yaml
- gateway.yaml
Best Practices
Use daemon-only for health checks
Use daemon-only for health checks
Use
--daemon-only flag when monitoring daemon status in scripts or CI/CD pipelines to avoid gateway connection attempts.Check logs for troubleshooting
Check logs for troubleshooting
Always check
praisonai gateway logs when the daemon is running but gateway is unreachable - this reveals startup errors.Test channel configuration
Test channel configuration
Use
praisonai gateway send to test channel bot configuration before deploying to production environments.Monitor daemon status regularly
Monitor daemon status regularly
Set up monitoring that runs
praisonai gateway status --daemon-only to detect service failures quickly.Related
Gateway Server
Gateway architecture and configuration
Troubleshooting
Common gateway issues and solutions

