Deployment architecture
In production, request flow is:OpenClaw/clients -> Railway-hosted Astrolabe -> OpenRouter -> routed model
Railway hosts the Astrolabe process only. Routing and safety behavior remain controlled by environment variables.
Steps
- Push
Astrolabe/to GitHub (standalone repo or monorepo). - In Railway, create a new project from GitHub.
- If monorepo, set Root Directory to
Astrolabe. - Add environment variables:
OPENROUTER_API_KEY=...ASTROLABE_API_KEY=...(long random secret)PORT=3000(optional)
- Set optional policy variables (
ASTROLABE_ROUTING_PROFILE,ASTROLABE_COST_EFFICIENCY_MODE, safety settings). - Deploy and copy your public URL.
- Point OpenClaw to
https://your-app-name.up.railway.app/v1.
Post-deploy verification
Run these checks before production traffic:GET /healthreturnsok: trueand expected mode values.- A basic non-stream chat request succeeds.
- Response headers include
x-astrolabe-initial-modelandx-astrolabe-final-model. - Logs show
category,route,chosen_model, andfinal_modelfields.
Rollout notes
- Start with conservative settings (
budget+strict) and observe routing outcomes. - If quality is below expectations for your workload, adjust toward
balanced/qualityprofiles. - Keep a rollback path by storing previous env settings.
Security checklist
- Keep
OPENROUTER_API_KEYprivate. - Always set
ASTROLABE_API_KEYfor public deployments. - Use a high-entropy value for
ASTROLABE_API_KEY. - Rotate keys immediately if leaked.
- Restrict who can change Railway environment variables.

