Reference
Configuration
The Go struct is the canonical shape; Node.js uses camelCase keys and Python uses snake_case keys with identical semantics.
Go
type Config struct {
Preset string // preset name or alias
RequestsPerSecond int // override preset RPS
Burst int // override preset burst
TokenBudgetPerHour int64 // override token budget
TokenBudgetPerDay int64
TokenBudgetPerMonth int64
TokenBudgetMode TokenBudgetMode // "hard-stop" or "soft-stop"
ServiceName string // OTel service name
OTLPCollectorEndpoint string // OTel collector URL
RedisClient *redis.Client // distributed rate limiting
CircuitBreaker CircuitBreakerOptions
EventEmitter EventEmitter // custom event handler
EventEndpoint string // HTTP event webhook
TenantID string // multi-tenant key
RouteID string
UpstreamID string
Provider string // LLM provider name
Model string // LLM model name
EstimatedTokensPerRequest int64 // bound hard-stop budget reservations
Guardrails *GuardrailChain // violations → 422
LoopDetection bool // agent loop detection
LoopMaxDepth int // max sequence depth (default 50)
MaxBufferedResponseBytes int // token-extraction buffer cap (default 1 MiB)
}Field groups
| Group | Fields | Notes |
|---|---|---|
| Rate limiting | Preset, RequestsPerSecond, Burst | Preset values in Presets; overrides win. |
| Token budgets | TokenBudgetPerHour/Day/Month, TokenBudgetMode, EstimatedTokensPerRequest | See Token budgets. |
| Scoping | TenantID, RouteID, UpstreamID, Provider, Model | Partition buckets, budgets, and breakers. |
| Distribution | RedisClient | Optional — without it, limiting is process-local. |
| Observability | ServiceName, OTLPCollectorEndpoint, EventEmitter, EventEndpoint | See Observability. |
| Agent safety | LoopDetection, LoopMaxDepth, Guardrails | See Loop detection and Guardrails. |
| Streaming | MaxBufferedResponseBytes | Caps the side-scan buffer used for token extraction (default 1 MiB). |
Deeper reference
The complete API reference — every adapter, outbound option, MCP tool schema, and event payload — lives in the repository: docs/API_REFERENCE.md. A machine-readable config schema ships as config.schema.json, and llms.txt carries these docs in a format AI readers ingest directly.