Gateway Configuration
Full reference for gateway.json and environment variable overrides.
HTTP
| Field | Type | Default | Description |
|---|---|---|---|
| http.addr | string | :8080 | Listen address |
| http.read_timeout_seconds | int | 10 | HTTP read timeout |
| http.write_timeout_seconds | int | 10 | HTTP write timeout |
| http.idle_timeout_seconds | int | 120 | Keep-alive idle timeout |
Dispatch
| Field | Type | Default | Description |
|---|---|---|---|
| dispatch.worker_count | int | NumCPU × 4 | Goroutines in the worker pool |
| dispatch.queue_depth | int | 100 | Max pending tasks before returning 503 |
| dispatch.task_timeout_seconds | int | 300 | Per-task wall-clock limit |
Rate limiting
| Field | Type | Default | Description |
|---|---|---|---|
| rate_limit.max_concurrent_per_user | int | 2 | Max simultaneous tasks per user |
| rate_limit.window_seconds | int | 60 | Rate limit window size |
| rate_limit.max_per_window_per_user | int | 10 | Max tasks per user per window |
Agent
| Field | Type | Default | Description |
|---|---|---|---|
| agent.api_key | string | — | Anthropic API key. Use ANTHROPIC_API_KEY env var instead. |
| agent.model | string | claude-opus-4-6 | Anthropic model ID |
| agent.max_steps | int | 20 | Max LLM calls per task |
| agent.max_tokens | int | 16000 | Per-call output token limit |
| agent.timeout_seconds | int | 280 | Agent wall-clock timeout per task |
| agent.work_dir | string | /workspace | Base dir for per-task isolated directories |
| agent.tools | []string | fetch_url, web_search, read_file, list_files | Allowed tools. write_file and run_bash must be opted in explicitly. |
| agent.skills | []string | none | Skills to activate for all tasks |
| agent.max_fetch_calls | int | 10 | Max 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 variable | Config field |
|---|---|
| ANTHROPIC_API_KEY | agent.api_key |
| GATEWAY_SLACK_SIGNING_SECRET | channels.slack.signing_secret |
| GATEWAY_SLACK_BOT_TOKEN | channels.slack.bot_token |
| GATEWAY_DISCORD_PUBLIC_KEY | channels.discord.public_key |
| GATEWAY_DISCORD_BOT_TOKEN | channels.discord.bot_token |
| GATEWAY_TELEGRAM_BOT_TOKEN | channels.telegram.bot_token |
| GATEWAY_TELEGRAM_WEBHOOK_SECRET | channels.telegram.webhook_secret |
| GATEWAY_WHATSAPP_ACCESS_TOKEN | channels.whatsapp.access_token |
| GATEWAY_WHATSAPP_VERIFY_TOKEN | channels.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": "" }
}
}