Docs menu

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

GroupFieldsNotes
Rate limitingPreset, RequestsPerSecond, BurstPreset values in Presets; overrides win.
Token budgetsTokenBudgetPerHour/Day/Month, TokenBudgetMode, EstimatedTokensPerRequestSee Token budgets.
ScopingTenantID, RouteID, UpstreamID, Provider, ModelPartition buckets, budgets, and breakers.
DistributionRedisClientOptional — without it, limiting is process-local.
ObservabilityServiceName, OTLPCollectorEndpoint, EventEmitter, EventEndpointSee Observability.
Agent safetyLoopDetection, LoopMaxDepth, GuardrailsSee Loop detection and Guardrails.
StreamingMaxBufferedResponseBytesCaps 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.