Skip to content

Configuration

The daemon reads config.yaml (path via --config) merged with TOKENOPS_* environment variables; CLI flags win last.

Reference

yaml
listen: 127.0.0.1:7878        # bind address
log:
  level: info                 # debug | info | warn | error
  format: text                # text | json
shutdown:
  timeout: 15s                # graceful shutdown grace period

storage:
  enabled: true               # open the local sqlite store
  path: ~/.tokenops/events.db

tls:
  enabled: false              # serve HTTPS with auto-minted cert
  cert_dir: ~/.tokenops/certs
  hostnames: []               # extra SANs

providers:                    # upstream URL overrides
  openai: https://api.openai.com
  anthropic: https://api.anthropic.com
  gemini: https://generativelanguage.googleapis.com

otel:
  enabled: false              # ship envelopes to an OTLP collector
  endpoint: http://localhost:4318
  headers:
    x-honeycomb-team: ...
  service_name: tokenops
  redact: true

Environment variables

VariableMaps to
TOKENOPS_LISTENlisten
TOKENOPS_LOG_LEVELlog.level
TOKENOPS_LOG_FORMATlog.format
TOKENOPS_SHUTDOWN_TIMEOUTshutdown.timeout
TOKENOPS_TLS_ENABLEDtls.enabled
TOKENOPS_TLS_CERT_DIRtls.cert_dir
TOKENOPS_STORAGE_ENABLEDstorage.enabled
TOKENOPS_STORAGE_PATHstorage.path
TOKENOPS_OTEL_ENABLEDotel.enabled
TOKENOPS_OTEL_ENDPOINTotel.endpoint
TOKENOPS_OTEL_SERVICE_NAMEotel.service_name
TOKENOPS_PROVIDER_OPENAI_URLproviders.openai
TOKENOPS_PROVIDER_ANTHROPIC_URLproviders.anthropic
TOKENOPS_PROVIDER_GEMINI_URLproviders.gemini

Apache 2.0 licensed.