Skip to main content
OpenSRE deploys as a standard Python/FastAPI runtime. Use the repo Dockerfile, Railway, EC2, ECS, Vercel, or another ASGI-capable host.

Runtime environment

1

Deploy the app

Deploy this repository using your hosting provider’s normal app workflow.
2

Configure your model provider

Add LLM_PROVIDER as an environment variable (for example anthropic, openai, openrouter, or gemini).
3

Add the matching provider API key

Use the API key that matches your provider:
  • ANTHROPIC_API_KEY for LLM_PROVIDER=anthropic
  • OPENAI_API_KEY for LLM_PROVIDER=openai
  • OPENROUTER_API_KEY for LLM_PROVIDER=openrouter
  • DEEPSEEK_API_KEY for LLM_PROVIDER=deepseek
  • GEMINI_API_KEY for LLM_PROVIDER=gemini
4

Add integration env vars and deploy

Add any storage and integration environment variables required by your runtime, then deploy and verify health.
Minimum LLM environment example:
LLM_PROVIDER=anthropic
ANTHROPIC_API_KEY=...
The complete list of provider keys and optional model overrides is documented in .env.example.

Run local gateway

Use the built-in gateway command when you want a local HTTP server for investigations.
CommandWhat it does
uv run opensre gatewayStarts the local gateway on 127.0.0.1:2024.
uv run opensre gateway --host 0.0.0.0 --port 8080Binds the gateway to a custom host/port.
uv run opensre gateway --api-key local-dev-keyEnables API key auth for non-exempt routes.
uv run opensre gateway --investigations-dir ./investigationsWrites investigation reports to a custom directory.
Quick local checks:
curl http://127.0.0.1:2024/ok
curl http://127.0.0.1:2024/version
Example investigation request:
curl -X POST http://127.0.0.1:2024/investigate \
  -H "Content-Type: application/json" \
  -d '{
    "raw_alert": {
      "alert_name": "etl-daily-orders-failure",
      "pipeline_name": "etl_daily_orders",
      "severity": "critical",
      "message": "Orders pipeline failed with timeout."
    }
  }'
When --api-key is set, include it for protected endpoints:
curl -X POST http://127.0.0.1:2024/investigate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: local-dev-key" \
  -d '{"raw_alert":{"alert_name":"test"}}'

Railway deployment

Railway is still supported as a hosted runtime option. Before deploying on Railway, make sure your service has:
  • DATABASE_URI pointing to your Railway Postgres instance
  • REDIS_URI pointing to your Railway Redis instance
Then deploy the service using your Railway project workflow.