Gateway Configuration

Full reference for gateway.json and environment variable overrides.

HTTP

FieldTypeDefaultDescription
http.addrstring:8080Listen address
http.read_timeout_secondsint10HTTP read timeout
http.write_timeout_secondsint10HTTP write timeout
http.idle_timeout_secondsint120Keep-alive idle timeout

Dispatch

FieldTypeDefaultDescription
dispatch.worker_countintNumCPU × 4Goroutines in the worker pool
dispatch.queue_depthint100Max pending tasks before returning 503
dispatch.task_timeout_secondsint300Per-task wall-clock limit

Rate limiting

FieldTypeDefaultDescription
rate_limit.max_concurrent_per_userint2Max simultaneous tasks per user
rate_limit.window_secondsint60Rate limit window size
rate_limit.max_per_window_per_userint10Max tasks per user per window

Agent

FieldTypeDefaultDescription
agent.api_keystringAnthropic API key. Use ANTHROPIC_API_KEY env var instead.
agent.modelstringclaude-opus-4-6Anthropic model ID
agent.max_stepsint20Max LLM calls per task
agent.max_tokensint16000Per-call output token limit
agent.timeout_secondsint280Agent wall-clock timeout per task
agent.work_dirstring/workspaceBase dir for per-task isolated directories
agent.tools[]stringfetch_url, web_search, read_file, list_filesAllowed tools. write_file and run_bash must be opted in explicitly.
agent.skills[]stringnoneSkills to activate for all tasks
agent.max_fetch_callsint10Max fetch_url calls per task

Environment variable overrides

All secret fields fall back to their corresponding environment variable when the gateway.json value is empty. This means gateway.json can be committed to version control without any secrets.

Environment variableConfig field
ANTHROPIC_API_KEYagent.api_key
GATEWAY_SLACK_SIGNING_SECRETchannels.slack.signing_secret
GATEWAY_SLACK_BOT_TOKENchannels.slack.bot_token
GATEWAY_DISCORD_PUBLIC_KEYchannels.discord.public_key
GATEWAY_DISCORD_BOT_TOKENchannels.discord.bot_token
GATEWAY_TELEGRAM_BOT_TOKENchannels.telegram.bot_token
GATEWAY_TELEGRAM_WEBHOOK_SECRETchannels.telegram.webhook_secret
GATEWAY_WHATSAPP_ACCESS_TOKENchannels.whatsapp.access_token
GATEWAY_WHATSAPP_VERIFY_TOKENchannels.whatsapp.verify_token

Full example

gateway.jsonjson
{
  "http": {
    "addr": ":8080",
    "read_timeout_seconds": 10,
    "write_timeout_seconds": 10,
    "idle_timeout_seconds": 120
  },
  "dispatch": {
    "worker_count": 20,
    "queue_depth": 100,
    "task_timeout_seconds": 300
  },
  "rate_limit": {
    "max_concurrent_per_user": 2,
    "window_seconds": 60,
    "max_per_window_per_user": 10
  },
  "agent": {
    "api_key": "",
    "model": "claude-opus-4-6",
    "max_steps": 20,
    "max_tokens": 16000,
    "timeout_seconds": 280,
    "work_dir": "/workspace",
    "tools": ["fetch_url", "web_search", "read_file", "list_files"],
    "skills": ["research"],
    "max_fetch_calls": 10
  },
  "channels": {
    "slack":    { "enabled": true,  "signing_secret": "", "bot_token": "" },
    "discord":  { "enabled": true,  "application_id": "", "public_key": "", "bot_token": "" },
    "telegram": { "enabled": true,  "bot_token": "", "webhook_secret": "" },
    "whatsapp": { "enabled": false, "phone_number_id": "", "access_token": "", "verify_token": "" }
  }
}