Self-hosted docs
Event Schema
Event schema design keeps policy evaluation, incident correlation, and auditability consistent across teams.
Runtime event fields
Include route identity, model metadata, latency, token usage, and policy profile references in each event.
- Example: route_id: "prod-chat-completion-v1"
- Example: model: "claude-3-opus-20240229" with provider: "anthropic"
- Example: latency_ms: 1250, tokens: {input: 512, output: 256}
Change event fields
Capture provider source, classification, severity, and affected assets for reliable drift-to-route mapping.
- Example: provider: "aws-bedrock", source_url: "https://..."
- Example: classification: "pricing_change", severity: "high"
- Example: affected_assets: ["titian-express-v1", "jurassic-2-mid"]
Object schemas
Detailed schema definitions for key objects used throughout the API.
- Policy-result: {policy_id: "safety-v1", verdict: "violation", rule_matched: "hate_speech", confidence: 0.95, action_taken: "block", timestamp: "2024-03-15T14:30:00Z"}
- Permission-decision: {request_id: "req-123", resource: "export-tool", action: "execute", decision: "denied", reason: "role_restriction", role_required: "admin"}
- Failover-decision: {failover_policy_id: "latency-failover", trigger_condition: "latency > 2000ms", original_endpoint: "anthropic-claude", selected_fallback: "bedrock-claude", timestamp: "2024-03-15T14:30:00Z"}
- Route-exposure: {route_id: "prod-chat", provider: "anthropic", daily_requests: 15000, affected_users: 5000, revenue_impact: "$1200/day"}
- Incident-blast-radius: {incident_id: "inc-456", affected_routes: ["prod-chat", "prod-summary"], failed_requests: 450, users_impacted: 1800, duration_seconds: 300, revenue_impact: "$1800"}
Sample payloads
Complete payload examples for common event types and integrations.
- Webhook alert payload: {alert_id: "alert-789", incident_id: "inc-456", severity: "high", type: "policy_violation", message: "Hate speech detected in prod-chat", context: {route_id: "prod-chat", model: "claude-3-opus", timestamp: "2024-03-15T14:30:00Z"}, links: {incident_url: "https://dashboard.cyiro.com/incidents/inc-456"}}
- Email digest payload: {digest_id: "digest-20240315", period: "daily", workspace_id: "workspace-123", summary: {total_incidents: 5, policy_violations: 3, failover_events: 2}, incidents: [{id: "inc-456", severity: "high", type: "policy_violation", route: "prod-chat"}]}
- Watcher diff payload: {watcher_id: "aws-bedrock-pricing", change_type: "pricing_update", old_value: "$15 per 1M tokens", new_value: "$10 per 1M tokens", effective_date: "2024-04-01", affected_routes: ["prod-chat", "prod-summary"], impact_assessment: {cost_change_percent: -33, affected_workspaces: ["workspace-123"]}}
- Runtime event payload: {event_id: "evt-12345", route_id: "prod-chat", type: "runtime.request.completed", timestamp: "2024-03-15T14:30:00Z", payload: {latency_ms: 1250, tokens: {input: 512, output: 256}, cost: 0.0214, model: "claude-3-opus", provider: "anthropic"}}
- Change event payload: {event_id: "evt-12346", type: "watcher.release_note.change", provider: "anthropic", timestamp: "2024-03-15T10:00:00Z", payload: {change_id: "anthropic-release-20240315", summary: "Added new moderation features", impact: "May affect safety policy evaluations"}}
- Correlation event payload: {correlation_id: "corr-789", incident_id: "inc-456", related_events: ["evt-12345", "evt-12346"], pattern: "policy_violation_followed_by_failover", confidence: 0.92}
- Policy pack config payload: {policy_pack_id: "safety-v2", version: "2.1.0", rules: [{rule_id: "hate_speech", severity: "high", pattern: "[regulated terms]", action: "block"}], default_action: "log", description: "Comprehensive safety policies for production chat routes"}