Observability

Manage broadcast destinations for usage, error, and memory events.

Endpoints

MethodPathAuthDescription
GET/v1/observability/destinationsAPI KeyList destinations
POST/v1/observability/destinationsAPI KeyAdd a destination
PUT/v1/observability/destinations/:idAPI KeyUpdate a destination
DELETE/v1/observability/destinations/:idAPI KeyRemove a destination
POST/v1/observability/test/:idAPI KeySend test event
GET/v1/observability/configAPI KeyGet broadcast config
PUT/v1/observability/configAPI KeyEnable/disable broadcasting
GET/v1/observability/templatesAPI KeyList integration templates
GET/v1/observability/templates/:providerAPI KeyGet template for a platform

Add a destination

curl -X POST https://api.brainstormrouter.com/v1/observability/destinations \
  -H "Authorization: Bearer br_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Analytics Webhook",
    "type": "webhook",
    "config": {"url": "https://example.com/ingest"},
    "event_types": ["usage", "error"],
    "batch": {"max_size": 50, "flush_interval_ms": 5000}
  }'

Request body

FieldTypeRequiredDescription
namestringYesDisplay name
typestringYeswebhook, otlp, datadog, splunk, posthog, s3, custom
configobjectYesType-specific config (see below)
event_typesstring[]NoFilter: usage, audit, quality, guardrail, error
batchobjectNomax_size and flush_interval_ms

Config by type

TypeRequired fields
webhook{ url: string }
otlp{ endpoint: string }
datadog{ api_key: string }
splunk{ hec_url: string, hec_token: string }
posthog{ api_key: string }
s3{ bucket: string }
custom{ url: string }

Integration templates

Pre-built configs for popular platforms. Reduces setup to "fill in your API key."

# List available templates
curl https://api.brainstormrouter.com/v1/observability/templates \
  -H "Authorization: Bearer br_live_..."

# Get specific template
curl https://api.brainstormrouter.com/v1/observability/templates/langfuse \
  -H "Authorization: Bearer br_live_..."

Available templates: langfuse, datadog, posthog, s3, splunk

Each template returns:

  • config_schema — required/optional fields with descriptions
  • recommended_event_types — best event types for this platform
  • example_config — copy-paste config to get started

Test a destination

Sends a synthetic usage event to verify connectivity.

curl -X POST https://api.brainstormrouter.com/v1/observability/test/dest-uuid \
  -H "Authorization: Bearer br_live_..."

Enable/disable broadcasting

curl -X PUT https://api.brainstormrouter.com/v1/observability/config \
  -H "Authorization: Bearer br_live_..." \
  -H "Content-Type: application/json" \
  -d '{"enabled": true}'