{"openapi":"3.0.3","info":{"title":"Xantly API","description":"Xantly Engine — control & inference plane.  Every endpoint with #[utoipa::path] is listed; the runtime endpoint_registry is the authoritative catalog (joined with health, tests, usage, SLOs, dependencies, ownership).","license":{"name":""},"version":"1.0.0"},"servers":[{"url":"https://api.xantly.com","description":"Xantly production API"}],"paths":{"/":{"get":{"tags":["passkey"],"summary":"Lists /.","description":"Reads from Postgres and returns a typed `ListPasskeysResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_passkeys","responses":{"200":{"description":"List the authenticated user's active passkeys. Returns only non-sensitive metadata (id, name, dates, transports). Does NOT return credential_id or public_key material.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPasskeysResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["observability"],"summary":"Creates /.","description":"And returns a typed `SloResponse` payload (request body: `SloRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_slo","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SloRequest"}}},"required":true},"responses":{"200":{"description":"Create slo.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SloResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/.well-known/oauth-authorization-server":{"get":{"tags":["discovery"],"summary":"Authorization server metadata, RFC 8414.","description":"Describes what this deployment actually supports today: bearer API keys and\nthe password/social login the dashboard uses. It deliberately does not\nadvertise an authorization_code flow, because there is no public client\nregistration to drive one.\nOAuth 2.0 Authorization Server Metadata (RFC 8414).\n\nDescribes what this deployment actually supports. It deliberately does not\nadvertise an authorization_code flow, because there is no public client\nregistration to drive one, and it omits `jwks_uri` when the key set is\nempty rather than pointing a client at a document with no keys.","operationId":"authorization_server_metadata","responses":{"200":{"description":"Authorization server metadata (RFC 8414) for this deployment.","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"tags":["discovery"],"summary":"OAuth 2.0 Protected Resource Metadata (RFC 9728).","description":"Public and unauthenticated by design: an agent reads this to learn which\nscopes it can request before it holds a credential. `scopes_supported` is\ngenerated from the scopes the gateway actually enforces.","operationId":"protected_resource_metadata","responses":{"200":{"description":"Protected resource metadata (RFC 9728), including the scopes an API key may carry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtectedResourceMetadata"}}}}}}},"/benchmarks":{"get":{"tags":["observability"],"summary":"Returns benchmarks.","description":"And returns a typed `GetBenchmarksResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_benchmarks","parameters":[{"name":"days","in":"query","description":"Look-back window in days (default 30, clamped to 1..=365).","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}}],"responses":{"200":{"description":"Get benchmarks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBenchmarksResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/breakers":{"get":{"tags":["observability"],"summary":"Returns breakers.","description":"Reads from Redis and returns a typed `Vec<BreakerStatus>` payload.\n\nRequires a valid bearer token.","operationId":"get_breakers","responses":{"200":{"description":"Get breakers.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BreakerStatus"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/breakers/reset":{"post":{"tags":["observability"],"summary":"Triggers breakers reset.","description":"Reads from Redis (request body: `serde_json::Value`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"breakers_reset_breaker","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Reset breaker."},"204":{"description":"No content."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/cache/purge":{"post":{"tags":["observability"],"summary":"Triggers cache purge.","description":"Reads from Redis.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"purge_cache","responses":{"201":{"description":"Purge cache."},"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/cache/stats":{"get":{"tags":["observability"],"summary":"Returns cache stats.","description":"Reads from Redis and returns a typed `CacheStats` payload.\n\nRequires a valid bearer token.","operationId":"get_cache_stats","responses":{"200":{"description":"Get cache stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheStats"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/classify_complexity":{"post":{"tags":["utils"],"summary":"Creates classify_complexity.","description":"And returns a typed `ClassifyComplexityResponse` payload (request body:\n`ClassifyComplexityRequest`).\n\nPublic — no authentication required. Pure compute: heuristic classification, no\nDB writes.","operationId":"classify_complexity","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyComplexityRequest"}}},"required":true},"responses":{"200":{"description":"Classify prompt complexity (simple heuristic)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyComplexityResponse"}}}},"400":{"description":"Bad request — validation failed."}}}},"/config":{"get":{"tags":["output"],"summary":"Returns config.","description":"Reads from Postgres and returns a typed `OutputConfigResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_output_config","responses":{"200":{"description":"Get output config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputConfigResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["output"],"summary":"Updates config.","description":"Reads from Postgres and returns a typed `OutputConfigResponse` payload (request\nbody: `UpdateOutputConfigRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_output_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOutputConfigRequest"}}},"required":true},"responses":{"200":{"description":"Update output config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputConfigResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/crane/stats":{"get":{"tags":["output"],"summary":"Returns crane stats.","description":"And returns a typed `GetCraneStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_crane_stats","responses":{"200":{"description":"Get crane stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCraneStatsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/decisions":{"get":{"tags":["admin-mc-routing-intelligence"],"summary":"Returns decisions.","description":"And returns a typed `Vec<DecisionSummary>` payload.\n\nRequires control-plane admin role.","operationId":"get_decisions","parameters":[{"name":"days","in":"query","description":"Lookback window in days. Defaults to 7. Server-clamped to `365`.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"tenant_id","in":"query","description":"Optional per-tenant filter (org UUID as string).\nRejected with `400` if longer than 64 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Optional model-slug filter.\nRejected with `400` if longer than 50 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Max rows returned by list endpoints (default 100, max 1000).","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Get decisions.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DecisionSummary"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope or role."}},"security":[{"bearer_auth":[]}]}},"/decisions/{request_id}":{"get":{"tags":["admin-mc-routing-intelligence"],"summary":"Returns decisions.","description":"And returns a typed `DecisionDetail` payload.\n\nRequires control-plane admin role.","operationId":"get_decision_detail","parameters":[{"name":"request_id","in":"path","description":"request_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get decision detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionDetail"}}}},"400":{"description":"Invalid request_id."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/degradation":{"get":{"tags":["observability"],"summary":"Returns degradation.","description":"And returns a typed `GetDegradationResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_degradation","responses":{"200":{"description":"Get degradation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetDegradationResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["observability"],"summary":"Updates degradation.","description":"And returns a typed `UpdateDegradationResponse` payload (request body:\n`DegradationUpdate`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_degradation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DegradationUpdate"}}},"required":true},"responses":{"200":{"description":"Update degradation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDegradationResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/diversity":{"get":{"tags":["admin-mc-routing-intelligence"],"summary":"Returns routing diversity / arm-collapse analysis over `barp_decisions`.","description":"Shannon entropy, per-model shares, and arm-collapse alarms per scope\n(fleet-wide plus per tenant), computed by\n`services::barp::diversity::compute_diversity`. Read-only reporting;\nalarm thresholds come from env (`XANTLY_BARP_ENTROPY_FLOOR_BITS`,\n`XANTLY_BARP_ARM_SHARE_CAP`, `XANTLY_BARP_DIVERSITY_MIN_DECISIONS`).\n\nRequires control-plane admin role.","operationId":"get_routing_diversity","parameters":[{"name":"days","in":"query","description":"Lookback window in days. Defaults to 7. Server-clamped to `365`.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"tenant_id","in":"query","description":"Optional per-tenant filter (org UUID as string).\nRejected with `400` if longer than 64 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Optional model-slug filter.\nRejected with `400` if longer than 50 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Max rows returned by list endpoints (default 100, max 1000).","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Routing diversity report.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingDiversityResponse"}}}},"400":{"description":"Bad request, validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden, caller lacks required scope or role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/drift":{"get":{"tags":["admin-mc-routing-intelligence"],"summary":"Returns drift.","description":"And returns a typed `DriftFeed` payload.\n\nRequires control-plane admin role.","operationId":"get_drift_feed","parameters":[{"name":"days","in":"query","description":"Lookback window in days. Defaults to 7. Server-clamped to `365`.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"tenant_id","in":"query","description":"Optional per-tenant filter (org UUID as string).\nRejected with `400` if longer than 64 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Optional model-slug filter.\nRejected with `400` if longer than 50 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Max rows returned by list endpoints (default 100, max 1000).","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Get drift feed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriftFeed"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope or role."}},"security":[{"bearer_auth":[]}]}},"/flags":{"get":{"tags":["observability"],"summary":"Returns flags.","description":"Reads from Postgres and returns a typed `GetFlagsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_flags","responses":{"200":{"description":"Get flags.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFlagsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/flags/{key}":{"put":{"tags":["observability"],"summary":"Replaces flags.","description":"Reads from Postgres and returns a typed `ToggleFlagResponse` payload (request\nbody: `serde_json::Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"toggle_flag","parameters":[{"name":"key","in":"path","description":"key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Toggle flag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleFlagResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/gate":{"get":{"tags":["admin-mc-routing-intelligence"],"summary":"Returns gate.","description":"And returns a typed `RegressionGateHistory` payload.\n\nRequires control-plane admin role.","operationId":"get_regression_gate_history","parameters":[{"name":"days","in":"query","description":"Lookback window in days. Defaults to 7. Server-clamped to `365`.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"tenant_id","in":"query","description":"Optional per-tenant filter (org UUID as string).\nRejected with `400` if longer than 64 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Optional model-slug filter.\nRejected with `400` if longer than 50 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Max rows returned by list endpoints (default 100, max 1000).","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Get regression gate history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegressionGateHistory"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope or role."}},"security":[{"bearer_auth":[]}]}},"/health":{"get":{"tags":["metrics"],"summary":"Returns health.","description":"And returns a typed `HealthResponse` payload.\n\nPublic — no authentication required.","operationId":"health","responses":{"200":{"description":"Health check endpoint (liveness probe)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"500":{"description":"Internal server error."}}}},"/hedging/config":{"post":{"tags":["observability"],"summary":"Updates hedging config.","description":"And returns a typed `UpdateHedgingConfigResponse` payload (request body:\n`HedgingConfigUpdate`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_hedging_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HedgingConfigUpdate"}}},"required":true},"responses":{"200":{"description":"Update hedging config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHedgingConfigResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/hedging/stats":{"get":{"tags":["observability"],"summary":"Returns hedging stats.","description":"And returns a typed `GetHedgingStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_hedging_stats","responses":{"200":{"description":"Get hedging stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetHedgingStatsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/history":{"get":{"tags":["observability"],"summary":"Returns history.","description":"And returns a typed `AlertHistoryResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_alert_history","parameters":[{"name":"alert_id","in":"query","description":"Filter to a single alert by id (UUID string).","required":false,"schema":{"type":"string","nullable":true}},{"name":"severity","in":"query","description":"Filter by severity.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of history events to return (default 100, hard-capped at 1000).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"Get alert history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertHistoryResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/login/begin":{"post":{"tags":["passkey"],"summary":"Begin passkey authentication ceremony (pre-login — no auth required).","description":"**User enumeration prevention**: If the email is not found or has no\npasskeys, we still return a valid-looking challenge using discoverable\ncredential authentication. The browser ceremony will fail silently\nbecause no matching credential exists, preventing attackers from probing\nwhich emails have accounts.","operationId":"login_begin","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginBeginRequest"}}},"required":true},"responses":{"200":{"description":"Begin passkey authentication ceremony (pre-login — no auth required). **User enumeration prevention**: If the email is not found or has no passkeys, we still return a valid-looking challenge using discoverable credential authentication. The browser ceremony will fail silently because no matching credential exists, preventing attackers from probing which emails have accounts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestChallengeResponse"}}}},"400":{"description":"Bad request — validation failed."},"500":{"description":"Internal server error."}}}},"/login/complete":{"post":{"tags":["passkey"],"summary":"Creates login complete.","description":"Reads from Postgres and returns a typed `LoginCompleteResponse` payload (request\nbody: `LoginCompleteRequest`).\n\nPublic — no authentication required. Mutating: writes a new row or replaces an\nexisting one.","operationId":"login_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginCompleteRequest"}}},"required":true},"responses":{"200":{"description":"Complete passkey authentication ceremony and create a browser session. On success, creates a session with AAL2 (passkey is inherently multi-factor). Passkey sessions receive **session-long sudo** — the AAL2 status persists for the entire session lifetime without requiring re-authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginCompleteResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}}}},"/matrix":{"get":{"tags":["admin-mc-routing-intelligence"],"summary":"Returns matrix.","description":"And returns a typed `CapabilityMatrixHealth` payload.\n\nRequires control-plane admin role.","operationId":"get_matrix_health","responses":{"200":{"description":"Get matrix health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityMatrixHealth"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope or role."}},"security":[{"bearer_auth":[]}]}},"/matrix/refresh":{"post":{"tags":["admin-mc-routing-intelligence"],"summary":"Triggers matrix refresh.","description":"And returns a typed `MatrixRefreshResponse` payload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"trigger_matrix_refresh","responses":{"200":{"description":"Trigger matrix refresh.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixRefreshResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope or role."},"500":{"description":"Matrix refresh failed; `ok=false` with `error_detail` populated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixRefreshResponse"}}}},"503":{"description":"A matrix refresh is already running; retry later."}},"security":[{"bearer_auth":[]}]}},"/metrics":{"get":{"tags":["metrics"],"summary":"Metrics endpoint handler","description":"Exports Prometheus metrics per Phase 1 spec.\nCombines the custom METRICS registry (gateway_*) with the global default\nregistry (where register_int_gauge!/register_counter! macros land).","operationId":"metrics","responses":{"200":{"description":"Metrics endpoint handler Exports Prometheus metrics per Phase 1 spec. Combines the custom METRICS registry (gateway_*) with the global default registry (where register_int_gauge!/register_counter! macros land).","content":{"text/plain; version=0.0.4":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error."}}}},"/metrics/summary":{"get":{"tags":["observability"],"summary":"Returns metrics summary.","description":"And returns a typed `GetMetricsSummaryResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_metrics_summary","responses":{"200":{"description":"Get metrics summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMetricsSummaryResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/metrics/swc":{"get":{"tags":["observability"],"summary":"Returns metrics swc.","description":"And returns a typed `GetMetricsSwcResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_metrics_swc","responses":{"200":{"description":"Specialized Workload Costs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMetricsSwcResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/next-step":{"get":{"tags":["onboarding-api"],"summary":"Returns next step.","description":"Reads from Postgres and returns a typed `NextStepRecommendation` payload.\n\nRequires a valid bearer token.","operationId":"get_next_step","responses":{"200":{"description":"Get next step.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NextStepRecommendation"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/policy":{"get":{"tags":["admin-mc-routing-intelligence"],"summary":"Returns policy.","description":"And returns a typed `PolicyComplianceStats` payload.\n\nRequires control-plane admin role.","operationId":"get_policy_compliance","parameters":[{"name":"days","in":"query","description":"Lookback window in days. Defaults to 7. Server-clamped to `365`.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"tenant_id","in":"query","description":"Optional per-tenant filter (org UUID as string).\nRejected with `400` if longer than 64 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Optional model-slug filter.\nRejected with `400` if longer than 50 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Max rows returned by list endpoints (default 100, max 1000).","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Get policy compliance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyComplianceStats"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope or role."}},"security":[{"bearer_auth":[]}]}},"/progress":{"get":{"tags":["onboarding-api"],"summary":"Returns progress.","description":"Reads from Postgres and returns a typed `OnboardingProgress` payload.\n\nRequires a valid bearer token.","operationId":"get_onboarding_progress","responses":{"200":{"description":"Get onboarding progress for tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingProgress"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["onboarding-api"],"summary":"Updates progress.","description":"Reads from Postgres and returns a typed `OnboardingProgress` payload (request\nbody: `UpdateProgressRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_onboarding_step","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProgressRequest"}}},"required":true},"responses":{"201":{"description":"Update onboarding step completion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingProgress"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/ready":{"get":{"tags":["metrics"],"summary":"Returns ready.","description":"Reads from Redis and returns a typed `ReadinessResponse` payload.\n\nPublic — no authentication required.\n\nThree states, because two could not describe what actually happened on\n2026-08-18: Qdrant OOM-crash-looped for 5 days 16 hours (21,817 kills) and\nthis endpoint reported \"ready\" for every second of it, because it only ever\nchecked Postgres and Redis. `/health` reported \"healthy\" too.\n\nready     - everything up.\ndegraded  - an OPTIONAL backend is down. Still HTTP 200 and `ready: true`,\nbecause the gateway genuinely serves traffic without it: every\nQdrant call site fails open (l2_memory.rs falls back to an\nin-memory map, cache.rs to a Redis hash). Returning 503 here\nwould pull the gateway out of the load balancer over a lost\ncache tier, converting a silent degradation into a real\noutage. The customer impact of `degraded` is billing and\nquality, not availability: semantic-cache and L2-memory hits\nsilently become misses, so requests that should have been\nserved from cache cost full provider price.\nnot_ready - a REQUIRED backend (Postgres, Redis) is down. HTTP 503.\n\n`ready` stays true when degraded so existing probes and load balancers keep\ntheir current behaviour; the new information is in `status` and in\n`dependencies.vector_db`. The alert that actually pages a human for this is\nQdrantDown in infrastructure/monitoring/alerts.yml. This endpoint makes the\nstate visible; it is not the notification mechanism.","operationId":"ready","responses":{"200":{"description":"Readiness probe - checks database, Redis and Qdrant connectivity. Status is ready, degraded (optional backend down, still serving) or not_ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessResponse"}}}},"503":{"description":"Service unavailable."}}}},"/register/begin":{"post":{"tags":["passkey"],"summary":"Begin passkey registration ceremony.","description":"Requires an authenticated session. Enforces the 10-passkey-per-user limit.\nReturns a `CreationChallengeResponse` for the browser WebAuthn API.","operationId":"register_begin","responses":{"200":{"description":"Begin passkey registration ceremony. Requires an authenticated session. Enforces the 10-passkey-per-user limit. Returns a `CreationChallengeResponse` for the browser WebAuthn API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreationChallengeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/register/complete":{"post":{"tags":["passkey"],"summary":"Complete passkey registration ceremony.","description":"Validates the browser attestation, checks credential_id uniqueness across\nall users, and persists the new passkey.","operationId":"register_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterCompleteRequest"}}},"required":true},"responses":{"200":{"description":"Complete passkey registration ceremony. Validates the browser attestation, checks credential_id uniqueness across all users, and persists the new passkey.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyInfo"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/repair_json":{"post":{"tags":["utils"],"summary":"Creates repair_json.","description":"And returns a typed `RepairJsonResponse` payload (request body:\n`RepairJsonRequest`).\n\nPublic — no authentication required. Pure compute: attempts to parse JSON, no\nDB writes.","operationId":"repair_json","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepairJsonRequest"}}},"required":true},"responses":{"200":{"description":"Repair broken JSON (utility)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepairJsonResponse"}}}},"400":{"description":"Bad request — validation failed."}}}},"/routing":{"get":{"tags":["observability"],"summary":"Returns routing.","description":"And returns a typed `DebugRoutingResponse` payload.\n\nRequires a valid bearer token.","operationId":"debug_routing","responses":{"200":{"description":"Debug routing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebugRoutingResponse"}}}},"401":{"description":"Unauthenticated."},"501":{"description":"Route introspection not yet implemented."}},"security":[{"bearer_auth":[]}]}},"/sdk/bypass/tokens":{"get":{"tags":["observability"],"summary":"Returns sdk bypass tokens.","description":"And returns a typed `GetBypassTokensResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_bypass_tokens","responses":{"200":{"description":"List valid bypass tokens SECURITY: Restricted to control-plane admins only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBypassTokensResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/settings":{"get":{"tags":["notifications"],"summary":"Returns settings.","description":"Reads from Postgres and returns a typed `NotificationSettingsPayload` payload.\n\nRequires a valid bearer token.","operationId":"get_settings","responses":{"200":{"description":"Get settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsPayload"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["notifications"],"summary":"Updates settings.","description":"Reads from Postgres and returns a typed `NotificationSettingsPayload` payload\n(request body: `NotificationSettingsPayload`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsPayload"}}},"required":true},"responses":{"200":{"description":"Update settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationSettingsPayload"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/shadow":{"get":{"tags":["admin-mc-routing-intelligence"],"summary":"Returns shadow.","description":"And returns a typed `ShadowStats` payload.\n\nRequires control-plane admin role.","operationId":"get_shadow_stats","parameters":[{"name":"days","in":"query","description":"Lookback window in days. Defaults to 7. Server-clamped to `365`.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"tenant_id","in":"query","description":"Optional per-tenant filter (org UUID as string).\nRejected with `400` if longer than 64 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Optional model-slug filter.\nRejected with `400` if longer than 50 characters.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Max rows returned by list endpoints (default 100, max 1000).","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"description":"Get shadow stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShadowStats"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope or role."}},"security":[{"bearer_auth":[]}]}},"/system/health":{"get":{"tags":["observability"],"summary":"Returns system health.","description":"Joins Postgres and Redis state via the config service and returns a typed\n`GetSystemHealthResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_system_health","responses":{"200":{"description":"Get system health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSystemHealthResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/tokenize":{"post":{"tags":["observability"],"summary":"Creates tokenize.","description":"And returns a typed `TokenizeResponse` payload (request body:\n`serde_json::Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"tokenize","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Tokenize.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenizeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/budget-burn":{"get":{"tags":["admin-analytics"],"summary":"Returns admin analytics budget burn.","description":"Reads from Postgres and returns a typed `Vec<BudgetBurnRow>` payload.\n\nThe `days` lookback window defaults to `30` for this endpoint.\n\nRequires control-plane admin role.","operationId":"get_budget_burn_rate","parameters":[{"name":"days","in":"query","description":"Lookback window in days. The default is per-endpoint (see each handler's\ndescription); values are clamped to the range `1..=365`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"group_by_provider","in":"query","description":"Group by provider.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"group_by_routing_tier_used","in":"query","description":"Group by routing tier used.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"group_by_routing_recommended_tier","in":"query","description":"Group by routing recommended tier.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}}],"responses":{"200":{"description":"Get budget burn rate.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BudgetBurnRow"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/cost-breakdown":{"get":{"tags":["admin-mcp"],"summary":"Returns admin analytics cost breakdown.","description":"Reads from Postgres and returns a typed `CostBreakdownResponse` payload.\n\nRequires control-plane admin role.","operationId":"cost_breakdown_handler","parameters":[{"name":"window","in":"query","description":"Time window (e.g. '1h', '24h', '7d').","required":true,"schema":{"type":"string"}},{"name":"dimension","in":"query","description":"Dimension.\nDefaults to `\"model\"`.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Cost breakdown handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostBreakdownResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/product-metrics":{"get":{"tags":["admin-product-analytics"],"summary":"Returns admin analytics product metrics.","description":"Reads from Postgres and returns a typed `ProductMetricsResponse` payload.\n\nRequires control-plane admin role.","operationId":"product_metrics","parameters":[{"name":"days","in":"query","description":"Days.\nDefaults to `30`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Product metrics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductMetricsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/providers":{"get":{"tags":["admin-analytics"],"summary":"Returns admin analytics providers.","description":"Reads from Postgres and returns a typed `Vec<ProviderHealth>` payload.\n\nRequires control-plane admin role.","operationId":"admin_analytics_providers_get_provider_health","responses":{"200":{"description":"Provider health (admin only)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProviderHealth"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/routing-confidence":{"get":{"tags":["admin-analytics"],"summary":"Returns admin analytics routing confidence.","description":"Reads from Postgres and returns a typed `Vec<ConfidenceBin>` payload.\n\nThe `days` lookback window defaults to `7` for this endpoint.\n\nRequires control-plane admin role.","operationId":"get_routing_confidence","parameters":[{"name":"days","in":"query","description":"Lookback window in days. The default is per-endpoint (see each handler's\ndescription); values are clamped to the range `1..=365`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"group_by_provider","in":"query","description":"Group by provider.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"group_by_routing_tier_used","in":"query","description":"Group by routing tier used.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"group_by_routing_recommended_tier","in":"query","description":"Group by routing recommended tier.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}}],"responses":{"200":{"description":"Get routing confidence.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ConfidenceBin"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/savings":{"get":{"tags":["admin-analytics"],"summary":"Returns admin analytics savings.","description":"Reads from Postgres and returns a typed `Vec<SavingsReport>` payload.\n\nRequires control-plane admin role.","operationId":"get_savings_report","responses":{"200":{"description":"Monthly savings report (admin only)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SavingsReport"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/summary":{"get":{"tags":["admin-analytics"],"summary":"Returns admin analytics summary.","description":"Reads from Postgres and returns a typed `DashboardSummary` payload.\n\nRequires control-plane admin role.","operationId":"get_dashboard_summary","responses":{"200":{"description":"Get dashboard summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardSummary"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/tiers":{"get":{"tags":["admin-analytics"],"summary":"Returns admin analytics tiers.","description":"Reads from Postgres and returns a typed `Vec<TierDistribution>` payload.\n\nRequires control-plane admin role.","operationId":"get_tier_distribution","responses":{"200":{"description":"Tier distribution (admin only)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TierDistribution"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/top-tenants":{"get":{"tags":["admin-analytics"],"summary":"Returns admin analytics top tenants.","description":"Reads from Postgres and returns a typed `Vec<TopTenant>` payload.\n\nRequires control-plane admin role.","operationId":"get_top_tenants","responses":{"200":{"description":"Top tenants by cost (admin only)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TopTenant"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/usage":{"get":{"tags":["admin-analytics"],"summary":"Returns admin analytics usage.","description":"Reads from Postgres and returns a typed `Vec<UsageSummary>` payload.\n\nThe `days` lookback window defaults to `30` for this endpoint.\n\nRequires control-plane admin role.","operationId":"admin_analytics_get_usage_summary","parameters":[{"name":"days","in":"query","description":"Lookback window in days. The default is per-endpoint (see each handler's\ndescription); values are clamped to the range `1..=365`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"group_by_provider","in":"query","description":"Group by provider.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"group_by_routing_tier_used","in":"query","description":"Group by routing tier used.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"group_by_routing_recommended_tier","in":"query","description":"Group by routing recommended tier.\nDefaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true}}],"responses":{"200":{"description":"Usage summary (admin only)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UsageSummary"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/analytics/user-activity":{"get":{"tags":["admin-product-analytics"],"summary":"Returns admin analytics user activity.","description":"Reads from Postgres and returns a typed `UserActivityResponse` payload.\n\nRequires control-plane admin role.","operationId":"user_activity","parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `20`.\nServer-clamped into the `[1, 100]` range.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"maximum":100,"minimum":1}}],"responses":{"200":{"description":"User activity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserActivityResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/audit/logs":{"get":{"tags":["admin"],"summary":"Returns admin audit logs.","description":"And returns a typed `GetAuditLogsAliasResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_audit_logs_alias","responses":{"200":{"description":"GET /v1/admin/audit/logs (Alias)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAuditLogsAliasResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/alerts":{"get":{"tags":["admin-barp"],"summary":"Returns admin barp alerts.","description":"And returns a typed `Vec<DriftAlertResponse>` payload. Only arms with at\nleast one recorded observation are returned, mirroring the\n`request_count > 0` filter on `/v1/admin/barp/models`.\n\nRequires control-plane admin role.","operationId":"get_alerts","parameters":[{"name":"range","in":"query","description":"Time range: \"1h\", \"6h\", \"24h\", \"7d\", \"30d\"","required":false,"schema":{"type":"string","nullable":true}},{"name":"tenant_id","in":"query","description":"Tenant UUID filter (admin can view any tenant). When supplied it must be\na valid UUID. On read endpoints, omitting it defaults to the caller's own\norganization; on mutation endpoints it is required (omitting it is a 400).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get alerts.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DriftAlertResponse"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/features":{"get":{"tags":["admin-barp"],"summary":"Returns admin barp features.","description":"And returns a typed `FeatureAnalysisResponse` payload.\n\nRequires control-plane admin role.","operationId":"get_features","responses":{"200":{"description":"Get features.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureAnalysisResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/learning":{"get":{"tags":["admin-barp"],"summary":"Returns admin barp learning.","description":"And returns a typed `Option<LearningDynamicsResponse>` payload.\n\nRequires control-plane admin role.","operationId":"get_learning_dynamics","parameters":[{"name":"range","in":"query","description":"Time range: \"1h\", \"6h\", \"24h\", \"7d\", \"30d\"","required":false,"schema":{"type":"string","nullable":true}},{"name":"tenant_id","in":"query","description":"Tenant UUID filter (admin can view any tenant). When supplied it must be\na valid UUID. On read endpoints, omitting it defaults to the caller's own\norganization; on mutation endpoints it is required (omitting it is a 400).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get learning dynamics.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/LearningDynamicsResponse"}],"nullable":true}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/models":{"get":{"tags":["admin-barp"],"summary":"Returns admin barp models.","description":"And returns a typed `Vec<ModelPerfResponse>` payload.\n\nRequires control-plane admin role.","operationId":"get_models_perf","parameters":[{"name":"range","in":"query","description":"Time range: \"1h\", \"6h\", \"24h\", \"7d\", \"30d\"","required":false,"schema":{"type":"string","nullable":true}},{"name":"tenant_id","in":"query","description":"Tenant UUID filter (admin can view any tenant). When supplied it must be\na valid UUID. On read endpoints, omitting it defaults to the caller's own\norganization; on mutation endpoints it is required (omitting it is a 400).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get models perf.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelPerfResponse"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/models/{model_id}/history":{"get":{"tags":["admin-barp"],"summary":"Returns admin barp models history.","description":"And returns a typed `GetModelHistoryResponse` payload.\n\nRequires control-plane admin role.","operationId":"get_model_history","parameters":[{"name":"model_id","in":"path","description":"model_id","required":true,"schema":{"type":"string"}},{"name":"range","in":"query","description":"Time range: \"1h\", \"6h\", \"24h\", \"7d\", \"30d\"","required":false,"schema":{"type":"string","nullable":true}},{"name":"tenant_id","in":"query","description":"Tenant UUID filter (admin can view any tenant). When supplied it must be\na valid UUID. On read endpoints, omitting it defaults to the caller's own\norganization; on mutation endpoints it is required (omitting it is a 400).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get model history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetModelHistoryResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/overview":{"get":{"tags":["admin-barp"],"summary":"Returns admin barp overview.","description":"And returns a typed `BarpOverviewResponse` payload.\n\nRequires control-plane admin role.","operationId":"get_overview","responses":{"200":{"description":"Get overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BarpOverviewResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/preference-dial":{"get":{"tags":["admin-mcp"],"summary":"Returns the current BaRP preference dial state.","description":"Read-side counterpart of the PUT below (which was previously the ONLY\nregistered method, so the dashboard's read hook always got 405). Same\ncontrol-plane admin gate; `MCPRead` instead of `MCPWrite`, matching every\nother GET in this module. Closes audit ticket #249.","operationId":"get_preference_dial_handler","parameters":[{"name":"tenant_id","in":"query","description":"Tenant whose dial to read. Defaults to the caller's organization id,\nwhich is what the dashboard's read hook (no params) expects.","required":false,"schema":{"type":"string","nullable":true},"example":"550e8400-e29b-41d4-a716-446655440000"}],"responses":{"200":{"description":"Current preference dial state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferenceDialStateResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["admin-mcp"],"summary":"Replaces admin barp preference dial.","description":"And returns a typed `PreferenceDialResponse` payload (request body:\n`PreferenceDialRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"preference_dial_handler","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferenceDialRequest"}}},"required":true},"responses":{"200":{"description":"Preference dial handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferenceDialResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/reset-all":{"post":{"tags":["admin-barp"],"summary":"Triggers admin barp reset all.","description":"Requires control-plane admin role. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"reset_all_weights","parameters":[{"name":"tenant_id","in":"query","description":"Tenant UUID to reset. Required and must be a valid UUID — omitting it is\na 400 (never falls back to a sentinel \"default\" tenant).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"201":{"description":"Reset all weights."},"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/reset-model/{model_id}":{"post":{"tags":["admin-barp"],"summary":"Triggers admin barp reset model.","description":"Requires control-plane admin role. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"reset_model_weights","parameters":[{"name":"model_id","in":"path","description":"model_id","required":true,"schema":{"type":"string"}},{"name":"tenant_id","in":"query","description":"Tenant UUID to reset. Required and must be a valid UUID — omitting it is\na 400 (never falls back to a sentinel \"default\" tenant).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"201":{"description":"Reset model weights."},"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/tenant":{"get":{"tags":["admin-barp"],"summary":"Returns admin barp tenant.","description":"And returns a typed `Option<TenantBarpStatus>` payload.\n\nRequires control-plane admin role.","operationId":"get_tenant_status","parameters":[{"name":"range","in":"query","description":"Time range: \"1h\", \"6h\", \"24h\", \"7d\", \"30d\"","required":false,"schema":{"type":"string","nullable":true}},{"name":"tenant_id","in":"query","description":"Tenant UUID filter (admin can view any tenant). When supplied it must be\na valid UUID. On read endpoints, omitting it defaults to the caller's own\norganization; on mutation endpoints it is required (omitting it is a 400).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get tenant status.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TenantBarpStatus"}],"nullable":true}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/barp/tenants/{tenant_id}/dynamics":{"get":{"tags":["admin-mcp"],"summary":"`GET /v1/admin/barp/tenants/:tenant_id/dynamics`","description":"Per-tenant BaRP weights summary. The MCP `barp_weights` tool calls\nthis. We return a compact summary derived from the same Redis\n`barp:weights:{tenant_id}` key the production routing reads.","operationId":"barp_tenant_dynamics_handler","parameters":[{"name":"tenant_id","in":"path","description":"tenant_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"`GET /v1/admin/barp/tenants/:tenant_id/dynamics` Per-tenant BaRP weights summary. The MCP `barp_weights` tool calls this. We return a compact summary derived from the same Redis `barp:weights:{tenant_id}` key the production routing reads.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BarpTenantDynamicsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/billing/budget-alerts":{"get":{"tags":["admin-billing"],"summary":"Returns admin budget alerts.","description":"Reads from Postgres and returns a typed `GetBudgetAlertsResponse` payload.\n\nRequires control-plane admin role.","operationId":"get_budget_alerts","responses":{"200":{"description":"Unacknowledged budget alerts across all orgs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBudgetAlertsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/billing/budget-alerts/{id}/acknowledge":{"patch":{"tags":["admin-billing"],"summary":"Updates admin budget alerts acknowledge.","description":"Reads from Postgres and returns a typed `AcknowledgeBudgetAlertResponse`\npayload.\n\nRequires control-plane admin role. Mutating: partial update — only the supplied\nfields are applied.","operationId":"acknowledge_budget_alert","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Mark alert as handled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcknowledgeBudgetAlertResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/billing/plans":{"get":{"tags":["admin-billing"],"summary":"Returns admin plans.","description":"And returns a typed `GetPlansAdminResponse` payload.\n\nRequires control-plane admin role.","operationId":"get_plans_admin","responses":{"200":{"description":"Read-only view of all plan configurations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPlansAdminResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/billing/promotions":{"get":{"tags":["admin-billing"],"summary":"Lists admin promotions.","description":"Reads from Postgres and returns a typed `ListPromotionsResponse` payload.\n\nRequires control-plane admin role.","operationId":"list_promotions","responses":{"200":{"description":"List active + upcoming promos","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPromotionsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-billing"],"summary":"Creates admin promotions.","description":"Reads from Postgres and returns a typed `CreatePromotionResponse` payload\n(request body: `CreatePromoRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_promotion","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromoRequest"}}},"required":true},"responses":{"200":{"description":"Create plan-wide promo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromotionResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/billing/promotions/{id}":{"delete":{"tags":["admin-billing"],"summary":"Deletes admin promotions.","description":"Reads from Postgres and returns a typed `DeletePromotionResponse` payload.\n\nRequires control-plane admin role. Mutating: the resource is removed (or marked\ndeleted) on success.","operationId":"delete_promotion","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Cancel promo early","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePromotionResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["admin-billing"],"summary":"Updates admin promotions.","description":"Reads from Postgres and returns a typed `UpdatePromotionResponse` payload\n(request body: `serde_json::Value`).\n\nRequires control-plane admin role. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_promotion","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Update promo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePromotionResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/billing/stripe-health":{"get":{"tags":["admin-billing"],"summary":"Returns admin stripe health.","description":"And returns a typed `StripeHealthResponse` payload.\n\nRequires control-plane admin role.","operationId":"get_stripe_health","responses":{"200":{"description":"Get stripe health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeHealthResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/budgets":{"get":{"tags":["admin-budgets"],"summary":"Lists admin budgets.","description":"And returns a typed `BudgetOverviewResponse` payload.\n\nRequires control-plane admin role.","operationId":"admin_list_budgets","responses":{"200":{"description":"List budgets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetOverviewResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/budgets/alerts/test":{"post":{"tags":["admin-budgets"],"summary":"Creates admin budgets alerts test.","description":"Reads from Postgres via the audit_service service and returns a typed\n`TestBudgetAlertResponse` payload (request body: `TestBudgetAlertRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"test_budget_alert","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestBudgetAlertRequest"}}},"required":true},"responses":{"200":{"description":"Test budget alert.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestBudgetAlertResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/budgets/current":{"get":{"tags":["admin-mcp"],"summary":"`GET /v1/admin/budgets/current`","description":"Caller's organization budget snapshot. MCP `budget_status` calls\nthis. Returns budget caps + current spend rolled up from the\nauthenticated key's organization.","operationId":"budget_current_handler","responses":{"200":{"description":"`GET /v1/admin/budgets/current` Caller's organization budget snapshot. MCP `budget_status` calls this. Returns budget caps + current spend rolled up from the authenticated key's organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetCurrentResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/budgets/organization/{tenant_id}":{"put":{"tags":["admin-budgets"],"summary":"Replaces admin budgets organization.","description":"Reads from Postgres via the audit_service service and returns a typed\n`BudgetCapResponse` payload (request body: `UpsertBudgetCapRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"upsert_organization_budget","parameters":[{"name":"tenant_id","in":"path","description":"Guard for the caller's own organization: must be the authenticated org UUID or the literal `current`. Cross-tenant writes are not supported; the budget is always written to the authenticated org.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertBudgetCapRequest"}}},"required":true},"responses":{"200":{"description":"Upsert organization budget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetCapResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/budgets/{entity_type}/{entity_id}":{"get":{"tags":["admin-budgets"],"summary":"Returns admin budgets.","description":"Reads from Postgres. The response is one of two shapes discriminated by\n`scope_type`:\n- `organization` → `GetBudgetStatusResponse2` (`{scope_type, scope_id, caps}`)\n- `api_key`       → `{scope_type, scope_id, budget}`\n\nThe runtime type stays `serde_json::Value`; both documented shapes share the\n`scope_type`/`scope_id` discriminator so clients can branch safely. The wire\nshapes are unchanged — only the documentation is made accurate here.\n(Closes audit P1 be-admin_budgets-10 — doc-only; unifying the two shapes\ninto a single tagged enum would change the wire contract and is deferred.)\n\nRequires control-plane admin role.","operationId":"get_budget_status","parameters":[{"name":"entity_type","in":"path","description":"Budget scope: `organization` or `api-key`/`api_key`.","required":true,"schema":{"type":"string"}},{"name":"entity_id","in":"path","description":"For `organization`: the caller's organization UUID, or the literal `current` to target the authenticated org. For `api-key`/`api_key`: the API key UUID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get budget status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBudgetStatusResponse2"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/cache/inspect":{"get":{"tags":["admin-mcp"],"summary":"Returns admin cache inspect.","description":"Reads from Redis and returns a typed `CacheInspectResponse` payload.\n\nRequires control-plane admin role.","operationId":"cache_inspect_handler","parameters":[{"name":"pattern","in":"query","description":"Pattern.\nDefaults to `\"\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"fingerprint","in":"query","description":"Fingerprint.\nDefaults to `\"\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"layer","in":"query","description":"Layer.\nDefaults to `\"all\"`.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Cache inspect handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheInspectResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/cache/invalidate":{"post":{"tags":["admin-cache"],"summary":"Invalidates cached inference responses.","description":"Scans Redis for keys matching the supplied pattern and returns a typed\n`CacheInvalidateResponse` payload (request body: `CacheInvalidateRequest`).\n\nRequires control-plane admin role. Mutating: deletes Redis keys matching pattern.","operationId":"admin_invalidate_cache","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheInvalidateRequest"}}},"required":true},"responses":{"200":{"description":"Bulk-deletes Redis keys matching the supplied pattern.  Defaults to `cache:inference:*`.  Also mounted at `/cache/purge` for compatibility.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheInvalidateResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/cache/purge":{"post":{"tags":["admin-cache"],"summary":"Compatibility alias for `POST /v1/admin/cache/invalidate`.","description":"Behaves identically to `invalidate_cache` (same request body, same typed\nresponse, same validation/audit). Kept because the frontend's `usePurgeCache`\nhook posts to `/v1/admin/cache/purge`.","operationId":"admin_purge_cache","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheInvalidateRequest"}}},"required":true},"responses":{"200":{"description":"Compatibility alias for `/v1/admin/cache/invalidate`. Bulk-deletes Redis keys matching the supplied pattern. Defaults to `cache:inference:*`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheInvalidateResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/cache/stats":{"get":{"tags":["admin-cache"],"summary":"Returns admin cache stats.","description":"Reads from Redis and returns a typed `CacheStatsResponse` payload.\n\nRequires control-plane admin role.","operationId":"admin_get_cache_stats","responses":{"200":{"description":"Get cache stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheStatsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/constrained-decoding/config":{"get":{"tags":["constrained"],"summary":"Returns admin constrained decoding config.","description":"Via the constrained_decoding_service service and returns a typed\n`ConstrainedDecodingConfigResponse` payload.\n\nRequires a valid bearer token.","operationId":"admin_constrained_decoding_get_config","responses":{"200":{"description":"Get config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstrainedDecodingConfigResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["constrained"],"summary":"Updates admin constrained decoding config.","description":"(request body: `UpdateConstrainedConfigRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"admin_constrained_decoding_update_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConstrainedConfigRequest"}}},"required":true},"responses":{"204":{"description":"Update config."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/constrained-decoding/grammars":{"get":{"tags":["constrained"],"summary":"Lists admin constrained decoding grammars.","description":"Via the constrained_decoding_service service and returns a typed\n`GrammarListResponse` payload. The result set is paginated via the optional\n`limit` (default 100, max 500) and `offset` query parameters.\n\nRequires a valid bearer token.","operationId":"list_grammars","parameters":[{"name":"limit","in":"query","description":"Maximum number of grammars to return (default 100, max 500).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"offset","in":"query","description":"Number of grammars to skip (pagination).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List grammars.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrammarListResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["constrained"],"summary":"Creates admin constrained decoding grammars.","description":"And returns a typed `CompileGrammarResponse` payload (request body:\n`CompileGrammarRequest`).\n\nRequires a valid bearer token. Mutating: each call inserts a new grammar row\nkeyed by a freshly generated id; it does not deduplicate, so a retried POST\nproduces a distinct row. The service performs a plain insert with no\n`ON CONFLICT`/upsert path, so it never replaces an existing row — `201` is\ntherefore always the correct status. Callers that need at-most-once semantics\nshould treat the returned `grammar_id` as the canonical handle.\nCloses audit P2 be-constrained-8.","operationId":"compile_grammar","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompileGrammarRequest"}}},"required":true},"responses":{"201":{"description":"Compile grammar.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompileGrammarResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/constrained-decoding/grammars/{grammar_id}":{"delete":{"tags":["constrained"],"summary":"Deletes admin constrained decoding grammars.","description":"Requires a control-plane admin bearer token. Idempotent on the resource\nlifecycle: re-issuing the call after the first success is a no-op.","operationId":"delete_grammar","parameters":[{"name":"grammar_id","in":"path","description":"Path parameter.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"403":{"description":"Caller is not a control-plane admin."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/create-session":{"post":{"tags":["admin-billing"],"summary":"Creates admin create session.","description":"Via the config service and returns a typed `CheckoutResponse` payload (request\nbody: `CheckoutRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_checkout_session","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Create checkout session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/credentials":{"get":{"tags":["admin-credentials"],"summary":"Lists admin credentials.","description":"Reads from Postgres and returns a typed `ListCredentialsResponse` payload.\n\nRequires control-plane admin role.","operationId":"list_credentials","responses":{"200":{"description":"List credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCredentialsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-credentials"],"summary":"Creates admin credentials.","description":"Reads from Postgres via the audit_service, encryption_service service and\nreturns a typed `CreateCredentialResponse` payload (request body:\n`CreateCredentialRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_credential","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCredentialRequest"}}},"required":true},"responses":{"201":{"description":"Create credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCredentialResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/credentials/by-provider/{provider}/rotate":{"post":{"tags":["admin-mcp"],"summary":"Rotates admin credentials by provider rotate.","description":"Reads from Postgres and returns a typed `RotateKeyResponse` payload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"rotate_key_by_provider_handler","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rotate key by provider handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateKeyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/credentials/{id}":{"delete":{"tags":["admin-credentials"],"summary":"Deletes admin credentials.","description":"Reads from Postgres via the audit_service service.\n\nRequires control-plane admin role. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"revoke_credential","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Revoke credential."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/credentials/{id}/rotate":{"post":{"tags":["admin-credentials"],"summary":"Rotates admin credentials rotate.","description":"Reads from Postgres via the audit_service, encryption_service service and\nreturns a typed `RotateCredentialResponse` payload (request body:\n`CreateCredentialRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"rotate_credential","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCredentialRequest"}}},"required":true},"responses":{"200":{"description":"Rotate credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateCredentialResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/credentials/{id}/test":{"post":{"tags":["admin-credentials"],"summary":"Creates admin credentials test.","description":"Reads from Postgres via the audit_service service and returns a typed\n`TestCredentialResponse` payload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"test_credential","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Test credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCredentialResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/edge/config":{"get":{"tags":["admin"],"summary":"Returns admin edge config.","description":"And returns a typed `GetEdgeConfigResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_edge_config","responses":{"200":{"description":"Get edge config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetEdgeConfigResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/edge/geo":{"put":{"tags":["admin"],"summary":"Replaces admin edge geo.","description":"And returns a typed `PutEdgeGeoResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"put_edge_geo","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Put edge geo.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutEdgeGeoResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/edge/waf":{"put":{"tags":["admin"],"summary":"Replaces admin edge waf.","description":"And returns a typed `PutEdgeWafResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"put_edge_waf","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Put edge waf.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutEdgeWafResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints":{"get":{"tags":["admin-endpoints"],"summary":"Lists admin endpoints.","description":"And returns a typed `ListResponse` payload.\n\nRequires control-plane admin role.","operationId":"list_endpoints","parameters":[{"name":"include_deprecated","in":"query","description":"Include deprecated.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"only_probe_safe","in":"query","description":"Only probe safe.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"method","in":"query","description":"Filter by HTTP method.","required":false,"schema":{"type":"string","nullable":true}},{"name":"owner","in":"query","description":"Owner.","required":false,"schema":{"type":"string","nullable":true}},{"name":"path_contains","in":"query","description":"Path contains.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"offset","in":"query","description":"Number of items to skip (pagination).","required":false,"schema":{"type":"integer","format":"int64","nullable":true}}],"responses":{"200":{"description":"List endpoints.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/digest":{"get":{"tags":["admin-endpoints"],"summary":"Returns the weekly risk-ranked digest of endpoints.  Consumed by the","description":"weekly_digest GitHub Action to open a sticky issue listing high-traffic\nendpoints with failing or missing tests.","operationId":"get_digest","responses":{"200":{"description":"Risk-ranked digest payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigestResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks control-plane-admin role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/frontend-callers":{"post":{"tags":["admin-endpoints"],"summary":"Creates admin endpoints frontend callers.","description":"And returns a typed `FrontendCallersReport` payload (request body:\n`FrontendCallersPayload`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"ingest_frontend_callers","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrontendCallersPayload"}}},"required":true},"responses":{"200":{"description":"Ingest frontend callers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrontendCallersReport"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/scorecard/summary":{"get":{"tags":["admin-endpoints"],"summary":"Returns admin endpoints scorecard summary.","description":"And returns a typed `ScorecardSummary` payload.\n\nRequires control-plane admin role.","operationId":"get_scorecard_summary","responses":{"200":{"description":"Get scorecard summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScorecardSummary"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/summary":{"get":{"tags":["admin-endpoints"],"summary":"Returns admin endpoints summary.","description":"And returns a typed `RegistrySummary` payload.\n\nRequires control-plane admin role.","operationId":"admin_endpoints_get_summary","responses":{"200":{"description":"Get summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrySummary"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/sync":{"post":{"tags":["admin-endpoints"],"summary":"Creates admin endpoints sync.","description":"And returns a typed `SyncReport` payload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"force_sync","responses":{"200":{"description":"Force sync.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncReport"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/{id}":{"get":{"tags":["admin-endpoints"],"summary":"Returns admin endpoints.","description":"And returns a typed `EndpointDetail` payload.\n\nRequires control-plane admin role.","operationId":"get_detail","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointDetail"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/{id}/consumers":{"get":{"tags":["admin-endpoints"],"summary":"Returns the top consumers of this endpoint.","description":"`frontend_callers` lists pages in X-Website that issue requests against\nthis endpoint (sourced from the `sync_endpoint_callers.yml` scan).\n`api_key_callers` lists API key prefixes with the highest 24h request\nvolume (sourced from the runtime tracker's per-request log).","operationId":"get_consumers","parameters":[{"name":"id","in":"path","description":"URL-encoded `METHOD PATH` endpoint id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Top consumers split by caller kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumersResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks control-plane-admin role."},"404":{"description":"Endpoint not in the registry."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/{id}/dependencies":{"get":{"tags":["admin-endpoints"],"summary":"Returns the dependency graph anchored at this endpoint.","description":"The graph contains:\n- This endpoint as the central node.\n- One node per infrastructure dependency (postgres, redis, llm-providers, etc.)\ninferred from `use crate::services::*` imports at build time.\n- Edges from this endpoint outward to every dependency.  Runtime-discovered\nOTel span-derived deps are tagged `source_kind = \"runtime\"` so the UI can\ndistinguish them.","operationId":"get_dependencies","parameters":[{"name":"id","in":"path","description":"URL-encoded `METHOD PATH` endpoint id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Dependency graph for the Cytoscape panel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DependencyGraph"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks control-plane-admin role."},"404":{"description":"Endpoint not in the registry."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/{id}/slo":{"get":{"tags":["admin-endpoints"],"summary":"Returns the SLO error-budget status for this endpoint.","description":"Targets follow Google SRE Workbook: 99.5% availability over a rolling 28-day\nwindow unless overridden in `endpoint_slos`.  Burn-rate alerts when 1h burn\n> 14.4× (page) or 6h burn > 6× (ticket).  Status traffic-light maps to:\n\n- `ok`       — burn_rate_1h < 1 AND remaining_budget_pct > 0\n- `warn`     — 1 ≤ burn_rate_1h < 14.4 OR remaining_budget_pct < 0\n- `critical` — burn_rate_1h >= 14.4 OR remaining_budget_pct <= -0.5","operationId":"get_slo","parameters":[{"name":"id","in":"path","description":"URL-encoded `METHOD PATH` endpoint id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"SLO error-budget status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SloStatus"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks control-plane-admin role."},"404":{"description":"Endpoint not in the registry."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["admin-endpoints"],"summary":"Upserts the SLO override for this endpoint.  Reading back via","description":"`GET /v1/admin/endpoints/{id}/slo` will reflect the new target on the\nnext computation tick (immediately, since `compute_slo` reads the\nrow each call).","operationId":"put_slo","parameters":[{"name":"id","in":"path","description":"URL-encoded `METHOD PATH` endpoint id.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SloOverrideRequest"}}},"required":true},"responses":{"200":{"description":"Updated SLO target; returns the recomputed status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SloStatus"}}}},"400":{"description":"target_pct outside (0.5, 1.0) or window_days outside [1, 90]."},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks control-plane-admin role."},"404":{"description":"Endpoint not in the registry."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/{id}/test-result":{"post":{"tags":["admin-endpoints"],"summary":"Creates admin endpoints test result.","description":"And returns a typed `RecordTestResultResponse` payload (request body:\n`TestResultPayload`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"record_test_result","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResultPayload"}}},"required":true},"responses":{"200":{"description":"Record test result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordTestResultResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/endpoints/{id}/timeseries":{"get":{"tags":["admin-endpoints"],"summary":"Returns bucketed health time series for the latency / traffic / error","description":"charts on the endpoint detail page.\n\nServer-side down-samples by averaging into `bucket_seconds`-wide buckets so\nthe response stays under a few KB even for a 30-day window.","operationId":"get_timeseries","parameters":[{"name":"id","in":"path","description":"URL-encoded `METHOD PATH` endpoint id.","required":true,"schema":{"type":"string"}},{"name":"window","in":"query","description":"Window size: `1h` | `24h` | `7d` | `30d`.  Defaults to `24h`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"bucket_seconds","in":"query","description":"Bucket size in seconds.  Defaults to 60 (one-minute buckets).\nAggregator already writes 60s buckets; this parameter lets the UI\ndown-sample wider windows server-side so the chart payload stays small.\nDefaults to `60`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}}],"responses":{"200":{"description":"Bucketed health time series.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeseriesResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks control-plane-admin role."},"404":{"description":"Endpoint not in the registry."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/functionality/refresh":{"post":{"tags":["admin-functionality-health"],"summary":"Creates admin functionality refresh.","description":"Via the functionality_health_snapshot service and returns a typed\n`HealthSnapshot` payload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"refresh_now","responses":{"200":{"description":"Refresh now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthSnapshot"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"429":{"description":"Rate-limited."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/functionality/status":{"get":{"tags":["admin-functionality-health"],"summary":"Returns admin functionality status.","description":"Via the functionality_health_snapshot service and returns a typed\n`HealthSnapshot` payload.\n\nRequires control-plane admin role.","operationId":"get_status","responses":{"200":{"description":"Get status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthSnapshot"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/gateway/config":{"get":{"tags":["admin"],"summary":"Returns admin gateway config.","description":"And returns a typed `GetGatewayConfigResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_gateway_config","responses":{"200":{"description":"Get gateway config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetGatewayConfigResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["admin"],"summary":"Replaces admin gateway config.","description":"And returns a typed `PutGatewayConfigResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"put_gateway_config","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Put gateway config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutGatewayConfigResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/gateway/reload":{"post":{"tags":["admin"],"summary":"Creates admin gateway reload.","description":"And returns a typed `PostGatewayReloadResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"post_gateway_reload","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Post gateway reload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostGatewayReloadResponse"}}}},"202":{"description":"Accepted."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/healer/config":{"get":{"tags":["healer"],"summary":"Returns admin healer config.","description":"Via the healer_service service and returns a typed `HealerConfigResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"admin_healer_get_config","responses":{"200":{"description":"Get config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealerConfigResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["healer"],"summary":"Updates admin healer config.","description":"Via the healer_service service (request body: `UpdateHealerConfigRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"admin_healer_update_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHealerConfigRequest"}}},"required":true},"responses":{"204":{"description":"Update config."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/healer/rules":{"get":{"tags":["healer"],"summary":"Lists admin healer rules.","description":"Via the healer_service service and returns a typed `HealerRulesResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"admin_healer_list_rules","parameters":[{"name":"limit","in":"query","description":"Max rows to return (1..=500, default 500).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"offset","in":"query","description":"Rows to skip for pagination (default 0).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List rules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealerRulesResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["healer"],"summary":"Creates admin healer rules.","description":"Via the healer_service service and returns a typed `AddRuleResponse` payload\n(request body: `AddHealerRuleRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"add_rule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddHealerRuleRequest"}}},"required":true},"responses":{"201":{"description":"Add rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddRuleResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/healer/rules/{rule_id}":{"put":{"tags":["healer"],"summary":"Updates admin healer rules.","description":"Via the healer_service service (request body: `AddHealerRuleRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"admin_healer_rules_update_rule","parameters":[{"name":"rule_id","in":"path","description":"rule_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddHealerRuleRequest"}}},"required":true},"responses":{"204":{"description":"Update rule."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["healer"],"summary":"Deletes admin healer rules.","description":"Via the healer_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"admin_healer_rules_delete_rule","parameters":[{"name":"rule_id","in":"path","description":"rule_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete rule."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/healer/stats":{"get":{"tags":["healer"],"summary":"Returns admin healer stats.","description":"Via the healer_service service and returns a typed `HealerStatsResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"admin_healer_get_stats","responses":{"200":{"description":"Returns stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealerStatsResponse"}}}},"400":{"description":"Bad request — invalid period."},"401":{"description":"Unauthenticated."},"403":{"description":"Caller is not a control-plane admin."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/healer/test":{"post":{"tags":["healer"],"summary":"Creates admin healer test.","description":"Via the healer_service service and returns a typed `TestHealingResponse` payload\n(request body: `TestHealingRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"test_healing","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestHealingRequest"}}},"required":true},"responses":{"200":{"description":"Test healing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestHealingResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/internal-docs":{"get":{"tags":["admin-internal-docs"],"summary":"Lists admin internal docs.","description":"Returns a `ListDocsResponse` payload (the manifest whitelist as summaries).\n\nRequires control-plane admin role.","operationId":"list_docs","responses":{"200":{"description":"List docs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDocsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/internal-docs/{slug}":{"get":{"tags":["admin-internal-docs"],"summary":"Returns admin internal docs.","description":"Returns a `DocDetailResponse` payload (doc metadata plus markdown content).\n\nRequires control-plane admin role.","operationId":"get_doc","parameters":[{"name":"slug","in":"path","description":"slug","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get doc.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocDetailResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/internal/memory/recall":{"post":{"tags":["admin-mcp"],"summary":"Creates admin internal memory recall.","description":"And returns a typed `MemoryRecallResponse` payload (request body:\n`MemoryRecallRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"memory_recall_handler","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryRecallRequest"}}},"required":true},"responses":{"200":{"description":"Memory recall handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryRecallResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/internal/memory/store":{"post":{"tags":["admin-mcp"],"summary":"Creates admin internal memory store.","description":"And returns a typed `MemoryStoreResponse` payload (request body:\n`MemoryStoreRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"memory_store_handler","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryStoreRequest"}}},"required":true},"responses":{"200":{"description":"Memory store handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryStoreResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/internal/pricing/estimate":{"post":{"tags":["admin-mcp"],"summary":"Creates admin internal pricing estimate.","description":"Via the model_catalog_cache service and returns a typed\n`PricingEstimateResponse` payload (request body: `PricingEstimateRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"pricing_estimate_handler","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingEstimateRequest"}}},"required":true},"responses":{"200":{"description":"Pricing estimate handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingEstimateResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/internal/routing/explain":{"get":{"tags":["admin-mcp"],"summary":"Returns admin internal routing explain.","description":"Reads from Postgres and returns a typed `RoutingExplainResponse` payload.\n\nRequires control-plane admin role.","operationId":"routing_explain_handler","parameters":[{"name":"request_id","in":"query","description":"Request UUID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Routing explain handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingExplainResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/internal/tenants":{"get":{"tags":["admin-mcp"],"summary":"Lists admin internal tenants.","description":"Reads from Postgres and returns a typed `ListTenantsResponse` payload.\n\nRequires control-plane admin role.","operationId":"list_tenants_handler","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"cursor","in":"query","description":"Keyset cursor: the `created_at` (RFC 3339) of the last row from the\nprevious page. Returns rows strictly older than this timestamp.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"List tenants handler.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTenantsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/invoices":{"get":{"tags":["admin-billing"],"summary":"Lists a tenant's invoices (staff view).","description":"Reads from Postgres and returns a typed `Vec<InvoiceHeaderResponse>` payload\nfor the tenant named by `org_id`. This used to bind the caller's own\norganization, so a platform admin only ever saw their own invoices.\n\nRequires control-plane admin role.","operationId":"list_invoices","parameters":[{"name":"org_id","in":"query","description":"Tenant UUID to list invoices for. Optional for one release: X-Website's\nadmin billing tab still calls the bare path, so an absent value falls\nback to the caller's own organization. It becomes required once the\nfrontend passes the tenant it is looking at.","required":false,"schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"The tenant's invoices, newest first, capped at 60.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceHeaderResponse"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller lacks required scope/role."},"404":{"description":"Unknown organization."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/invoices/{year}/{month}":{"get":{"tags":["admin-billing"],"summary":"Generates a tenant's invoice for one month (staff view).","description":"Returns the `MonthlyInvoice` the billing service produces, serialized\ndirectly (no envelope), for the tenant named by `org_id`. This is the one\nstaff invoice-generation surface: its `/v1/admin/usage/invoice/{year}/{month}`\ntwin made the identical call for the caller's own org and was deleted.\n\nRequires control-plane admin role.","operationId":"get_invoice","parameters":[{"name":"year","in":"path","description":"year","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"month","in":"path","description":"month","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"org_id","in":"query","description":"Tenant UUID to generate the invoice for. Required: a staff surface\nreports on the tenant it names, never on the caller's own organization.","required":true,"schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"The tenant's invoice for the month.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlyInvoice"}}}},"400":{"description":"Missing org_id, or invalid year/month."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller lacks required scope/role."},"404":{"description":"Unknown organization."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/margins":{"get":{"tags":["admin-margins"],"summary":"Lists admin margins.","description":"Reads from Postgres and returns a typed `ListPoliciesResponse` payload.\n\nRequires control-plane admin role.","operationId":"admin_margins_list_policies","parameters":[{"name":"limit","in":"query","description":"Maximum number of policies to return.\nDefaults to `200` and is server-capped at `200`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"offset","in":"query","description":"Number of policies to skip (pagination).\nDefaults to `0`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}}],"responses":{"200":{"description":"List policies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPoliciesResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-margins"],"summary":"Creates admin margins.","description":"Reads from Postgres via the audit_service, pricing_engine service and returns a\ntyped `CreatePolicyResponse` payload (request body: `MarginPolicyRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"admin_margins_create_policy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarginPolicyRequest"}}},"required":true},"responses":{"201":{"description":"Create policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePolicyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/margins/{id}":{"patch":{"tags":["admin-margins"],"summary":"Updates admin margins.","description":"Reads from Postgres via the audit_service, pricing_engine service and returns a\ntyped `UpdatePolicyResponse` payload (request body: `MarginPolicyRequest`).\n\nRequires control-plane admin role. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_policy","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarginPolicyRequest"}}},"required":true},"responses":{"200":{"description":"Update policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePolicyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/margins/{id}/preview":{"post":{"tags":["admin-margins"],"summary":"Previews admin margins for a policy.","description":"Closes audit P3 be-admin_margins-15: read-only computation. Looks up the\npolicy's `default_markup_pct` (a single SELECT) and derives vendor cost,\ncustomer charge, and gross margin from the request body; it performs no\nwrites. Returns a typed `PreviewPolicyResponse` payload (request body:\n`PreviewRequest`).\n\nRequires control-plane admin role.","operationId":"preview_policy","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewRequest"}}},"required":true},"responses":{"200":{"description":"Computed margin preview (read-only; no rows written).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewPolicyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/mc/providers/health":{"get":{"tags":["admin-mcp"],"summary":"`GET /v1/admin/mc/providers/health`","description":"Snapshot of provider circuit-breaker state. The MCP `routing_status`\ntool calls this. We synthesize the response from the live model\ncatalog grouped by provider — every catalog row whose\n`is_billing_exhausted == false` and whose owning provider isn't in a\ncircuit-open state contributes a \"healthy\" entry.","operationId":"mc_providers_health_handler","responses":{"200":{"description":"`GET /v1/admin/mc/providers/health` Snapshot of provider circuit-breaker state. The MCP `routing_status` tool calls this. We synthesize the response from the live model catalog grouped by provider — every catalog row whose `is_billing_exhausted == false` and whose owning provider isn't in a circuit-open state contributes a 'healthy' entry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McProvidersHealthResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/mc/requests/{request_id}/trace":{"get":{"tags":["admin-mcp"],"summary":"`GET /v1/admin/mc/requests/:request_id/trace`","description":"Full trace for a request. The MCP `waterfall_trace` tool calls this.\nRight now we return a forward-compatible shape with a `note` field\npointing to the canonical `/v1/admin/internal/routing/explain` endpoint\n— the underlying trace storage is the same, so we just delegate by\nreturning the same payload.","operationId":"mc_request_trace_handler","parameters":[{"name":"request_id","in":"path","description":"request_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"`GET /v1/admin/mc/requests/:request_id/trace` Full trace for a request. The MCP `waterfall_trace` tool calls this. Right now we return a forward-compatible shape with a `note` field pointing to the canonical `/v1/admin/internal/routing/explain` endpoint — the underlying trace storage is the same, so we just delegate by returning the same payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McRequestTraceResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/metrics/summary":{"get":{"tags":["metrics"],"summary":"Returns summary.","description":"And returns a typed `MetricsSummary` payload.\n\nRequires control-plane admin role; the rollup is scoped to the caller's\norganization.","operationId":"metrics_summary","responses":{"200":{"description":"Aggregate metrics for Overview/Observatory pages (admin only, scoped to caller's organization)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSummary"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/model-catalog":{"get":{"tags":["admin-model-catalog"],"summary":"Lists admin model catalog.","description":"Reads from Postgres and returns a typed `Vec<ModelCatalogResponse>` payload.\n\nRequires control-plane admin role.","operationId":"admin_model_catalog_list_models","responses":{"200":{"description":"List models.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelCatalogResponse"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-model-catalog"],"summary":"Creates admin model catalog.","description":"Via the audit_service service and returns a typed `ModelCatalogResponse` payload\n(request body: `CreateModelRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"admin_model_catalog_create_model","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateModelRequest"}}},"required":true},"responses":{"201":{"description":"Create model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCatalogResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/model-catalog/reload":{"post":{"tags":["admin-model-catalog"],"summary":"Creates admin model catalog reload.","description":"Via the audit_service service and returns a typed `ReloadCacheResponse`\npayload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"reload_cache","responses":{"200":{"description":"Reload cache.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReloadCacheResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/model-catalog/{slug}":{"delete":{"tags":["admin-model-catalog"],"summary":"Deletes admin model catalog.","description":"Via the audit_service service.\n\nRequires control-plane admin role. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"admin_model_catalog_delete_model","parameters":[{"name":"slug","in":"path","description":"slug","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Soft-deleted (is_active=false)."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["admin-model-catalog"],"summary":"Updates admin model catalog.","description":"Reads from Postgres and returns a typed `ModelCatalogResponse` payload (request\nbody: `UpdateModelRequest`).\n\nRequires control-plane admin role. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_model","parameters":[{"name":"slug","in":"path","description":"slug","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModelRequest"}}},"required":true},"responses":{"200":{"description":"Update model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCatalogResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/models/catalog/{provider}/{name}":{"get":{"tags":["admin-mcp"],"summary":"`GET /v1/admin/models/catalog/:provider/:name`","description":"Single catalog entry lookup. The MCP `xantly://model/{provider}/{name}`\nresource calls this when the agent reads a model URI.","operationId":"model_catalog_entry_handler","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","description":"name","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"`GET /v1/admin/models/catalog/:provider/:name` Single catalog entry lookup. The MCP `xantly://model/{provider}/{name}` resource calls this when the agent reads a model URI.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCatalogEntryResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/organizations/cloud-credits-fees":{"get":{"tags":["admin-cloud-credits"],"summary":"Lists every organization with a cloud-credits connection and its Xantly fee.","description":"The fee is in basis points of the org's measured provider cost: `300` is the\nstandard 3%, `0` is a free pilot. Reads from Postgres.\n\nRequires control-plane admin role.","operationId":"list_cloud_credits_fees","parameters":[{"name":"limit","in":"query","description":"Maximum number of orgs to return. Defaults to `200`, server-capped at `200`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"offset","in":"query","description":"Number of orgs to skip (for paging). Defaults to `0`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}}],"responses":{"200":{"description":"List cloud-credits fees per organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCloudCreditsFeesResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/organizations/limits":{"get":{"tags":["admin-org-limits"],"summary":"Lists admin organizations limits.","description":"Reads from Postgres and returns a typed `ListOrgLimitsResponse` payload.\n\nRequires control-plane admin role.","operationId":"list_org_limits","parameters":[{"name":"limit","in":"query","description":"Maximum number of orgs to return. Defaults to `200`, server-capped at `200`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"offset","in":"query","description":"Number of orgs to skip (for paging). Defaults to `0`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}}],"responses":{"200":{"description":"List org limits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrgLimitsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/organizations/{org_id}/cloud-credits-fee":{"patch":{"tags":["admin-cloud-credits"],"summary":"Sets an organization's cloud-credits fee.","description":"`fee_bps` is basis points of the org's measured provider cost: `300` is the\nstandard 3%, `0` puts the org on a free pilot. Applies to EVERY cloud-credits\nconnection the org has, so a pilot is a property of the customer rather than\nof whichever cloud they happened to connect first.\n\nRequires control-plane admin role. Mutating.","operationId":"update_cloud_credits_fee","parameters":[{"name":"org_id","in":"path","description":"org_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCloudCreditsFeeRequest"}}},"required":true},"responses":{"200":{"description":"Fee updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCloudCreditsFeeResponse"}}}},"400":{"description":"Bad request: validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller lacks required scope/role."},"404":{"description":"Organization not found, or it has no cloud-credits connection."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/organizations/{org_id}/credits":{"post":{"tags":["admin"],"summary":"Grants prepaid credit to an organization.","description":"Moves `org_settings.credit_balance_cents` and writes the matching\n`credit_transactions` row in ONE transaction, so the balance and the ledger\ncan never disagree. Control-plane admin only.","operationId":"grant_credit","parameters":[{"name":"org_id","in":"path","description":"Organization to credit","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantCreditRequest"}}},"required":true},"responses":{"200":{"description":"Credit granted; returns the new balance."},"400":{"description":"Bad request: non-positive, oversized, or unexplained grant."},"403":{"description":"Not a control-plane admin."},"404":{"description":"Organization not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/organizations/{org_id}/limits":{"patch":{"tags":["admin-org-limits"],"summary":"Updates admin organizations limits.","description":"Reads from Postgres and returns a typed `UpdateOrgLimitsResponse` payload\n(request body: `UpdateOrgLimitsRequest`).\n\nRequires control-plane admin role. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_org_limits","parameters":[{"name":"org_id","in":"path","description":"org_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgLimitsRequest"}}},"required":true},"responses":{"200":{"description":"Update org limits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgLimitsResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/platform/invitations":{"get":{"tags":["admin-platform"],"summary":"Lists admin platform invitations.","description":"And returns a typed `PlatformInvitationsResponse` payload.\n\nRequires control-plane admin role.","operationId":"admin_platform_list_invitations","responses":{"200":{"description":"List pending platform admin invitations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformInvitationsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-platform"],"summary":"Creates admin platform invitations.","description":"And returns a typed `InviteCreatedResponse` payload (request body:\n`CreatePlatformInviteRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_invitation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePlatformInviteRequest"}}},"required":true},"responses":{"200":{"description":"Create a new platform admin invitation and send email via Resend.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreatedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/platform/invitations/{invite_id}":{"delete":{"tags":["admin-platform"],"summary":"Deletes admin platform invitations.","description":"Requires control-plane admin role. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"revoke_invitation","parameters":[{"name":"invite_id","in":"path","description":"invite_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Revoke a pending invitation."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/platform/invitations/{invite_id}/resend":{"post":{"tags":["admin-platform"],"summary":"Creates admin platform invitations resend.","description":"And returns a typed `InviteCreatedResponse` payload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"resend_invitation","parameters":[{"name":"invite_id","in":"path","description":"invite_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Resend a pending invitation with a new token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreatedResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/platform/members":{"get":{"tags":["admin-platform"],"summary":"Lists admin platform members.","description":"And returns a typed `PlatformMembersResponse` payload.\n\nRequires control-plane admin role.","operationId":"admin_platform_list_members","responses":{"200":{"description":"List all active platform admin members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformMembersResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/platform/members/{member_id}":{"delete":{"tags":["admin-platform"],"summary":"Deletes admin platform members.","description":"Requires control-plane admin role. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"admin_platform_members_remove_member","parameters":[{"name":"member_id","in":"path","description":"member_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Remove a platform admin member."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/posthog/events":{"get":{"tags":["admin-posthog"],"summary":"Returns admin posthog events.","description":"And returns a typed `EventsResponse` payload.\n\nRequires control-plane admin role.","operationId":"events","parameters":[{"name":"days","in":"query","description":"Days.\nDefaults to `7`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `50`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/posthog/feature-adoption":{"get":{"tags":["admin-posthog"],"summary":"Returns admin posthog feature adoption.","description":"And returns a typed `FeatureAdoptionResponse` payload.\n\nRequires control-plane admin role.","operationId":"feature_adoption","parameters":[{"name":"days","in":"query","description":"Days.\nDefaults to `30`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Feature adoption.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureAdoptionResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/posthog/funnel":{"get":{"tags":["admin-posthog"],"summary":"Returns admin posthog funnel.","description":"And returns a typed `FunnelResponse` payload.\n\nRequires control-plane admin role.","operationId":"funnel","parameters":[{"name":"days","in":"query","description":"Days.\nDefaults to `30`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Funnel.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/posthog/overview":{"get":{"tags":["admin-posthog"],"summary":"Returns admin posthog overview.","description":"And returns a typed `OverviewResponse` payload.\n\nRequires control-plane admin role.\n\nPII surface: `recent_visitors` carries distinct_id, email, name, city and\ncountry for the most recent pageviews (admin-only, gated by\n`ensure_control_plane_admin`). Raw client IPs are intentionally NOT selected\n(see `q_recent_visitors`), and this handler's span never records the\nresponse body, so the payload is not leaked via traces/logs. Closes audit P2\nbe-admin_posthog-5.","operationId":"overview","parameters":[{"name":"days","in":"query","description":"Days.\nDefaults to `30`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Overview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverviewResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/posthog/persons":{"get":{"tags":["admin-posthog"],"summary":"Returns admin posthog persons.","description":"And returns a typed `PersonsResponse` payload.\n\nRequires control-plane admin role.","operationId":"persons","parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return. Endpoint-specific default (typically 20–50).","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"offset","in":"query","description":"Number of items to skip (pagination).\nDefaults to `0`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Persons.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/posthog/recordings":{"get":{"tags":["admin-posthog"],"summary":"Returns admin posthog recordings.","description":"Via the config service and returns a typed `RecordingsResponse` payload.\n\nRequires control-plane admin role.","operationId":"recordings","parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return. Endpoint-specific default (typically 20–50).","required":false,"schema":{"type":"integer","format":"int32","nullable":true}},{"name":"offset","in":"query","description":"Number of items to skip (pagination).\nDefaults to `0`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Recordings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/price-sync/trigger":{"post":{"tags":["admin-price-sync"],"summary":"Triggers a vendor price sync and returns immediately.","description":"Synchronously: authorizes the caller, claims the single in-flight slot, and\nrecords an audit entry. It then spawns the actual price sync as a detached\nbackground task and returns `202 Accepted` without waiting for it — any\npricing-row writes happen later inside that task, not before this returns.\n\nRequires control-plane admin role.","operationId":"trigger_price_sync","responses":{"201":{"description":"Triggers an immediate vendor price sync from the OpenRouter + LiteLLM pricing feeds. Runs asynchronously; the endpoint returns immediately with `sync_triggered`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerPriceSyncResponse"}}}},"202":{"description":"Accepted."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/protocols":{"get":{"tags":["admin"],"summary":"Returns admin protocols.","description":"And returns a typed `GetProtocolsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_protocols","responses":{"200":{"description":"Get protocols.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetProtocolsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/protocols/test":{"post":{"tags":["admin"],"summary":"Creates admin protocols test.","description":"And returns a typed `PostProtocolTestResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"post_protocol_test","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Post protocol test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostProtocolTestResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/protocols/{protocol_id}":{"put":{"tags":["admin"],"summary":"Replaces admin protocols.","description":"And returns a typed `PutProtocolResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"put_protocol","parameters":[{"name":"protocol_id","in":"path","description":"protocol_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Put protocol.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutProtocolResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/provider-reconciliation/run":{"post":{"tags":["admin"],"summary":"Compare a provider's own usage records against the ledger for a window.","description":"Lists and fetches the provider's log objects for the window across both\nregions, matches them to our rows, and reports drift, unattributed usage\nand the per-organization split. Synchronous, so the window is capped.\nControl-plane admin only.","operationId":"admin_provider_reconciliation_run","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunRequest"}}},"required":true},"responses":{"200":{"description":"The provider's usage records compared against the ledger for the window: matched rows, drift, unattributed usage, per-organization split"},"400":{"description":"Window too long for the synchronous path"},"403":{"description":"Control-plane admin only"}},"security":[{"bearer":[]}]}},"/v1/admin/providers":{"get":{"tags":["admin-providers"],"summary":"Lists admin providers.","description":"Reads from Postgres and returns a typed `ListProvidersResponse` payload.\n\nRequires control-plane admin role.","operationId":"admin_list_providers","responses":{"200":{"description":"List providers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProvidersResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-providers"],"summary":"Creates admin providers.","description":"Reads from Postgres via the audit_service service and returns a typed\n`CreateProviderResponse` payload (request body: `CreateProviderRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_provider","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProviderRequest"}}},"required":true},"responses":{"200":{"description":"Provider updated (existing row upserted).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProviderResponse"}}}},"201":{"description":"Provider created (new row).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProviderResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/providers/{id}":{"patch":{"tags":["admin-providers"],"summary":"Updates an admin provider's active flag.","description":"Writes to Postgres via the audit_service service and returns a typed\n`UpdateProviderResponse` payload (request body: `UpdateProviderRequest`).\n\nRequires control-plane admin role. Mutating: toggles `is_active`\n(soft-delete / deactivate / re-activate) on an existing row.","operationId":"set_provider_active","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProviderRequest"}}},"required":true},"responses":{"200":{"description":"Provider active flag updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProviderResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/providers/{id}/health":{"get":{"tags":["admin-providers"],"summary":"Returns admin providers health.","description":"Reads from Postgres and returns a typed `GetProviderHealthResponse` payload.\n\nRequires control-plane admin role.","operationId":"admin_providers_get_provider_health","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get provider health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetProviderHealthResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/providers/{id}/probe":{"post":{"tags":["admin-providers"],"summary":"Creates admin providers probe.","description":"Reads from Postgres via the audit_service service and returns a typed\n`ProbeProviderResponse` payload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"probe_provider","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Probe provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProbeProviderResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/rate-limits/{tenant_id}":{"get":{"tags":["admin"],"summary":"Returns admin rate limits.","description":"Reads from Postgres and returns a typed `RateLimitResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_rate_limit","parameters":[{"name":"tenant_id","in":"path","description":"tenant_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["admin"],"summary":"Replaces admin rate limits.","description":"Reads from Postgres and returns a typed `RateLimitResponse` payload (request\nbody: `UpdateRateLimitRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"put_rate_limit","parameters":[{"name":"tenant_id","in":"path","description":"tenant_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRateLimitRequest"}}},"required":true},"responses":{"200":{"description":"Put rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/rate-limits/{tenant_id}/override":{"post":{"tags":["admin"],"summary":"Creates admin rate limits override.","description":"And returns a typed `PostRateLimitOverrideResponse` payload (request body:\n`Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"post_rate_limit_override","parameters":[{"name":"tenant_id","in":"path","description":"tenant_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Post rate limit override.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostRateLimitOverrideResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/rate-limits/{tenant_id}/override/{override_id}":{"delete":{"tags":["admin"],"summary":"Deletes admin rate limits override.","description":"Requires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_rate_limit_override","parameters":[{"name":"tenant_id","in":"path","description":"tenant_id","required":true,"schema":{"type":"string"}},{"name":"override_id","in":"path","description":"override_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete rate limit override."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/reconciliation/discrepancies":{"get":{"tags":["admin-billing"],"summary":"Lists admin reconciliation discrepancies.","description":"Reads from Postgres and returns a typed `ListDiscrepanciesResponse` payload.\n\nRequires control-plane admin role.","operationId":"list_discrepancies","parameters":[{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}},{"name":"org_id","in":"query","description":"Organisation UUID.","required":false,"schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"List discrepancies.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDiscrepanciesResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/reconciliation/runs":{"get":{"tags":["admin-billing"],"summary":"Lists admin reconciliation runs.","description":"Reads from Postgres and returns a typed `ListReconciliationRunsResponse`\npayload.\n\nRequires control-plane admin role.","operationId":"list_reconciliation_runs","responses":{"200":{"description":"List reconciliation runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListReconciliationRunsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/reconciliation/trigger":{"post":{"tags":["admin-billing"],"summary":"Triggers admin reconciliation trigger.","description":"Reads from Redis and returns a typed `TriggerReconciliationResponse2` payload.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"trigger_reconciliation","responses":{"200":{"description":"Trigger reconciliation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerReconciliationResponse2"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/replay/run":{"post":{"tags":["admin-replay"],"summary":"Start a replay run over the recorded request corpus.","description":"Replays recorded gateway traffic against the current routing and pricing\nconfiguration so a change can be evaluated before it reaches live requests.\n`dry_run` plans synchronously and returns the plan in the body; a real run\nis accepted with 202 and executes in the background, and progress is polled\nfrom `GET /v1/admin/replay/status`. Platform admin only, and gated off by\nenvironment in deployments where execution is disabled.","operationId":"run_replay","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayRunRequest"}}},"required":true},"responses":{"200":{"description":"Dry run completed synchronously; body carries the plan.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayRunAccepted"}}}},"202":{"description":"Real run accepted and started in the background; poll status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayRunAccepted"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks platform admin, or execution is env-gated off."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/replay/status":{"get":{"tags":["admin-replay"],"summary":"Report replay gates, corpus size and recent runs.","description":"Returns whether replay execution is enabled for this deployment, how many\ncells the recorded corpus holds, and the most recent runs with their\noutcomes. This is the polling endpoint for a run started with 202 by `POST\n/v1/admin/replay/run`.","operationId":"replay_status","responses":{"200":{"description":"Replay gates, corpus size, recent runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayStatusResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/routing-experiments":{"get":{"tags":["admin-routing-experiments"],"summary":"Lists admin routing experiments.","description":"Reads from Postgres and returns a typed `ListExperimentsResponse` payload.\n\nRequires control-plane admin role.","operationId":"list_experiments","responses":{"200":{"description":"List experiments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListExperimentsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-routing-experiments"],"summary":"Creates admin routing experiments.","description":"Reads from Postgres via the audit_service service and returns a typed\n`CreateExperimentResponse` payload (request body: `RoutingExperimentRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_experiment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingExperimentRequest"}}},"required":true},"responses":{"201":{"description":"Create experiment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExperimentResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/routing-experiments/{id}":{"patch":{"tags":["admin-routing-experiments"],"summary":"Updates admin routing experiments.","description":"Reads from Postgres via the audit_service service and returns a typed\n`UpdateExperimentResponse` payload (request body: `RoutingExperimentRequest`).\n\nRequires control-plane admin role. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_experiment","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingExperimentRequest"}}},"required":true},"responses":{"200":{"description":"Update experiment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExperimentResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/routing-experiments/{id}/outcomes":{"get":{"tags":["admin-routing-experiments"],"summary":"Returns admin routing experiments outcomes.","description":"Reads from Postgres and returns a typed `ExperimentOutcomesResponse` payload.\n\nRequires control-plane admin role.","operationId":"experiment_outcomes","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"days","in":"query","description":"Limit to requests in the past N days (default: 7)\nDefaults to `7`.\nServer-capped at `90`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Aggregates gateway_requests rows where request metadata contains an experiment assignment for this experiment id, grouped by variant. Returns per-variant request count, success rate, average latency, average provider cost, average customer charge, and average gross margin so operators can evaluate which variant is performing better.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentOutcomesResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/routing/calibration":{"get":{"tags":["admin-routing"],"summary":"Size and state of the routing calibration store.","description":"A quick read for operators: how many labelled requests the router can\ndraw neighbours from, and whether the lookup is switched on.","operationId":"status","responses":{"200":{"description":"Point count and flag state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalibrationStatus"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller is not a control-plane admin."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-routing"],"summary":"Ingest labelled requests into the routing calibration store.","description":"Each item is embedded server-side with the routing embedder, so stored\nvectors and lookup vectors share one space by construction. Items whose\n`split` is `eval` are refused and reported, not written.","operationId":"ingest","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalibrationIngestBody"}}},"required":true},"responses":{"200":{"description":"Ingest counts: written, refused as eval, embed and upsert failures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestReport"}}}},"400":{"description":"Malformed body."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller is not a control-plane admin."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/routing/debug":{"get":{"tags":["admin"],"summary":"Returns admin routing debug.","description":"And returns a typed `GetRoutingDebugResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_routing_debug","responses":{"200":{"description":"Get routing debug.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRoutingDebugResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/rules":{"get":{"tags":["admin-rules"],"summary":"Lists admin rules.","description":"Reads from Postgres and returns a typed `Vec<rule_definitions::Model>` payload.\n\nRequires control-plane admin role.","operationId":"admin_list_rules","responses":{"200":{"description":"List rules.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/rule_definitions.Model"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["admin-rules"],"summary":"Creates admin rules.","description":"And returns a typed `rule_definitions::Model` payload (request body:\n`CreateRuleRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_rule","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleRequest"}}},"required":true},"responses":{"200":{"description":"Create rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rule_definitions.Model"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/rules/{id}":{"get":{"tags":["admin-rules"],"summary":"Returns admin rules.","description":"Reads from Postgres and returns a typed `rule_definitions::Model` payload.\n\nRequires control-plane admin role.","operationId":"get_rule","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rule_definitions.Model"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["admin-rules"],"summary":"Updates admin rules.","description":"Reads from Postgres and returns a typed `rule_definitions::Model` payload\n(request body: `UpdateRuleRequest`).\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"admin_rules_update_rule","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleRequest"}}},"required":true},"responses":{"200":{"description":"Update rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/rule_definitions.Model"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["admin-rules"],"summary":"Deletes admin rules.","description":"Reads from Postgres and returns a typed `DeleteRuleResponse` payload.\n\nRequires control-plane admin role. Mutating: the resource is removed (or marked\ndeleted) on success.","operationId":"admin_rules_delete_rule","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Delete rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRuleResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/settings":{"get":{"tags":["admin"],"summary":"Returns admin settings.","description":"Reads from Postgres and returns a typed `OrganizationSettings` payload.\n\nRequires a valid bearer token.","operationId":"admin_get_settings","responses":{"200":{"description":"Get settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationSettings"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["admin"],"summary":"Updates admin settings.","description":"Reads from Postgres and returns a typed `OrganizationSettings` payload (request\nbody: `OrganizationSettings`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"admin_update_settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationSettings"}}},"required":true},"responses":{"200":{"description":"Update settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationSettings"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/stats":{"get":{"tags":["admin-billing"],"summary":"Returns admin stats.","description":"Reads from Postgres and returns a typed `Vec<TenantUsageStats>` payload.\n\nRequires control-plane admin role.","operationId":"get_usage_stats","parameters":[{"name":"tenant_id","in":"query","description":"Tenant UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"month","in":"query","description":"Month.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get usage stats.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TenantUsageStats"}}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/sync/reset-breaker":{"post":{"tags":["admin-sync"],"summary":"Clears the failure streak by inserting a synthetic sentinel run so the next","description":"`run_sync` call is not blocked. Requires admin + an explicit reset reason so the\naction is auditable.","operationId":"admin_sync_reset_breaker_reset_breaker","responses":{"201":{"description":"Clears the failure streak by inserting a synthetic sentinel run so the next `run_sync` call is not blocked. Requires admin + an explicit reset reason so the action is auditable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetBreakerResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/sync/run":{"post":{"tags":["admin-sync"],"summary":"Creates admin sync run.","description":"Reads from Postgres via the audit_service service and returns a typed\n`RunSyncAcceptedResponse` payload on success.\n\nRequires control-plane admin role. Mutating: writes a new row or replaces an\nexisting one.","operationId":"run_sync","responses":{"202":{"description":"Sync accepted; catalog projection outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSyncAcceptedResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"503":{"description":"Sync circuit breaker open.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSyncResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/v1/admin/sync/status":{"get":{"tags":["admin-sync"],"summary":"Returns admin sync status.","description":"Reads from Postgres and returns a typed `SyncStatusResponse` payload.\n\nRequires control-plane admin role.","operationId":"sync_status","responses":{"200":{"description":"Sync status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncStatusResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/telemetry/query":{"post":{"tags":["admin-telemetry"],"summary":"Ad-hoc query over recent requests, read-only.","description":"The Admin Portal's Telemetry tab. Filters are equality matches on\nwhitelisted columns; the body is POSTed because a filter set does not fit\na query string, not because anything is written.","operationId":"adhoc_query","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryQueryBody"}}},"required":true},"responses":{"200":{"description":"Matching requests, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryQueryResponse"}}}},"400":{"description":"Unknown field, or a value that does not fit the field's type."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller is not a control-plane admin."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/telemetry/requests/{id}/diff/{other_id}":{"get":{"tags":["admin-telemetry"],"summary":"Structured diff of two requests' telemetry documents.","description":"Walks both JSONB telemetry trees and reports every leaf that differs,\nskipping timing-sensitive keys that always differ. Either identifier the\noperator has to hand is accepted: the event's own id, or the gateway\nrequest id shown on `x-xantly-request-id`.","operationId":"request_diff","parameters":[{"name":"id","in":"path","description":"First request (event id or request id)","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"other_id","in":"path","description":"Second request","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Both documents and every differing leaf.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestDiffResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller is not a control-plane admin."},"404":{"description":"One of the requests was not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/telemetry/timeseries":{"get":{"tags":["admin-telemetry"],"summary":"Time-bucketed metric over a window, optionally split by one dimension.","description":"Buckets `mission_control_events` between `from` and `to` at the requested\nresolution and aggregates one metric per bucket. `group_by` adds one row\nper bucket per group value.","operationId":"timeseries","parameters":[{"name":"from","in":"query","description":"Window start, RFC 3339.","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"Window end, RFC 3339.","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"metric","in":"query","description":"One of: latency, cost, requests, cache_hit_rate, tokens.","required":true,"schema":{"type":"string"}},{"name":"resolution","in":"query","description":"Bucket width: 1m, 5m, 1h (default), 1d.","required":false,"schema":{"type":"string","nullable":true}},{"name":"group_by","in":"query","description":"Optional split: provider, model, tier, lane.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Bucketed points, ascending by time.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeseriesResponse"}}}},"400":{"description":"Unknown metric, resolution or group_by; or to <= from."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller is not a control-plane admin."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/transforms":{"get":{"tags":["transform"],"summary":"Lists admin transforms.","description":"Via the transform_service service and returns a typed `TransformListResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"list_transforms","parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `100`.\nServer-capped at `500`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"cursor","in":"query","description":"Opaque pagination cursor returned by the previous page as\n`next_cursor` (a `created_at` Unix-timestamp string).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"List transforms.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransformListResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["transform"],"summary":"Creates admin transforms.","description":"And returns a typed `CreateTransformResponse` payload (request body:\n`CreateTransformRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_transform","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransformRequest"}}},"required":true},"responses":{"201":{"description":"Create transform.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransformResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/transforms/test":{"post":{"tags":["transform"],"summary":"Creates admin transforms test.","description":"Via the transform_service service and returns a typed `TestTransformResponse`\npayload (request body: `TestTransformRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"test_transform","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestTransformRequest"}}},"required":true},"responses":{"200":{"description":"Creates test transform.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestTransformResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller is not a control-plane admin."}},"security":[{"bearer_auth":[]}]}},"/v1/admin/transforms/{transform_id}":{"put":{"tags":["transform"],"summary":"Updates admin transforms.","description":"(request body: `UpdateTransformRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"update_transform","parameters":[{"name":"transform_id","in":"path","description":"transform_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTransformRequest"}}},"required":true},"responses":{"204":{"description":"Update transform."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["transform"],"summary":"Deletes admin transforms.","description":"Requires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_transform","parameters":[{"name":"transform_id","in":"path","description":"transform_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete transform."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/agents":{"get":{"tags":["agents"],"summary":"Lists agents.","description":"Reads from Postgres and returns a typed `ListAgentsResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_agents","parameters":[{"name":"workspace_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","format":"uuid","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `20`.\nServer-capped at `100`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"cursor","in":"query","description":"Opaque pagination cursor returned by the previous page as\n`meta.next_cursor` (a `created_at` Unix-timestamp string).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"List Agents (Paginated)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["agents"],"summary":"Creates an agent.","description":"Closes audit P3 be-agents-19.\nInserts a new row into Postgres and returns a typed `CreateAgentResponse`\npayload (request body: `CreateAgentRequest`). When an `Idempotency-Key`\nheader is supplied, the response is cached in Redis (24h TTL) so a retry with\nthe same key replays the original response instead of creating a duplicate.\n\nRequires a valid bearer token. Mutating: writes a new agent row.","operationId":"create_agent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}},"required":true},"responses":{"200":{"description":"Create Agent (Idempotent)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"429":{"description":"Rate-limited."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/agents/subagent":{"post":{"tags":["agents"],"summary":"Retrieves a subagent (stub).","description":"Closes audit P3 be-agents-20.\nNot yet wired to orchestration: always returns `501 Not Implemented`\n(request body: `Value`).\n\nRequires a valid bearer token.","operationId":"get_subagent","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Subagent retrieval (stub implementation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSubagentResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]}},"/v1/agents/{id}":{"get":{"tags":["agents"],"summary":"Returns agents.","description":"Reads from Postgres and returns a typed `AgentResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_agent","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get Agent by ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["agents"],"summary":"Deletes agents.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_agent","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Delete Agent"},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["agents"],"summary":"Updates agents.","description":"Reads from Postgres and returns a typed `AgentResponse` payload (request body:\n`UpdateAgentRequest`).\n\nRequires a valid bearer token. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_agent","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequest"}}},"required":true},"responses":{"200":{"description":"Update Agent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/agents/{id}/execute":{"post":{"tags":["agents"],"summary":"Executes an agent by id (stub).","description":"Closes audit P3 be-agents-20.\nNot yet wired to an execution engine: always returns `501 Not Implemented`\n(request body: `Value`).\n\nRequires a valid bearer token.","operationId":"execute_agent","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Execute Agent (stub implementation)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteAgentResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/agents":{"get":{"tags":["analytics"],"summary":"Returns analytics agents.","description":"And returns a typed `GetAgentUsageResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_agent_usage","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Group usage by agent_id and workflow_id (first-class columns, fallback to metadata).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAgentUsageResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/anomalies":{"get":{"tags":["analytics"],"summary":"Returns analytics anomalies.","description":"And returns a typed `GetAnomaliesResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_anomalies","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Detect active spend, latency, traffic, and error-rate anomalies from aggregated rollups.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAnomaliesResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/barp-weights":{"get":{"tags":["analytics"],"summary":"Returns analytics barp weights.","description":"Via the barp_router service and returns a typed `BarpWeightsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_barp_weights","responses":{"200":{"description":"Get barp weights.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BarpWeightsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/breakdown":{"get":{"tags":["analytics"],"summary":"Returns analytics breakdown.","description":"And returns a typed `GetBreakdownResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_breakdown","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get breakdown.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBreakdownResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/byok-savings":{"get":{"tags":["analytics"],"summary":"Returns analytics byok savings.","description":"Reads from Postgres and returns a typed `GetByokSavingsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_byok_savings","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Shows per-tenant BYOK cost attribution breakdown: how much traffic was served via the customer's own API keys (byok_cost_usd) vs Xantly's provider pool (cost_usd), the implied savings from Xantly's cheaper models, and a per-model + per-task breakdown so customers can see exactly which model and task type drove each dollar of savings. Requires migrations 20260315_byok_cost_attribution.sql and 20260315_byok_spend_cap.sql.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetByokSavingsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/cache-efficiency":{"get":{"tags":["analytics"],"summary":"Returns analytics cache efficiency.","description":"And returns a typed `CacheEfficiencyResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_cache_efficiency","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get cache efficiency.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheEfficiencyResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/cache-performance":{"get":{"tags":["analytics"],"summary":"Returns analytics cache performance.","description":"And returns a typed `GetCachePerformanceResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_cache_performance","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get cache performance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCachePerformanceResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/charts":{"get":{"tags":["analytics"],"summary":"Returns analytics charts.","description":"And returns a typed `AnalyticsChartsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_charts","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get charts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsChartsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/costs":{"get":{"tags":["analytics"],"summary":"Returns analytics costs.","description":"And returns a typed `GetCostBreakdownResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_cost_breakdown","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get cost breakdown.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCostBreakdownResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/costs/forecast":{"get":{"tags":["analytics"],"summary":"Returns analytics costs forecast.","description":"And returns a typed `GetCostForecastResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_cost_forecast","responses":{"200":{"description":"Get cost forecast.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCostForecastResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/costs/summary":{"get":{"tags":["admin-mc-tokens"],"summary":"Returns admin mission control dashboards costs.","description":"Reads from Postgres and returns a typed `McDashboardsCostsResponse` payload.\n\nRequires control-plane admin role.","operationId":"mc_dashboards_costs","parameters":[{"name":"from","in":"query","description":"ISO-8601 lower bound (inclusive). Defaults to 7 days before `to`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"to","in":"query","description":"ISO-8601 upper bound (exclusive). Defaults to now.","required":false,"schema":{"type":"string","nullable":true}},{"name":"granularity","in":"query","description":"Rollup granularity: `hour | day | week | month`. Defaults to `day`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"Optional single-key filter.","required":false,"schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"`GET /v1/analytics/costs/summary` Returns the shape the Analytics cost view expects: projected monthly cost, savings split (cache / routing / memory), and a stacked time series of cost by provider. Pulls from `analytics_rollups` for cost timeseries (already keyed by provider + day) and from `mission_control_events` for the savings classification.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McDashboardsCostsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/errors":{"get":{"tags":["analytics"],"summary":"Returns analytics errors.","description":"And returns a typed `GetErrorsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_errors","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetErrorsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/export":{"post":{"tags":["analytics"],"summary":"Creates analytics export.","description":"(request body: `ExportAnalyticsRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"export_analytics","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportAnalyticsRequest"}}},"required":true},"responses":{"200":{"description":"Export analytics.","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/latency":{"get":{"tags":["analytics"],"summary":"Returns analytics latency.","description":"And returns a typed `GetLatencyResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_latency","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get latency.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLatencyResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/latency/heatmap":{"get":{"tags":["analytics"],"summary":"Returns analytics latency heatmap.","description":"And returns a typed `GetLatencyHeatmapResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_latency_heatmap","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get latency heatmap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLatencyHeatmapResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/memory-stats":{"get":{"tags":["analytics"],"summary":"Returns analytics memory stats.","description":"And returns a typed `GetMemoryStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_memory_stats","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Conversation memory retention analysis + L2 semantic memory storage metrics. Demonstrates data retention value and customer stickiness to enterprise buyers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMemoryStatsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/model-ranking":{"get":{"tags":["analytics"],"summary":"Returns analytics model ranking.","description":"And returns a typed `ModelRankingResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_model_ranking","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get model ranking.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRankingResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/models":{"get":{"tags":["analytics"],"summary":"Returns analytics models.","description":"And returns a typed `GetModelsUsageResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_models_usage","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get models usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetModelsUsageResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/recent-requests":{"get":{"tags":["analytics"],"summary":"GET /v1/analytics/recent-requests","description":"Cursor-paginated recent requests, read entirely from PostgreSQL `gateway_requests`.\nPrompts are never stored; `prompt_hash` is empty and `prompt_length` is zero by design —\nthe gateway does not persist raw user content (privacy by default).","operationId":"get_recent_requests","parameters":[{"name":"cursor","in":"query","description":"Opaque pagination cursor returned by the previous page.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `50`.\nServer-capped at `100`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}},{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}},{"name":"task_family","in":"query","description":"Filter by task family (routing_task_family from metadata), e.g. \"code\", \"analysis\", \"summarize\"","required":false,"schema":{"type":"string","nullable":true}},{"name":"cost_attribution","in":"query","description":"Filter to only BYOK or Xantly-routed requests (\"byok\" | \"xantly\")","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Cursor-paginated recent requests, read entirely from PostgreSQL `gateway_requests`. Prompts are never stored; `prompt_hash` is empty and `prompt_length` is zero by design — the gateway does not persist raw user content (privacy by default).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecentRequestsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/reliability/slo":{"get":{"tags":["analytics"],"summary":"Returns analytics reliability slo.","description":"And returns a typed `GetReliabilitySloResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_reliability_slo","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Combine latency and error stats for SLO view.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetReliabilitySloResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/request-trace/{request_id}":{"get":{"tags":["analytics"],"summary":"Returns analytics request trace.","description":"Reads from Postgres and returns a typed `RequestTraceResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_request_trace","parameters":[{"name":"request_id","in":"path","description":"request_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get request trace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestTraceResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/roi":{"get":{"tags":["analytics"],"summary":"Returns analytics roi.","description":"And returns a typed `GetRoiResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_roi","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get roi.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRoiResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/routing":{"get":{"tags":["analytics"],"summary":"Returns analytics routing.","description":"And returns a typed `GetRoutingResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_routing","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get routing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRoutingResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/routing-flow":{"get":{"tags":["analytics"],"summary":"Returns analytics routing flow.","description":"And returns a typed `GetRoutingFlowResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_routing_flow","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nDefaults to `\"30d\"`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Chart type. When `voice`, returns `voice_minutes` per-hour buckets.\nOtherwise the default latency+cost shape. Closes audit P1\nbilling-overview-1.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Returns (lane × tier × provider × model) edge counts for Sankey / alluvial flow diagrams. Each entry in `flows` represents a unique routing path with the number of requests that traversed it. This is the data structure required for a live routing flow visualization. Example Sankey nodes: request → smart → T1 → openai → gpt-4o","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRoutingFlowResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/routing/explain":{"get":{"tags":["analytics"],"summary":"Returns analytics routing explain.","description":"And returns a typed `GetRoutingExplainResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_routing_explain","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Return recent routing decisions with requested vs selected model, lane/tier, scores.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRoutingExplainResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/stream":{"get":{"tags":["analytics"],"summary":"GET /v1/analytics/stream","description":"Server-Sent Events stream: pushes newest 20 requests every 3 seconds.\nAuthenticate with a short-lived streaming-scoped token (mint one via\n`POST /v1/analytics/stream-token`) passed as a `?token=` query parameter —\nbrowser EventSource cannot set headers, and a streaming-scoped token limits\nthe blast radius of the URL capturing the credential. A full\n`Authorization: Bearer <token>` header (or `?token=<jwt>`) is still accepted\nfor non-browser clients.","operationId":"analytics_stream","responses":{"204":{"description":"Server-Sent Events stream: pushes newest 20 requests every 3 seconds. Authenticate with a short-lived streaming-scoped token (mint one via POST /v1/analytics/stream-token) passed as a `?token=` query parameter, since browser EventSource cannot set headers. A full `Authorization: Bearer <token>` header (or `?token=<jwt>`) is still accepted for non-browser clients."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/summary":{"get":{"tags":["analytics"],"summary":"Returns analytics summary.","description":"And returns a typed `AnalyticsSummaryResponse` payload.\n\nRequires a valid bearer token.","operationId":"analytics_get_summary","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSummaryResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/test-run-summary":{"get":{"tags":["analytics"],"summary":"Returns analytics test run summary.","description":"Via the model_catalog_cache service and returns a typed\n`GetTestRunSummaryResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_test_run_summary","parameters":[{"name":"since","in":"query","description":"Lower-bound timestamp (inclusive, RFC 3339).","required":false,"schema":{"type":"string","nullable":true}},{"name":"run_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Returns test run summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTestRunSummaryResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/tokens/ledger":{"get":{"tags":["analytics"],"summary":"Returns analytics tokens ledger.","description":"And returns a typed `GetTokenLedgerResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_token_ledger","parameters":[{"name":"period","in":"query","description":"Aggregation period (e.g. '1h', '24h', '7d').\nAccepted values: `30d`, `all`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model","in":"query","description":"Filter by model identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}},{"name":"agent_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"endpoint","in":"query","description":"Endpoint.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"UUID identifier.","required":false,"schema":{"type":"string","nullable":true}},{"name":"project_id","in":"query","description":"Project UUID.","required":false,"schema":{"type":"string","nullable":true}},{"name":"environment","in":"query","description":"Environment.","required":false,"schema":{"type":"string","nullable":true}},{"name":"cache_hit","in":"query","description":"Cache hit.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Token ledger: input/output tokens and cache savings (reuse cache_efficiency logic)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTokenLedgerResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/analytics/tokens/usage":{"get":{"tags":["admin-mc-tokens"],"summary":"Returns admin mission control dashboards tokens.","description":"And returns a typed `McDashboardsTokensResponse` payload.\n\nRequires control-plane admin role.","operationId":"mc_dashboards_tokens","parameters":[{"name":"from","in":"query","description":"ISO-8601 lower bound (inclusive). Defaults to 7 days before `to`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"to","in":"query","description":"ISO-8601 upper bound (exclusive). Defaults to now.","required":false,"schema":{"type":"string","nullable":true}},{"name":"granularity","in":"query","description":"Rollup granularity: `hour | day | week | month`. Defaults to `day`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"api_key_id","in":"query","description":"Optional single-key filter.","required":false,"schema":{"type":"string","format":"uuid","nullable":true}}],"responses":{"200":{"description":"`GET /v1/analytics/tokens/usage` One-shot consolidated payload for the Token Usage dashboard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McDashboardsTokensResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys":{"get":{"tags":["api-keys"],"summary":"Lists admin api keys.","description":"Reads from Postgres and returns a typed `ListApiKeysResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_api_keys","parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `20`.\nServer-capped at `100`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"cursor","in":"query","description":"Opaque pagination cursor returned by the previous page as\n`meta.next_cursor`. Closes audit P2 be-api_keys-11. Upgraded by\nbe-api_keys-6 to a full-precision keyset (URL-safe base64 of\n`<created_at_micros>:<id>`) so same-second keys are no longer dropped\nacross a page boundary.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"List all API keys for the user (Cursor Pagination)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["api-keys"],"summary":"Creates admin api keys.","description":"Reads from Redis via the audit_service service and returns a typed\n`CreateApiKeyResponse` payload (request body: `CreateKeyRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_api_key","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Create a new API key (Idempotent)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required: this route is guarded by require_sudo_middleware. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url` naming the elevation endpoint. Elevate, then retry the original request."},"429":{"description":"Rate-limited."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys/{id}":{"delete":{"tags":["api-keys"],"summary":"Deletes admin api keys.","description":"Reads from Postgres via the audit_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_api_key","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Delete (revoke) an API key"},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required: this route is guarded by require_sudo_middleware. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url` naming the elevation endpoint. Elevate, then retry the original request."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["api-keys"],"summary":"Updates an api key (partial / PATCH).","description":"Backs the frontend `PATCH /v1/api-keys/{id}` flow (see X-Website\n`useMcp.ts` `useUpdateMcpApiKey`), which sends an arbitrary subset of\n`{ label, scopes, daily_rate_limit }`. Only the fields present in the body\nare mutated; everything else is left untouched. Closes audit P1\nbe-api_keys-10 (previously this was a ghost endpoint — the FE PATCH had no\nbackend handler and 404'd).\n\nReads from Postgres and returns a typed `UpdateApiKeyResponse` payload\n(request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_api_key","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Update an API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApiKeyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys/{id}/audit":{"get":{"tags":["api-keys"],"summary":"Returns admin api keys audit.","description":"And returns a typed `GetKeyAuditResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_key_audit","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get audit trail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetKeyAuditResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys/{id}/disable":{"post":{"tags":["api-keys"],"summary":"Disables admin api keys disable.","description":"Reads from Postgres via the audit_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"disable_api_key","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys/{id}/enable":{"post":{"tags":["api-keys"],"summary":"Enables admin api keys enable.","description":"Reads from Postgres via the audit_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"enable_api_key","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys/{id}/restrictions":{"put":{"tags":["api-keys"],"summary":"Updates admin api keys restrictions.","description":"Reads from Postgres and returns a typed `UpdateRestrictionsResponse` payload\n(request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_restrictions","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestrictionsRequest"}}},"required":true},"responses":{"200":{"description":"Update restrictions (stub - requires schema changes)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRestrictionsResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys/{id}/rotate":{"post":{"tags":["api-keys"],"summary":"Rotates admin api keys rotate.","description":"Reads from Postgres via the audit_service service and returns a typed\n`RotateApiKeyResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"rotate_api_key","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Rotate API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateApiKeyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required: this route is guarded by require_sudo_middleware. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url` naming the elevation endpoint. Elevate, then retry the original request."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys/{id}/scopes":{"put":{"tags":["api-keys"],"summary":"Updates admin api keys scopes.","description":"Reads from Postgres and returns a typed `UpdateScopesResponse` payload (request\nbody: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_scopes","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScopesRequest"}}},"required":true},"responses":{"200":{"description":"Update scopes (stub - requires schema changes)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScopesResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/api-keys/{id}/usage":{"get":{"tags":["api-keys"],"summary":"Returns admin api keys usage.","description":"And returns a typed `GetKeyUsageResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_key_usage","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get usage statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetKeyUsageResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/audio/speech":{"post":{"tags":["gateway"],"summary":"POST /v1/audio/speech","description":"Accepts a JSON body, resolves the model through the catalog, and proxies to\nthe resolved TTS serving, returning the audio binary stream.","operationId":"audio_speech","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"}}},"required":true},"responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/audio/transcriptions":{"post":{"tags":["gateway"],"summary":"POST /v1/audio/transcriptions","description":"Accepts multipart form data (file, model, language, etc.), resolves the\nmodel through the catalog, and proxies to the resolved STT serving.","operationId":"audio_transcriptions","responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/audio/translations":{"post":{"tags":["gateway"],"summary":"POST /v1/audio/translations","description":"Accepts multipart form data (file, model, prompt), resolves the model\nthrough the catalog, and proxies to the resolved serving. Translates audio\ninto English.","operationId":"audio_translations","responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/audit/decisions":{"get":{"tags":["audit"],"summary":"Returns audit decisions.","description":"Reads from Postgres and returns a typed `AuditDecisionsResponse` payload.\n\nRequires a valid bearer token.","operationId":"audit_decisions","parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `100`.\nServer-capped at `1000`.","required":false,"schema":{"type":"integer","format":"int32","nullable":true}}],"responses":{"200":{"description":"Fetch request history for Observatory page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditDecisionsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/audit/export":{"get":{"tags":["audit"],"summary":"Exports audit logs synchronously as a downloadable file.","description":"Reads the tenant-scoped audit logs (reusing the exact RBAC scoping of\n`GET /v1/audit/logs`) and streams them back as a single `json` or `csv`\nattachment. This is a *synchronous* export: the body is the export — there\nis no async job, no `export_id`, and nothing to poll. The previous handler\nreturned `NotImplemented` because the (unbuilt) async job pipeline was\nconflated with \"export\". A direct, bounded download needs none of that.\n\nRequires a valid bearer token.","operationId":"request_export","parameters":[{"name":"format","in":"query","description":"Output format: `json` (default) or `csv`.","required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/ExportFormat"}],"nullable":true}},{"name":"limit","in":"query","description":"Maximum number of records to export. Defaults to `10000`, server-capped\nat `100000`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"scope","in":"query","description":"Visibility scope: `personal` (the caller's own events, available to all\ntiers) or `organization` (org-wide, owners/admins only). Defaults to\n`organization`; non-privileged callers are downgraded to `personal`,\nexactly as in `GET /v1/audit/logs`.","required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/AuditScope"}],"nullable":true}}],"responses":{"200":{"description":"Audit log export (json array or csv attachment)"},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/audit/exports/{id}":{"get":{"tags":["audit"],"summary":"Reports the status of an asynchronous audit-log export.","description":"Xantly currently performs audit-log exports *synchronously*: `GET\n/v1/audit/export` returns the file directly. There is no async job store,\nso there is no `export_id` to look up. This endpoint exists only to give\ncallers an honest, machine-readable answer instead of a 501 that implies an\nasync feature that does not exist.\n\nRequires a valid bearer token.","operationId":"audit_exports_get_export_status","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string"}}],"responses":{"401":{"description":"Unauthenticated."},"404":{"description":"No async export jobs — exports are synchronous."}},"security":[{"bearer_auth":[]}]}},"/v1/audit/logs":{"get":{"tags":["audit"],"summary":"Returns audit logs.","description":"Reads from Postgres and returns a typed `Vec<AuditLogResponse>` payload.\n\nRequires a valid bearer token.","operationId":"get_audit_logs","parameters":[{"name":"page","in":"query","description":"Page number (1-indexed).\nDefaults to `1`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `20`.\nServer-capped at `100`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"scope","in":"query","description":"Visibility scope: `personal` (the caller's own events, available to all\ntiers) or `organization` (org-wide, owners/admins only). Defaults to\n`organization`; non-privileged callers are downgraded to `personal`.","required":false,"schema":{"allOf":[{"$ref":"#/components/schemas/AuditScope"}],"nullable":true}}],"responses":{"200":{"description":"Get audit logs.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogResponse"}}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/audit/logs/{id}":{"get":{"tags":["audit"],"summary":"Returns audit logs.","description":"Reads from Postgres and returns a typed `AuditLogResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_audit_log","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get audit log.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/.well-known/jwks.json":{"get":{"tags":["auth"],"summary":"Returns auth .well known jwks.json.","description":"Via the auth_service service and returns a typed\n`crate::services::auth::JwksResponse` payload.\n\nRequires a valid bearer token.","operationId":"jwks_endpoint","responses":{"200":{"description":"JWKS endpoint — serves our public RSA signing key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/crate.services.auth.JwksResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/.well-known/openid-configuration":{"get":{"tags":["auth"],"summary":"Returns auth .well known openid configuration.","description":"And returns a typed `OidcDiscoveryResponse` payload.\n\nRequires a valid bearer token.","operationId":"oidc_discovery","responses":{"200":{"description":"OIDC Discovery endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OidcDiscoveryResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/accept-invite":{"post":{"tags":["invitations"],"summary":"Creates auth accept invite.","description":"Reads from Postgres via the audit_service service and returns a typed\n`AcceptInviteResponse` payload (request body: `AcceptInviteRequest`).\n\nPublic — no authentication required. Mutating: writes a new row or replaces an\nexisting one.","operationId":"accept_invite","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteRequest"}}},"required":true},"responses":{"200":{"description":"Invite accepted; membership created. No session token is issued — sign in normally afterwards.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteResponse"}}}},"400":{"description":"Token expired, already used, or email mismatch."},"429":{"description":"Rate-limited."}}}},"/v1/auth/accept-invite/preview":{"post":{"tags":["invitations"],"summary":"POST /v1/auth/accept-invite/preview","description":"Validates an invite token without consuming it. Returns the metadata\nthe AcceptInvite page needs to render the right UI (inline signup vs login redirect).\n\nPublic endpoint: the token IS the credential. Rate-limited to 10 req/min per\nclient IP (via the shared Redis sliding-window limiter) to bound information\ndisclosure from leaked tokens.","operationId":"preview_invite","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewInviteRequest"}}},"required":true},"responses":{"200":{"description":"Invite metadata (email, expiry, scope) for the AcceptInvite UI.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitePreviewResponse"}}}},"400":{"description":"Token invalid or expired."},"429":{"description":"Rate-limited (10 req/min per IP)."}}}},"/v1/auth/accept-platform-invite":{"post":{"tags":["auth"],"summary":"Accept a platform admin invitation (public endpoint — no auth required).","description":"The caller must be logged in and have MFA enabled.","operationId":"accept_invitation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptPlatformInviteRequest"}}},"required":true},"responses":{"200":{"description":"Platform admin invitation accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInviteResponse"}}}},"400":{"description":"Invalid or expired invitation token."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}}}},"/v1/auth/account-recovery/cancel":{"post":{"tags":["auth"],"summary":"Creates auth account recovery cancel.","description":"Reads from Postgres via the audit_service service (request body:\n`RecoveryCancelRequest`).\n\nPublic endpoint. Mutating: writes a new row or replaces an existing one.","operationId":"recovery_cancel","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCancelRequest"}}},"required":true},"responses":{"200":{"description":"Cancel a pending recovery request using the cancel token from the notification email.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryStartResponse"}}}},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}}}},"/v1/auth/account-recovery/complete":{"post":{"tags":["auth"],"summary":"Creates auth account recovery complete.","description":"Joins Postgres state via the audit_service, email service and returns a typed\n`RecoveryCompleteResponse` payload (request body: `RecoveryCompleteRequest`).\n\nPublic endpoint. Mutating: writes a new row or replaces an existing one.","operationId":"recovery_complete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCompleteRequest"}}},"required":true},"responses":{"200":{"description":"Clear every dead second factor and force re-enrolment. Requires the emailed token AND the account password, and only after the cooling-off window.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCompleteResponse"}}}},"400":{"description":"Bad request: validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}}}},"/v1/auth/account-recovery/start":{"post":{"tags":["auth"],"summary":"Creates auth account recovery start.","description":"Joins Postgres state via the audit_service, email service and returns a typed\n`RecoveryStartResponse` payload (request body: `RecoveryStartRequest`).\n\nPublic endpoint. Mutating: writes a new row or replaces an existing one.","operationId":"recovery_start","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryStartRequest"}}},"required":true},"responses":{"202":{"description":"Recovery request accepted. Always returns the same body whether or not the address belongs to an account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryStartResponse"}}}},"400":{"description":"Bad request: validation failed."},"500":{"description":"Internal server error."}}}},"/v1/auth/account-recovery/status":{"get":{"tags":["auth"],"summary":"Returns auth account recovery status.","description":"Reads from Postgres and returns a typed `RecoveryStatusResponse` payload.\n\nPublic endpoint.","operationId":"recovery_status","parameters":[{"name":"token","in":"query","description":"Recovery token from the email link","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"State of a recovery request: waiting, ready, expired, completed or cancelled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryStatusResponse"}}}},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}}}},"/v1/auth/introspect":{"post":{"tags":["auth"],"summary":"Creates auth introspect.","description":"Reads from Redis via the auth_service service and returns a typed\n`IntrospectResponse` payload (request body: `IntrospectRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"introspect","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntrospectRequest"}}},"required":true},"responses":{"200":{"description":"Token introspection (RFC 7662)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntrospectResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/login":{"post":{"tags":["auth"],"summary":"Creates auth login.","description":"Joins Postgres and Redis state via the audit_service, auth_service, config\nservice and returns a typed `LoginResponse` payload (request body:\n`LoginRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Login with email and password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/login-otp/send":{"post":{"tags":["auth"],"summary":"Creates auth login otp send.","description":"Joins Postgres and Redis state and returns a typed `LoginOtpSendResponse`\npayload (request body: `LoginOtpSendRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"login_otp_send","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginOtpSendRequest"}}},"required":true},"responses":{"200":{"description":"Send a login OTP email. Called after password verification returns `email_otp_required`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginOtpSendResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"429":{"description":"Rate-limited."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/login-otp/verify":{"post":{"tags":["auth"],"summary":"Creates auth login otp verify.","description":"Joins Postgres and Redis state via the audit_service, auth_service, config\nservice and returns a typed `BrowserSessionResponse` payload (request body:\n`LoginOtpVerifyRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"login_otp_verify","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginOtpVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Verify a login OTP code. Creates a full session on success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserSessionResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/logout":{"post":{"tags":["auth"],"summary":"Triggers auth logout.","description":"Joins Postgres and Redis state via the auth_service, jwt_denylist_cache service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"logout","responses":{"200":{"description":"Logout."},"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/organizations":{"get":{"tags":["auth"],"summary":"Lists auth organizations.","description":"Reads from Postgres and returns a typed `Vec<OrgMembershipResponse>` payload.\n\nRequires a valid bearer token.","operationId":"list_user_organizations","responses":{"200":{"description":"returns all orgs the current user belongs to.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrgMembershipResponse"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/platform-invite/inspect":{"post":{"tags":["auth"],"summary":"Inspect a platform admin invitation token WITHOUT consuming it (public, pre-auth).","description":"Lets the accept-invite page decide what to render: a create-account form when\nthe invited email has no Xantly account yet, or a log-in prompt when it does.\nRequires possession of the single-use, unguessable invite token, so it only\never reveals the invited email — which the caller already received by email —\nplus whether that address already has an account.","operationId":"inspect_invitation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptPlatformInviteRequest"}}},"required":true},"responses":{"200":{"description":"Invitation inspected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InspectPlatformInviteResponse"}}}},"500":{"description":"Internal server error."}}}},"/v1/auth/refresh":{"post":{"tags":["auth"],"summary":"Triggers auth refresh.","description":"Reads from Postgres via the auth_service, config service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"refresh","responses":{"200":{"description":"Refresh access token"},"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/register":{"post":{"tags":["auth"],"summary":"Creates auth register.","description":"Reads from Postgres via the audit_service service and returns a typed\n`RegisterResponse` payload (request body: `RegisterRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"register","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Register a new user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse2"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Creates auth resend verification.","description":"Joins Postgres and Redis state and returns a typed `ResendVerificationResponse`\npayload (request body: `ResendVerificationRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"resend_verification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Rate-limited (3 per 10 min per email). Regenerates the OTP and sends a fresh verification email. Always returns `{ 'status': 'sent' }` to avoid email enumeration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendVerificationResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"429":{"description":"Rate-limited."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/revoke":{"post":{"tags":["auth"],"summary":"Creates auth revoke.","description":"Reads from Redis via the auth_service service and returns a typed\n`RevokeResponse` payload (request body: `RevokeRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"revoke","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeRequest"}}},"required":true},"responses":{"200":{"description":"Token revocation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/session":{"get":{"tags":["auth"],"summary":"Returns auth session.","description":"Reads from Postgres and returns a typed `BrowserSessionResponse` payload.\n\nRequires a valid bearer token.","operationId":"session","responses":{"200":{"description":"Session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserSessionResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/sessions":{"get":{"tags":["sessions"],"summary":"Lists auth sessions.","description":"Reads from Postgres and returns a typed `Vec<SessionResponse>` payload.\n\nRequires a valid bearer token.","operationId":"list_sessions","responses":{"200":{"description":"List active (non-revoked) sessions, most-recent first (capped at 100)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionResponse"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["sessions"],"summary":"Deletes auth sessions.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"revoke_all_sessions","responses":{"204":{"description":"Soft-revoke all *other* sessions for the user; the caller's current session is preserved"},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/sessions/{id}":{"delete":{"tags":["sessions"],"summary":"Deletes auth sessions.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"revoke_session","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Soft-revoke a single session"},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/set-password":{"post":{"tags":["auth"],"summary":"Allows authenticated users to set or change their password.","description":"Social login users (password_hash == \"social_login_managed\") can set a\npassword without providing a current one. Users with an existing password\nmust provide `current_password` for verification.","operationId":"set_password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Allows authenticated users to set or change their password. Social login users (password_hash == 'social_login_managed') can set a password without providing a current one. Users with an existing password must provide `current_password` for verification.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleSuccessResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/social/callback":{"get":{"tags":["auth"],"summary":"Returns auth social callback.","description":"Joins Postgres and Redis state via the auth_service, config service.\n\nRequires a valid bearer token.","operationId":"social_callback","parameters":[{"name":"code","in":"query","description":"Code.","required":true,"schema":{"type":"string"}},{"name":"state","in":"query","description":"Filter by state.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"302":{"description":"OAuth redirect — caller follows Location header to provider."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/social/{provider}":{"get":{"tags":["auth"],"summary":"Returns auth social.","description":"Via the config service and returns a typed `SocialLoginRedirectResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"social_login","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}},{"name":"dpop_jwk","in":"query","description":"Dpop jwk.","required":false,"schema":{"type":"string","nullable":true}},{"name":"invite_token","in":"query","description":"A member invitation token, when the browser arrived here straight from\nan invite link. Same meaning as on SocialLoginStartRequest.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Initiate Social Login (direct Google/GitHub OAuth)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialLoginRedirectResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/social/{provider}/start":{"post":{"tags":["auth"],"summary":"Creates auth social start.","description":"And returns a typed `SocialLoginStartResponse` payload (request body:\n`SocialLoginStartRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"social_login_start","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialLoginStartRequest"}}},"required":true},"responses":{"200":{"description":"Social login start.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SocialLoginStartResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/sudo":{"post":{"tags":["auth"],"summary":"Creates auth sudo.","description":"Reads from Postgres via the auth_service, config service and returns a typed\n`BrowserSessionResponse` payload (request body: `SudoRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"sudo_elevate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SudoRequest"}}},"required":true},"responses":{"200":{"description":"Step-up authentication: verify identity and elevate session to AAL2. Re-issues the access token with `aal=aal2` and a fresh `auth_time`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserSessionResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/sudo/status":{"get":{"tags":["auth"],"summary":"Returns auth sudo status.","description":"Reads from Postgres and returns a typed `SudoStatusResponse` payload.\n\nRequires a valid bearer token.","operationId":"sudo_status","responses":{"200":{"description":"Check the current sudo/elevation status of the session. Returns whether the session is elevated and how long until it expires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SudoStatusResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/switch-organization":{"post":{"tags":["auth"],"summary":"Creates auth switch organization.","description":"Reads from Postgres via the audit_service, auth_service service and returns a\ntyped `BrowserSessionResponse` payload (request body: `SwitchOrgRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"switch_organization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchOrgRequest"}}},"required":true},"responses":{"200":{"description":"re-issues session tokens bound to a new org.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserSessionResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/token":{"post":{"tags":["auth"],"summary":"Creates auth token.","description":"Via the auth_service service and returns a typed `TokenExchangeResponse` payload\n(request body: `TokenExchangeRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"token_exchange","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenExchangeRequest"}}},"required":true},"responses":{"200":{"description":"OAuth2 Token Exchange","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenExchangeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/trust/list":{"get":{"tags":["auth"],"summary":"Returns auth trust list.","description":"Reads from Postgres and returns a typed `TrustListResponse` payload.\n\nRequires a valid bearer token.","operationId":"trust_list","responses":{"200":{"description":"list the current user's browser trust tokens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustListResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/trust/revoke":{"post":{"tags":["auth"],"summary":"Creates auth trust revoke.","description":"Reads from Postgres and returns a typed `TrustRevokeResponse` payload (request\nbody: `TrustRevokeRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"trust_revoke","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustRevokeRequest"}}},"required":true},"responses":{"200":{"description":"revoke one or all browser trust tokens","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustRevokeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/userinfo":{"get":{"tags":["auth"],"summary":"Returns auth userinfo.","description":"Reads from Postgres and returns a typed `UserInfoResponse` payload.\n\nRequires a valid bearer token.","operationId":"user_info","responses":{"200":{"description":"Get authenticated user info","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfoResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/auth/verify-email":{"post":{"tags":["auth"],"summary":"Verifies auth verify email.","description":"Reads from Postgres via the auth_service service and returns a typed\n`BrowserSessionResponse` payload (request body: `VerifyEmailRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"verify_email","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Validates the 6-digit OTP sent during registration, marks the email as verified, and issues a full browser session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserSessionResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing":{"get":{"tags":["billing"],"summary":"Return the organization's billing summary.","description":"Reports the organization's current credit balance, plan, and whether a\npayment method is on file. Usage is prepaid: credits are drawn down at the\nexact upstream provider price for routed requests and at a flat rate for\ncache and memory hits. Scoped to the caller's own organization.","operationId":"get_billing_info","responses":{"200":{"description":"Get billing info.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInfoResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/auto-topup":{"get":{"tags":["billing"],"summary":"Returns the org's auto-recharge settings.","description":"Auto-recharge is off by default. When enabled, the balance is topped up by\nthe configured amount once it falls below the configured threshold, using\nthe payment method on file. Both values are returned in cents.","operationId":"get_auto_topup","responses":{"200":{"description":"Current auto-topup settings."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["billing"],"summary":"Configures automatic recharge for the org.","description":"When enabled and the credit balance falls below the threshold, the saved\ndefault card is charged off-session for the configured amount (plus the 3%\nplatform fee, same as a manual top-up). Requires a card saved from a prior\ncheckout.","operationId":"update_auto_topup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopUpRequest"}}},"required":true},"responses":{"200":{"description":"Auto-topup settings updated."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/budget":{"get":{"tags":["billing"],"summary":"Returns billing budget.","description":"Joins Postgres and Redis state and returns a typed `BudgetResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_budget","responses":{"200":{"description":"Get budget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/credits/transactions":{"get":{"tags":["billing"],"summary":"Returns billing credits transactions.","description":"Reads from Postgres and returns a typed `CreditTransactionsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_credit_transactions","responses":{"200":{"description":"Get credit transactions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditTransactionsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/invoices":{"get":{"tags":["billing"],"summary":"Returns billing invoices.","description":"Reads from Postgres and returns a typed `InvoicesResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_invoices","responses":{"200":{"description":"Get invoices.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicesResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/limits":{"get":{"tags":["billing"],"summary":"Returns billing limits.","description":"Reads from Postgres and returns a typed `BillingLimitsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_billing_limits","responses":{"200":{"description":"Get billing limits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingLimitsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["billing"],"summary":"Updates billing limits.","description":"Joins Postgres and Redis state and returns a typed `BillingLimitsResponse`\npayload (request body: `UpdateBillingLimitsRequest`).\n\nRequires a valid bearer token. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_billing_limits","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBillingLimitsRequest"}}},"required":true},"responses":{"200":{"description":"partial update of any of the fields above.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingLimitsResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/overage":{"patch":{"tags":["billing"],"summary":"Updates billing overage.","description":"Joins Postgres and Redis state and returns a typed `ToggleOverageResponse`\npayload (request body: `OverageToggleRequest`).\n\nRequires a valid bearer token. Mutating: partial update — only the supplied\nfields are applied.","operationId":"toggle_overage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverageToggleRequest"}}},"required":true},"responses":{"200":{"description":"Toggle overage for Pro plan. Requires Stripe payment method on file when enabling. Any org member with billing scope can toggle.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleOverageResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/plans":{"get":{"tags":["billing"],"summary":"GET /v1/billing/plans — Public endpoint returning all plan configurations.","description":"No authentication required. Used by the pricing page and landing page.\nExported as `get_plans_public` for mounting outside auth middleware in app.rs.","operationId":"get_plans_public","responses":{"200":{"description":"Success"}}}},"/v1/billing/portal":{"post":{"tags":["billing"],"summary":"Creates billing portal.","description":"And returns a typed `PortalResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_portal","responses":{"201":{"description":"Create portal.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/top-up":{"post":{"tags":["billing"],"summary":"Creates billing top up.","description":"And returns a typed `TopUpResponse` payload (request body: `TopUpRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_top_up","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpRequest"}}},"required":true},"responses":{"201":{"description":"Create top up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/billing/webhooks/stripe":{"post":{"tags":["billing"],"summary":"Triggers billing webhooks stripe.","description":"Public — no authentication required. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"stripe_webhook","requestBody":{"description":"","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"required":true},"responses":{"204":{"description":"No content."},"400":{"description":"Bad request — validation failed."}}}},"/v1/bridges":{"get":{"tags":["bridge"],"summary":"Lists bridges.","description":"And returns a typed `Vec<BridgeStatusResponse>` payload.\n\nRequires a valid bearer token.","operationId":"list_bridges","parameters":[{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"List bridges.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BridgeStatusResponse"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["bridge"],"summary":"Registers bridges.","description":"And returns a typed `BridgeRegistrationResponse` payload (request body:\n`BridgeRegistrationRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"register_bridge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeRegistrationRequest"}}},"required":true},"responses":{"201":{"description":"Register bridge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeRegistrationResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/handshake":{"post":{"tags":["bridge"],"summary":"Creates bridges handshake.","description":"Via the bridge_service service and returns a typed `HandshakeResponse` payload\n(request body: `HandshakeRequest`).\n\nPublic — no authentication required. Mutating: writes a new row or replaces an\nexisting one.","operationId":"bridges_handshake","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandshakeRequest"}}},"required":true},"responses":{"200":{"description":"Handshake.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandshakeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}}}},"/v1/bridges/{bridge_id}":{"get":{"tags":["bridge"],"summary":"Returns bridges.","description":"And returns a typed `BridgeDetailResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_bridge","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get bridge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeDetailResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["bridge"],"summary":"Updates bridges.","description":"(request body: `UpdateBridgeRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"update_bridge","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBridgeRequest"}}},"required":true},"responses":{"204":{"description":"Update bridge."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["bridge"],"summary":"Deletes bridges.","description":"Requires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_bridge","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete bridge."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/approve":{"post":{"tags":["bridge"],"summary":"Triggers bridges approve.","description":"(request body: `ApprovalRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"approve_call","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalRequest"}}},"required":true},"responses":{"204":{"description":"No content."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/audit":{"get":{"tags":["bridge"],"summary":"Returns bridges audit.","description":"And returns a typed `AuditLogsResponse` payload.\n\nRequires a valid bearer token.","operationId":"bridges_get_audit_logs","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of events to return. Defaults to\n`AUDIT_LOG_DEFAULT_LIMIT`; server-capped at `AUDIT_LOG_MAX_LIMIT`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"before","in":"query","description":"Return only events strictly before this ISO-8601 timestamp.","required":false,"schema":{"type":"string","nullable":true}},{"name":"after","in":"query","description":"Return only events at or after this ISO-8601 timestamp.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get audit logs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/calls":{"get":{"tags":["bridge"],"summary":"Lists bridges calls.","description":"And returns a typed `ListCallsResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_calls","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCallsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/calls/{call_id}":{"get":{"tags":["bridge"],"summary":"Returns bridges calls.","description":"And returns a typed `BridgeCallDetail` payload.\n\nRequires a valid bearer token.","operationId":"get_call_details","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"call_id","in":"path","description":"call_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get call details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeCallDetail"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/disconnect":{"post":{"tags":["bridge"],"summary":"Triggers bridges disconnect.","description":"(request body: `DisconnectRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"disconnect_bridge","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectRequest"}}},"required":true},"responses":{"204":{"description":"No content."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/execute":{"post":{"tags":["bridge"],"summary":"Creates bridges execute.","description":"And returns a typed `ExecuteResponse` payload (request body: `ExecuteRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"execute_tool","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Execute tool.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/health":{"get":{"tags":["bridge"],"summary":"Returns bridges health.","description":"And returns a typed `BridgeHealthResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_bridge_health","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get bridge health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeHealthResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/pending-approvals":{"get":{"tags":["bridge"],"summary":"Lists bridges pending approvals.","description":"And returns a typed `ListPendingApprovalsResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_pending_approvals","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of pending approvals to return. Defaults to\n`PENDING_APPROVALS_DEFAULT_LIMIT`; server-capped at\n`PENDING_APPROVALS_MAX_LIMIT` (max 200).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List pending approvals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPendingApprovalsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/rotate-secret":{"post":{"tags":["bridge"],"summary":"Rotates bridges rotate secret.","description":"And returns a typed `SecretRotationResponse` payload (request body:\n`SecretRotationRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"rotate_secret","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRotationRequest"}}},"required":true},"responses":{"200":{"description":"Rotate secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretRotationResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/security":{"get":{"tags":["bridge"],"summary":"Returns bridges security.","description":"And returns a typed `BridgeSecurityStatusResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_security_status","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get security status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeSecurityStatusResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["bridge"],"summary":"Updates bridges security.","description":"(request body: `serde_json::Value`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"update_security_settings","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecuritySettingsRequest"}}},"required":true},"responses":{"204":{"description":"Update security settings."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/tools":{"get":{"tags":["bridge"],"summary":"Lists bridges tools.","description":"And returns a typed `ListToolsResponse` payload.\n\nRequires a valid bearer token.","operationId":"bridges_list_tools","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of tools to return. Defaults to `TOOLS_DEFAULT_LIMIT`;\nserver-capped at `TOOLS_MAX_LIMIT` (max 200).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"cursor","in":"query","description":"Keyset cursor: return only tools whose `id` sorts after this value.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"List tools.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListToolsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["bridge"],"summary":"Registers bridges tools.","description":"Via the bridge_service service and returns a typed `RegisterToolResponse`\npayload (request body: `ToolRegistration`).\n\nPublic — no authentication required. Mutating: writes a new row or replaces an\nexisting one.","operationId":"bridges_tools_register_tool","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolRegistration"}}},"required":true},"responses":{"201":{"description":"Register tool.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterToolResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}}}},"/v1/bridges/{bridge_id}/tools/{tool_id}":{"get":{"tags":["bridge"],"summary":"Returns bridges tools.","description":"And returns a typed `ToolDetail` payload.\n\nRequires a valid bearer token.","operationId":"get_tool_details","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"tool_id","in":"path","description":"tool_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get tool details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolDetail"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["bridge"],"summary":"Updates bridges tools.","description":"(request body: `ToolRegistration`).\n\nPublic — no authentication required. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"bridges_tools_update_tool","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"tool_id","in":"path","description":"tool_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolRegistration"}}},"required":true},"responses":{"204":{"description":"Update tool."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}}},"delete":{"tags":["bridge"],"summary":"Deletes bridges tools.","description":"Public — no authentication required. Idempotent on the resource lifecycle: re-\nissuing the call after the first success is a no-op.","operationId":"bridges_tools_delete_tool","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"tool_id","in":"path","description":"tool_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete tool."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}}}},"/v1/bridges/{bridge_id}/tools/{tool_id}/stats":{"get":{"tags":["bridge"],"summary":"Returns bridges tools stats.","description":"And returns a typed `ToolStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_tool_stats","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"tool_id","in":"path","description":"tool_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get tool stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolStatsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/tools/{tool_id}/test":{"post":{"tags":["bridge"],"summary":"Creates bridges tools test.","description":"And returns a typed `ToolTestResult` payload (request body: `ToolTestRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"bridges_tools_test_tool","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}},{"name":"tool_id","in":"path","description":"tool_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolTestRequest"}}},"required":true},"responses":{"200":{"description":"Test tool.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolTestResult"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/bridges/{bridge_id}/tunnel":{"get":{"tags":["bridge"],"summary":"Returns bridges tunnel.","description":"Public — no authentication required.","operationId":"tunnel_ws","parameters":[{"name":"bridge_id","in":"path","description":"bridge_id","required":true,"schema":{"type":"string"}}],"responses":{"101":{"description":"WebSocket upgrade — bi-directional message stream."},"404":{"description":"Resource not found."}}}},"/v1/byok/providers":{"get":{"tags":["byok-providers"],"summary":"Lists byok providers.","description":"Reads from Postgres and returns a typed `Vec<BYOKProvider>` payload.\n\nRequires a valid bearer token.","operationId":"list_byok_providers","responses":{"200":{"description":"List BYOK providers","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BYOKProvider"}}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["byok-providers"],"summary":"Creates byok providers.","description":"Reads from Postgres via the config service and returns a typed `BYOKProvider`\npayload (request body: `CreateBYOKRequest`).\n\nRequires a valid bearer token. Mutating: inserts a new row. A duplicate\n`(tenant_id, provider)` is rejected with 409 rather than silently stacking\nrows, and a tenant may hold at most `MAX_PROVIDERS_PER_TENANT` rows.","operationId":"create_byok_provider","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBYOKRequest"}}},"required":true},"responses":{"201":{"description":"Add BYOK provider","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BYOKProvider"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"409":{"description":"Conflict — provider already configured for this tenant."},"413":{"description":"Payload too large — credentials exceed size limit."},"429":{"description":"Too many BYOK providers for this tenant."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/byok/providers/allocation":{"get":{"tags":["byok-providers"],"summary":"Returns byok providers allocation.","description":"Reads from Postgres and returns a typed `AllocationResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_allocation","responses":{"200":{"description":"return current BYOK allocation settings for the tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocationResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["byok-providers"],"summary":"PATCH /byok/allocation — update BYOK allocation settings for the tenant.","description":"- `byok_allocation_pct`: 0–100; 100 = all requests use BYOK key (default).\n- `monthly_spend_limit_usd`: cap on customer-key spend per calendar month.\nPass `null` to clear an existing cap.","operationId":"set_allocation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAllocationRequest"}}},"required":true},"responses":{"200":{"description":"update BYOK allocation settings for the tenant. - `byok_allocation_pct`: 0–100; 100 = all requests use BYOK key (default). - `monthly_spend_limit_usd`: cap on customer-key spend per calendar month. Pass `null` to clear an existing cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllocationResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"422":{"description":"Unprocessable entity."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/byok/providers/spend":{"get":{"tags":["byok-providers"],"summary":"Returns byok providers spend.","description":"Reads from Postgres and returns a typed `GetByokSpendResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_byok_spend","responses":{"200":{"description":"Monthly estimated BYOK cloud spend by provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetByokSpendResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/byok/providers/{id}":{"delete":{"tags":["byok-providers"],"summary":"Deletes byok providers.","description":"Reads from Postgres and returns a typed `DeleteByokProviderResponse2` payload.\n\nRequires a valid bearer token. Returns 404 when no matching row exists for the\ncaller's tenant (unknown / already-deleted / wrong-tenant id); 204 on a real\ndelete.","operationId":"delete_byok_provider","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Delete byok provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteByokProviderResponse2"}}}},"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"409":{"description":"Conflict."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["byok-providers"],"summary":"Updates byok providers.","description":"Reads from Postgres via the config service and returns a typed `BYOKProvider`\npayload (request body: `UpdateBYOKRequest`).\n\nRequires a valid bearer token. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_byok_provider","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBYOKRequest"}}},"required":true},"responses":{"200":{"description":"Update BYOK provider","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BYOKProvider"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"413":{"description":"Payload too large — credentials exceed size limit."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/byok/providers/{id}/status":{"get":{"tags":["byok-providers"],"summary":"Returns byok providers status.","description":"Reads from Postgres via the config service and returns a typed\n`CheckByokStatusResponse2` payload.\n\nRequires a valid bearer token.","operationId":"check_byok_status","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Check byok status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckByokStatusResponse2"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/cache/config":{"get":{"tags":["cache"],"summary":"Returns cache config.","description":"And returns a typed `CacheConfigResponse` payload.\n\nRequires a valid bearer token.","operationId":"cache_get_config","responses":{"200":{"description":"Get config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheConfigResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["cache"],"summary":"Updates cache config.","description":"(request body: `UpdateCacheConfigRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"cache_update_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCacheConfigRequest"}}},"required":true},"responses":{"204":{"description":"Update config."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/cache/entries":{"get":{"tags":["cache"],"summary":"Lists cache entries.","description":"And returns a typed `CacheEntriesResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_entries","parameters":[{"name":"limit","in":"query","description":"Maximum number of items to return. Server-capped at `MAX_PAGE_SIZE`.","required":false,"schema":{"type":"integer","minimum":0}},{"name":"cursor","in":"query","description":"Opaque pagination cursor returned by the previous page.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"List entries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheEntriesResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/cache/entries/{entry_id}":{"get":{"tags":["cache"],"summary":"Returns cache entries.","description":"And returns a typed `GetEntryResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_entry","parameters":[{"name":"entry_id","in":"path","description":"entry_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get entry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetEntryResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["cache"],"summary":"Deletes cache entries.","description":"Via the cache_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_entry","parameters":[{"name":"entry_id","in":"path","description":"entry_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete entry."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/cache/purge":{"post":{"tags":["cache"],"summary":"Creates cache purge.","description":"And returns a typed `CachePurgeResponse` payload (request body:\n`CachePurgeRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"purge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CachePurgeRequest"}}},"required":true},"responses":{"200":{"description":"Purge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CachePurgeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/cache/stats":{"get":{"tags":["cache"],"summary":"Returns cache stats.","description":"And returns a typed `CacheStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"cache_get_stats","responses":{"200":{"description":"Returns stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheStatsResponse"}}}},"400":{"description":"Bad request — invalid period."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/cache/warm":{"post":{"tags":["cache"],"summary":"Creates cache warm.","description":"And returns a typed `CacheWarmResponse` payload (request body:\n`CacheWarmRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"warm","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheWarmRequest"}}},"required":true},"responses":{"202":{"description":"Accepted — warm job queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheWarmResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/chains":{"get":{"tags":["chains"],"summary":"Lists chains.","description":"Reads from Redis and returns a typed `ListChainsResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_chains","parameters":[{"name":"status","in":"query","description":"Filter by status.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.","required":false,"schema":{"type":"integer","nullable":true,"minimum":0}},{"name":"offset","in":"query","description":"Number of items to skip (pagination).","required":false,"schema":{"type":"integer","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List chains.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChainsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/chains/notes":{"get":{"tags":["chains"],"summary":"Lists chains notes.","description":"Reads from Redis and returns a typed `ListChainsNotesResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_chains_notes","responses":{"200":{"description":"List chains notes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChainsNotesResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/chains/stats":{"get":{"tags":["chains"],"summary":"Returns chains stats.","description":"Reads from Redis and returns a typed `ChainStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"chain_stats","responses":{"200":{"description":"Chain stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainStatsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/chains/{chain_id}":{"get":{"tags":["chains"],"summary":"Returns chains.","description":"Reads from Redis and returns a typed `ChainDetailResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_chain","parameters":[{"name":"chain_id","in":"path","description":"chain_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get chain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainDetailResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/chains/{chain_id}/cancel":{"post":{"tags":["chains"],"summary":"Cancels chains cancel.","description":"Reads from Redis and returns a typed `ChainStateAckResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"cancel_chain","parameters":[{"name":"chain_id","in":"path","description":"chain_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancel chain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainStateAckResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/chains/{chain_id}/resume":{"post":{"tags":["chains"],"summary":"Resumes chains resume.","description":"Reads from Redis and returns a typed `ChainStateAckResponse` payload (request\nbody: `ResumePayload`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"resume_chain","parameters":[{"name":"chain_id","in":"path","description":"chain_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResumePayload"}}},"required":true},"responses":{"200":{"description":"Resume chain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainStateAckResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/chat/completions":{"post":{"tags":["gateway"],"summary":"POST /v1/chat/completions - OpenAI-compatible chat endpoint","description":"Phase 2: Routes to Groq, DeepSeek, or OpenAI based on heuristic tier","operationId":"chat_completions","responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]},"head":{"tags":["gateway"],"summary":"HEAD /v1/chat/completions - lightweight contract probe for auth/rate-limit middleware.","description":"Contract probe for the chat completions path. Runs the same authentication\nand rate-limit middleware as a real request and returns 204 with no body, so\na client can verify credentials and check its rate-limit headers without\npaying for an inference call.","operationId":"chat_completions_head","responses":{"200":{"description":"Success"}}}},"/v1/completions":{"post":{"tags":["gateway"],"summary":"POST /v1/completions","description":"Converts legacy completion requests into chat completions format,\nruns through the full routing pipeline, and converts back.","operationId":"completions","responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/compression/stats":{"get":{"tags":["compression"],"summary":"Returns compression stats.","description":"And returns a typed `GetStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"compression_get_stats","responses":{"200":{"description":"Get stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStatsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/connections":{"get":{"tags":["cloud-connections"],"summary":"Lists connections.","description":"Reads from Postgres and returns a typed `Vec<CloudConnection>` payload.\n\nRequires a valid bearer token.","operationId":"list_connections","responses":{"200":{"description":"List all cloud connections for the org.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CloudConnection"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/aws":{"post":{"tags":["cloud-connections"],"summary":"POST /v1/connections/aws (DEPRECATED): the static access-key connect path.","description":"Hard-deprecated: this flow stored long-lived access keys, its discovery did\nAssumeRole with an empty role_arn (so every connection went connecting ->\nerror), and it could never become active. Returns 410 Gone with a pointer to\nthe secure begin/complete flow so no customer can create the broken\nconnection. Kept as a mounted stub (rather than a bare 404) so an old client\ngets an actionable message.","operationId":"connect_aws_deprecated","responses":{"401":{"description":"Unauthenticated."},"410":{"description":"Static access-key flow removed; use /aws/begin + /aws/complete."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/aws/begin":{"post":{"tags":["cloud-connections"],"summary":"POST /v1/connections/aws/begin: start a secure AWS Bedrock connection.","description":"Generates a per-connection ExternalId, stores a pending byok_providers row\n(connection_flow='cloud_credits', cloud_status='pending', aws_external_id\nset, is_active=false), and returns the CloudFormation Quick-Create URL plus\nthe raw template so the frontend can offer a \"Launch Stack\" button and a\ndownload-and-upload fallback.\n\nRequires a valid bearer token. Mutating: writes a new pending row.","operationId":"begin_aws_connection","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AwsBeginRequest"}}},"required":true},"responses":{"201":{"description":"Pending connection created; deploy the CFN stack next.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudConnectAcceptedResponse"}}}},"400":{"description":"Bad request; validation failed."},"401":{"description":"Unauthenticated."},"409":{"description":"Conflict; a connection is already active or in progress."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/aws/complete":{"post":{"tags":["cloud-connections"],"summary":"POST /v1/connections/aws/complete: finish an AWS Bedrock connection.","description":"Receives the ARN of the role created by the customer's CloudFormation stack,\nvalidates it, stores { role_arn, region } encrypted + the customer account id\n+ stack id, then verifies the role before flipping to 'active': a REAL\nsts:AssumeRole with THIS connection's ExternalId, a negative control proving\nthe ExternalId is what gates the role, and bedrock:ListFoundationModels. If\nany step fails the connection is set to 'error', never 'active', and the\nanswer carries a distinct `code` naming which step and what to do about it.\nDiscovery populates cloud_connection_models on success.\n\nRequires a valid bearer token. Mutating: verifies and activates the row.","operationId":"complete_aws_connection","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AwsCompleteRequest"}}},"required":true},"responses":{"200":{"description":"Connection verified and activated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudConnectAcceptedResponse"}}}},"400":{"description":"Bad request, or verification failed for a customer-side reason (connection set to error); error.code names it."},"401":{"description":"Unauthenticated."},"404":{"description":"No pending connection; call /aws/begin first."},"500":{"description":"Internal server error."},"503":{"description":"Verification failed for a proven Xantly-side reason; the customer's stack needs no change."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/aws/preflight":{"get":{"tags":["cloud-connections"],"summary":"GET /v1/connections/aws/preflight: can this gateway assume customer roles?","description":"#457. Cloud-credits was non-functional in production because the gateway's\nown AWS identity had no `sts:AssumeRole` permission, and the only symptom was\nthat every customer connection landed in `error`. There was no way to ask the\nrunning gateway whether ITS half of the chain worked, so the fault looked\nlike N simultaneous customer misconfigurations.\n\nThis answers that question directly, by assuming a zero-permission canary\nrole in Xantly's own account whose trust policy is byte-for-byte the shape\nthe shipped CloudFormation template generates. A `healthy` verdict proves the\nidentity-based grant, root-principal delegation and the ExternalId condition\nall work, which means a customer whose connect is failing is failing on their\nown side.\n\nAuthenticated but not admin-only on purpose: a customer debugging a failed\nconnect deserves to see whether the platform is the problem. The body names\nno customer data and no credential; the gateway's own principal ARN is\nalready visible in any AccessDenied AWS returns to that customer.","operationId":"aws_preflight","responses":{"200":{"description":"Whether this gateway can assume a customer-shaped role."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/azure":{"post":{"tags":["cloud-connections"],"summary":"Creates connections azure.","description":"Reads from Postgres via the config service and returns a typed\n`CloudConnectAcceptedResponse` payload (request body: `ConnectAzureRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"connect_azure","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectAzureRequest"}}},"required":true},"responses":{"201":{"description":"Connect azure.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudConnectAcceptedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"409":{"description":"Conflict."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/azure/deploy-model":{"post":{"tags":["cloud-connections"],"summary":"Creates connections azure deploy model.","description":"Reads from Postgres via the config service and returns a typed\n`DeployAzureModelAcceptedResponse` payload (request body:\n`AzureDeployModelRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"deploy_azure_model","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AzureDeployModelRequest"}}},"required":true},"responses":{"201":{"description":"Deploy azure model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeployAzureModelAcceptedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks the cloud-connection management scope."},"404":{"description":"Resource not found."},"409":{"description":"Microsoft rejected the stored credentials, or could not be reached. Carries message, hint, code and xantlySideFault; deliberately a 4xx so the body survives the edge (#523)."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/gcp":{"post":{"tags":["cloud-connections"],"summary":"Creates connections gcp.","description":"Reads from Postgres via the config service and returns a typed\n`CloudConnectAcceptedResponse` payload (request body: `ConnectGCPRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"connect_gcp","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectGCPRequest"}}},"required":true},"responses":{"201":{"description":"Connect gcp.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudConnectAcceptedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"409":{"description":"Conflict."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/usage":{"get":{"tags":["cloud-connections"],"summary":"Returns connections usage.","description":"Reads from Postgres and returns a typed `GetUsageResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_usage","responses":{"200":{"description":"Credit usage breakdown by provider and model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUsageResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/usage/burn-rate":{"get":{"tags":["cloud-connections"],"summary":"Returns connections usage burn rate.","description":"Reads from Postgres and returns a typed `GetBurnRateResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_burn_rate","responses":{"200":{"description":"Daily burn rate estimate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBurnRateResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/{provider}":{"get":{"tags":["cloud-connections"],"summary":"Returns connections.","description":"Reads from Postgres and returns a typed `CloudConnectionDetail` payload.\n\nRequires a valid bearer token.","operationId":"get_connection","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Connection details + discovered models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudConnectionDetail"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["cloud-connections"],"summary":"Deletes connections.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"disconnect_provider","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"No content."},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks the cloud-connection management scope."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/{provider}/discover":{"post":{"tags":["cloud-connections"],"summary":"POST /v1/connections/:provider/discover — Re-run model discovery.","description":"Auto-generated response shape for documentation purposes.\nTriggers connections discover.\n\nReads from Postgres via the config service and returns a typed\n`TriggerDiscoveryResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"trigger_discovery","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Trigger discovery.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerDiscoveryResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks the cloud-connection management scope."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/{provider}/enable-model":{"post":{"tags":["cloud-connections"],"summary":"Enables connections enable model.","description":"Reads from Postgres via the config service and returns a typed\n`EnableModelAcceptedResponse` payload (request body: `EnableModelRequest`).\n\nFire and forget by design: it answers `enabling` and does the work in a\ndetached task, so the caller never learns what AWS actually said. Prefer\n`POST /v1/connections/{provider}/enable-models`, which does the same work\nsynchronously and returns a per model outcome. This endpoint stays for\ncallers already built on it.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"enable_model","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableModelRequest"}}},"required":true},"responses":{"201":{"description":"Enable model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnableModelAcceptedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Caller lacks the cloud-connection management scope."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/{provider}/enable-models":{"post":{"tags":["cloud-connections"],"summary":"Enables a set of models on the customer's own cloud account.","description":"Calls the customer's AWS account for each model (agreement offers, agreement\ncreation, availability re-read) and returns one outcome per model. Partial\nsuccess is normal and is reported as such: the response never claims a model\nwas enabled unless AWS confirmed the account is authorized AND entitled.\n\nRequires a valid bearer token and the cloud-connection management scope.\nMutating: accepts model agreements in the customer's AWS account.","operationId":"enable_models_bulk","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEnableModelsRequest"}}},"required":true},"responses":{"200":{"description":"Per model enablement outcomes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEnableModelsResponse"}}}},"400":{"description":"Bad request: empty, oversized or unsupported."},"401":{"description":"Unauthenticated."},"403":{"description":"Missing the cloud-connection management scope."},"404":{"description":"No AWS connection for this organization."},"409":{"description":"The connection is not active, or the customer's AWS account is unreachable."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/connections/{provider}/readiness":{"get":{"tags":["cloud-connections"],"summary":"Returns whether this connection can serve traffic, and what is missing.","description":"Reads from Postgres only, so it is cheap enough to poll. Builds on the\nexisting `health_status` / `health_error` signal rather than replacing it.\n\nRequires a valid bearer token.","operationId":"get_connection_readiness","parameters":[{"name":"provider","in":"path","description":"provider","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Readiness verdict with blockers and warnings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionReadiness"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"No connection for this organization."}},"security":[{"bearer_auth":[]}]}},"/v1/context/masking-config":{"get":{"tags":["context-masking"],"summary":"Lists context masking config.","description":"Reads from Redis and returns a typed `ListMaskingConfigsResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_masking_configs","responses":{"200":{"description":"List masking configs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMaskingConfigsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/context/masking-config/{tool_name}":{"put":{"tags":["context-masking"],"summary":"Replaces context masking config.","description":"Reads from Redis and returns a typed `PutMaskingConfigResponse` payload (request\nbody: `MaskingConfig`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"put_masking_config","parameters":[{"name":"tool_name","in":"path","description":"tool_name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaskingConfig"}}},"required":true},"responses":{"200":{"description":"Put masking config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutMaskingConfigResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["context-masking"],"summary":"Deletes context masking config.","description":"Reads from Redis.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_masking_config","parameters":[{"name":"tool_name","in":"path","description":"tool_name","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete masking config."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/crane/schemas":{"get":{"tags":["crane"],"summary":"Lists crane schemas.","description":"Reads from Postgres and returns a typed `ListSchemasResponse` payload.\n\nRequires a valid bearer token.","operationId":"crane_list_schemas","parameters":[{"name":"limit","in":"query","description":"Maximum number of schemas to return.\nDefaults to `50`.\nServer-capped at `100`.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"offset","in":"query","description":"Number of schemas to skip for pagination.","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List schemas.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSchemasResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/crane/validate":{"post":{"tags":["crane"],"summary":"Validates crane validate.","description":"And returns a typed `ValidateSchemaResponse` payload (request body: `Value`).\n\nRead-only: compiles the supplied schema as JSON Schema Draft 7 to check\nvalidity and discards the result. Persists nothing.\n\nRequires a valid bearer token.","operationId":"validate_schema","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Validate schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateSchemaResponse"}}}},"400":{"description":"Bad request: validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/embeddings":{"post":{"tags":["gateway"],"summary":"POST /v1/embeddings - Create embeddings","description":"OpenAI-compatible embeddings endpoint. Accepts a string or an array of\nstrings and returns vectors from the requested embedding model, routing to\nthe provider that serves it. Request and response shapes match the OpenAI\nEmbeddings API, so an existing OpenAI SDK client works unchanged against\nthis path.","operationId":"embeddings","responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/gateway/aliases":{"get":{"tags":["gateway"],"summary":"GET /v1/gateway/aliases - List model aliases","description":"Lists the organization's model aliases, each mapping a name of your choosing\nto a catalog model or a Xantly routing alias. Paginated with `limit`\n(default and server-side cap 100) and `offset`.","operationId":"list_aliases","responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]},"post":{"tags":["gateway"],"summary":"POST /v1/gateway/aliases - Create model alias","description":"Creates a model alias for the organization. The target is validated against\nthe live catalog, or against the recognised Xantly routing aliases, so an\nalias can never be saved pointing at a model the gateway cannot route to.\nAlias names are bounded to 100 characters and restricted to model-name\ncharacters.","operationId":"create_alias","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAliasRequest"}}},"required":true},"responses":{"201":{"description":"Created model alias.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayAlias"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/gateway/aliases/{alias}":{"put":{"tags":["gateway"],"summary":"PUT /v1/gateway/aliases/{alias} - Update model alias","description":"Repoints an existing alias at a different target. The new target is\nvalidated the same way as on creation, so an update cannot leave the alias\ndangling.","operationId":"update_alias","parameters":[{"name":"alias","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAliasRequest"}}},"required":true},"responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["gateway"],"summary":"DELETE /v1/gateway/aliases/{alias} - Delete model alias","description":"Removes an alias from the organization's routing table. Requests that named\nthe alias afterwards are treated as naming an unknown model.","operationId":"delete_alias","parameters":[{"name":"alias","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/governance/blocked-actions":{"get":{"tags":["governance"],"summary":"Returns governance blocked actions.","description":"And returns a typed `BlockedActionsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_blocked_actions","parameters":[{"name":"time_range","in":"query","description":"Time range.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}},{"name":"offset","in":"query","description":"Number of items to skip (pagination).","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}}],"responses":{"200":{"description":"blocked action audit trail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedActionsResponse"}}}},"401":{"description":"Unauthenticated."},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]}},"/v1/governance/config":{"put":{"tags":["governance"],"summary":"Updates governance config.","description":"Reads from Postgres and returns a typed `UpdateGovernanceConfigResponse` payload\n(request body: `UpdateGovernanceConfigRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_governance_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGovernanceConfigRequest"}}},"required":true},"responses":{"200":{"description":"update governance thresholds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGovernanceConfigResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/governance/formal-specs":{"get":{"tags":["governance"],"summary":"Lists governance formal specs.","description":"Reads from Postgres and returns a typed `ListFormalSpecsResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_formal_specs","responses":{"200":{"description":"list all formal specifications","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFormalSpecsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["governance"],"summary":"Creates governance formal specs.","description":"Reads from Postgres and returns a typed `CreateFormalSpecResponse` payload\n(request body: `CreateFormalSpecRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_formal_spec","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormalSpecRequest"}}},"required":true},"responses":{"200":{"description":"create a new formal specification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormalSpecResponse"}}}},"201":{"description":"Created."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"409":{"description":"Conflict."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/governance/formal-specs/validate":{"post":{"tags":["governance"],"summary":"Validates governance formal specs validate.","description":"Via the formal_judge service and returns a typed `ValidateSpecResponse` payload\n(request body: `ValidateSpecRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"validate_spec","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateSpecRequest"}}},"required":true},"responses":{"200":{"description":"dry-run a spec","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateSpecResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/governance/formal-specs/{spec_id}":{"get":{"tags":["governance"],"summary":"Returns governance formal specs.","description":"Reads from Postgres and returns a typed `FormalSpecResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_formal_spec","parameters":[{"name":"spec_id","in":"path","description":"spec_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"get a formal specification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormalSpecResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["governance"],"summary":"Updates governance formal specs.","description":"Reads from Postgres and returns a typed `UpdateFormalSpecResponse` payload\n(request body: `CreateFormalSpecRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_formal_spec","parameters":[{"name":"spec_id","in":"path","description":"spec_id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormalSpecRequest"}}},"required":true},"responses":{"200":{"description":"update a formal specification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFormalSpecResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["governance"],"summary":"Deletes governance formal specs.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_formal_spec","parameters":[{"name":"spec_id","in":"path","description":"spec_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"delete a formal specification"},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/governance/stats":{"get":{"tags":["governance"],"summary":"Returns governance stats.","description":"Via the governance_stats service and returns a typed `GateStatsResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"get_gate_stats","parameters":[{"name":"time_range","in":"query","description":"Time range.","required":false,"schema":{"type":"string","nullable":true}},{"name":"tool_name","in":"query","description":"Tool name.","required":false,"schema":{"type":"string","nullable":true}},{"name":"verdict","in":"query","description":"Verdict.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.","required":false,"schema":{"type":"integer","format":"int32","nullable":true,"minimum":0}}],"responses":{"200":{"description":"gate pass/fail statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GateStatsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/governance/tools":{"get":{"tags":["governance"],"summary":"Lists governance tools.","description":"Via the governance service and returns a typed `ListToolsResponse` payload.\n\nRequires a valid bearer token.","operationId":"governance_list_tools","responses":{"200":{"description":"list all registered tools for the tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListToolsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["governance"],"summary":"Registers governance tools.","description":"And returns a typed `RegisterToolResponse` payload (request body:\n`RegisterToolRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"governance_tools_register_tool","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterToolRequest"}}},"required":true},"responses":{"201":{"description":"Tool registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterToolResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/governance/tools/{name}/risk-level":{"put":{"tags":["governance"],"summary":"Updates governance tools risk level.","description":"Via the governance service and returns a typed `UpdateRiskLevelResponse` payload\n(request body: `UpdateRiskLevelRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_risk_level","parameters":[{"name":"name","in":"path","description":"name","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRiskLevelRequest"}}},"required":true},"responses":{"200":{"description":"update risk level","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRiskLevelResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/governance/verify":{"post":{"tags":["governance"],"summary":"Creates governance verify.","description":"Reads from Postgres and returns a typed `ManualVerifyResponse` payload (request\nbody: `ManualVerifyRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"manual_verify","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualVerifyRequest"}}},"required":true},"responses":{"200":{"description":"manually verify a tool call","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualVerifyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"422":{"description":"Unprocessable entity."}},"security":[{"bearer_auth":[]}]}},"/v1/hedging/stats":{"get":{"tags":["hedging"],"summary":"Returns hedging stats for the authenticated organization.","description":"Aggregates per-org hedging counters and latency/cost metrics over the\ntrailing 24-hour window; returns zeros when no rows exist for that period.\n\nRequires a valid bearer token.","operationId":"get_v1_hedging_stats","responses":{"200":{"description":"Get REAL hedging statistics from database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HedgingStats"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/images/generations":{"post":{"tags":["gateway"],"summary":"POST /v1/images/generations","description":"Resolves the model through the catalog and proxies to the resolved serving\n(legacy OpenAI proxy only when non-Bedrock providers are admitted).","operationId":"image_generations","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageGenerationRequest"}}},"required":true},"responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/logs":{"get":{"tags":["logs"],"summary":"Lists request logs for the caller's organization.","description":"Backed by `gateway_requests` (every routed request is one log line),\nmapped into the Mission Control log shape and ordered newest-first.\n\nRequires a valid bearer token.","operationId":"list_logs","parameters":[{"name":"level","in":"query","description":"Filter by level: info | warn | error | debug.","required":false,"schema":{"type":"string","nullable":true}},{"name":"service","in":"query","description":"Filter by service (the upstream provider, e.g. \"openai\").","required":false,"schema":{"type":"string","nullable":true}},{"name":"q","in":"query","description":"Free-text search over model / provider / endpoint / message.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Max rows to return (default 500, capped at 1000).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List logs.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LogEntry"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/cache/stats":{"get":{"tags":["mcp"],"summary":"Returns mcp cache stats.","description":"Reads from Redis and returns a typed `GetMcpCacheStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_mcp_cache_stats","responses":{"200":{"description":"MCP Cache Statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMcpCacheStatsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/capabilities":{"get":{"tags":["mcp"],"summary":"Returns mcp capabilities.","description":"Reads from Redis and returns a typed `McpCapabilities` payload.\n\nRequires a valid bearer token.","operationId":"get_capabilities","parameters":[{"name":"provider","in":"query","description":"Filter by provider (e.g. openai, anthropic).","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get MCP tools from database or cache","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpCapabilities"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/handshake":{"post":{"tags":["mcp"],"summary":"Creates mcp handshake.","description":"Reads from Redis and returns a typed `HandshakeResponse` payload (request body:\n`HandshakeRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"mcp_handshake","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandshakeRequest"}}},"required":true},"responses":{"200":{"description":"Initiate MCP handshake with server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandshakeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/health":{"get":{"tags":["mcp"],"summary":"Returns mcp health.","description":"Reads from Redis and returns a typed `HealthCheckResponse` payload.\n\nPublic — no authentication required.","operationId":"health_check","responses":{"200":{"description":"Health check for MCP gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheckResponse"}}}},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/memory/recall":{"post":{"tags":["mcp-memory"],"summary":"Recalls mcp memory.","description":"And returns a typed `McpMemoryRecallResponse` payload (request body:\n`McpMemoryRecallRequest`).\n\nRequires a valid bearer token. Read-only: retrieves stored conversation\ncontext without mutating any state.","operationId":"memory_recall","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMemoryRecallRequest"}}},"required":true},"responses":{"200":{"description":"Retrieves the full conversation context for a given conversation ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMemoryRecallResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/memory/search":{"post":{"tags":["mcp-memory"],"summary":"Searches mcp memory.","description":"And returns a typed `McpMemorySearchResponse` payload (request body:\n`McpMemorySearchRequest`).\n\nRequires a valid bearer token. Read-only: performs a semantic search and\nreturns matches without mutating any state.","operationId":"memory_search","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMemorySearchRequest"}}},"required":true},"responses":{"200":{"description":"Semantic search across L2 (vector) and graph memory layers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMemorySearchResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/memory/store":{"post":{"tags":["mcp-memory"],"summary":"Creates mcp memory store.","description":"And returns a typed `McpMemoryStoreResponse` payload (request body:\n`McpMemoryStoreRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"memory_store","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMemoryStoreRequest"}}},"required":true},"responses":{"201":{"description":"Stores content in L2 (vector) memory and triggers entity extraction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpMemoryStoreResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/tools/cache/invalidate":{"post":{"tags":["mcp"],"summary":"Creates mcp tools cache invalidate.","description":"Reads from Redis and returns a typed `InvalidateCacheResponse2` payload (request\nbody: `InvalidateRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"mcp_tools_invalidate_cache","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidateRequest"}}},"required":true},"responses":{"200":{"description":"Invalidate cache.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidateCacheResponse2"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/tools/call":{"post":{"tags":["mcp"],"summary":"Creates mcp tools call.","description":"And returns a typed `ToolCallResponse` payload (request body:\n`ToolCallRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"call_tool","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCallRequest"}}},"required":true},"responses":{"200":{"description":"Execute tool via MCP","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCallResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/tools/embeddings/refresh":{"post":{"tags":["mcp"],"summary":"Creates mcp tools embeddings refresh.","description":"And returns a typed `RefreshEmbeddingsResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"refresh_embeddings","responses":{"200":{"description":"Force refresh of embeddings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshEmbeddingsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/tools/embeddings/status":{"get":{"tags":["mcp"],"summary":"Returns mcp tools embeddings status.","description":"And returns a typed `GetEmbeddingsStatusResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_embeddings_status","responses":{"200":{"description":"Embedding Model Status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetEmbeddingsStatusResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/tools/invoke":{"post":{"tags":["mcp"],"summary":"Creates mcp tools invoke.","description":"And returns a typed `ToolCallResponse` payload (request body:\n`ToolCallRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"invoke_tool","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCallRequest"}}},"required":true},"responses":{"200":{"description":"Direct tool invocation (RPC wrapper)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCallResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/tools/rerank":{"post":{"tags":["mcp"],"summary":"Creates mcp tools rerank.","description":"And returns a typed `ToolSearchResult` payload (request body:\n`ToolSearchQuery`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"rerank_tools_endpoint","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolSearchQuery"}}},"required":true},"responses":{"200":{"description":"Standalone Reranker Endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolSearchResult"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/mcp/tools/search":{"get":{"tags":["mcp"],"summary":"Returns mcp tools search.","description":"And returns a typed `ToolSearchResult` payload.\n\nRequires a valid bearer token.","operationId":"search_tools","parameters":[{"name":"q","in":"query","description":"Free-text search query.","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `5`.","required":false,"schema":{"type":"integer","nullable":true,"minimum":0}}],"responses":{"200":{"description":"Semantic search with REAL ToolReranker","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolSearchResult"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/memory":{"get":{"tags":["memory"],"summary":"Returns memory.","description":"And returns a typed `SearchMemoryResponse` payload.\n\nRequires a valid bearer token.","operationId":"search_memory_query","parameters":[{"name":"q","in":"query","description":"Free-text search query.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return.\nDefaults to `10`.","required":false,"schema":{"type":"integer","nullable":true,"minimum":0}},{"name":"query","in":"query","description":"Free-text search query.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Search memory query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMemoryResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["memory"],"summary":"Creates memory.","description":"And returns a typed `StoreMemoryResponse` payload (request body:\n`StoreMemoryRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"store_memory","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreMemoryRequest"}}},"required":true},"responses":{"201":{"description":"Store memory.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreMemoryResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/analytics":{"get":{"tags":["analytics-memory"],"summary":"Returns memory analytics.","description":"And returns a typed `MemoryAnalyticsResponse` payload.\n\nRequires a valid bearer token.","operationId":"memory_analytics","parameters":[{"name":"period","in":"query","description":"Period shorthand: \"24h\", \"7d\", \"30d\" (default: \"24h\").","required":false,"schema":{"type":"string","nullable":true}},{"name":"from","in":"query","description":"Explicit start (ISO-8601). Overrides `period` when paired with `to`.","required":false,"schema":{"type":"string","nullable":true}},{"name":"to","in":"query","description":"Explicit end (ISO-8601). Overrides `period` when paired with `from`.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Returns analytics for the memory subsystem over the requested period. When `XANTLY_FF_ANALYTICS_V2` == 'true', returns the abstract V2 shape (no internal layer names). Otherwise returns the legacy L0/L1/L2/L3 shape.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryAnalyticsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/bulk":{"post":{"tags":["memory"],"summary":"Creates memory bulk.","description":"And returns a typed `BulkImportResponse` payload (request body:\n`BulkImportRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"bulk_import","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkImportRequest"}}},"required":true},"responses":{"201":{"description":"Bulk import.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkImportResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/clear":{"delete":{"tags":["memory"],"summary":"Deletes memory clear.","description":"And returns a typed `ClearMemoryResponse` payload (request body:\n`ClearMemoryRequest`).\n\nRequires a valid bearer token. Mutating: the resource is removed (or marked\ndeleted) on success.","operationId":"clear_memories","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearMemoryRequest"}}},"required":true},"responses":{"200":{"description":"Clear memories.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearMemoryResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/context":{"get":{"tags":["memory"],"summary":"Returns memory context.","description":"And returns a typed `MemoryContextResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_context_query","responses":{"200":{"description":"Returns context query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryContextResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller is not a control-plane admin."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/context/{request_id}":{"get":{"tags":["memory"],"summary":"Returns memory context.","description":"And returns a typed `MemoryContextResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_context","parameters":[{"name":"request_id","in":"path","description":"request_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryContextResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/entities":{"get":{"tags":["graph"],"summary":"Lists memory entities.","description":"And returns a typed `EntitiesListResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_entities","parameters":[{"name":"type","in":"query","description":"Entity type.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Maximum number of items to return. Server-capped at `MAX_PAGE_SIZE`.","required":false,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"List entities.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitiesListResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["graph"],"summary":"Creates memory entities.","description":"And returns a typed `CreateEntityResponse` payload (request body:\n`CreateEntityRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_entity","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEntityRequest"}}},"required":true},"responses":{"201":{"description":"Create entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEntityResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/entities/{entity_id}":{"put":{"tags":["graph"],"summary":"Updates memory entities.","description":"Via the graph_service service (request body: `UpdateEntityRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"update_entity","parameters":[{"name":"entity_id","in":"path","description":"entity_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEntityRequest"}}},"required":true},"responses":{"204":{"description":"Update entity."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["graph"],"summary":"Deletes memory entities.","description":"Requires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_entity","parameters":[{"name":"entity_id","in":"path","description":"entity_id","required":true,"schema":{"type":"string"}},{"name":"cascade","in":"query","description":"Cascade.","required":false,"schema":{"type":"boolean"}}],"responses":{"204":{"description":"Delete entity."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/entities/{entity_id}/relationships":{"get":{"tags":["graph"],"summary":"Returns memory entities relationships.","description":"And returns a typed `EntityRelationshipsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_relationships","parameters":[{"name":"entity_id","in":"path","description":"entity_id","required":true,"schema":{"type":"string"}},{"name":"direction","in":"query","description":"Direction.","required":false,"schema":{"type":"string","nullable":true}},{"name":"type","in":"query","description":"Rel type.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Get relationships.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityRelationshipsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/export":{"post":{"tags":["memory"],"summary":"Creates memory export.","description":"And returns a typed `ExportMemoryResponse` payload (request body:\n`ExportMemoryRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"export_memory","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportMemoryRequest"}}},"required":true},"responses":{"201":{"description":"Export memory.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportMemoryResponse"}}}},"202":{"description":"Accepted."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/export/sync":{"post":{"tags":["memory"],"summary":"Creates memory export sync.","description":"Reads from Redis and streams the L1 conversations back as newline-delimited\nJSON (`application/x-ndjson`) — NOT a single JSON object (request body:\n`ExportMemoryRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"export_memory_sync","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportMemoryRequest"}}},"required":true},"responses":{"200":{"description":"Sync streaming fast-path: directly returns L1 conversations as newline-delimited JSON (one JSON object per line; the first line is an `_meta` header — see ExportMemorySyncResponse for per-line field semantics). For small tenants — no R2 storage, no worker queue, no polling needed. Limits: - 25-second hard timeout (Cloudflare LB kills at 30s) - 50 MB max response body - L1 conversations only (L2/L3 require async path for scroll semantics) If limits exceeded, returns 413 pointing to async POST /v1/memory/export.","content":{"application/x-ndjson":{"schema":{"type":"string"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/exports/{export_id}":{"get":{"tags":["memory"],"summary":"Returns memory exports.","description":"And returns a typed `ExportStatusResponse` payload.\n\nRequires a valid bearer token.","operationId":"memory_exports_get_export_status","parameters":[{"name":"export_id","in":"path","description":"export_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get export status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportStatusResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/graph/query":{"post":{"tags":["graph"],"summary":"Executes a read-only graph (Cypher) query.","description":"Via the graph_service service and returns a typed `GraphQueryResponse` payload\n(request body: `GraphQueryRequest`).\n\nRequires a valid bearer token and control-plane admin privileges. Read-only:\nthe service rejects mutating Cypher via a read-only opening-token allowlist, so\nno rows are written or replaced. Closes audit P3 be-graph-11.","operationId":"execute_query","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphQueryRequest"}}},"required":true},"responses":{"200":{"description":"Creates execute query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphQueryResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller is not a control-plane admin."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/health":{"get":{"tags":["analytics-memory"],"summary":"Returns memory health.","description":"Via the graph_memory service and returns a typed `MemoryHealthScore` payload.\n\nRequires a valid bearer token.","operationId":"memory_health","responses":{"200":{"description":"Returns the current health score for the tenant's memory subsystem.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryHealthScore"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/import":{"post":{"tags":["memory"],"summary":"Creates memory import.","description":"And returns a typed `ImportMemoryResponse` payload (request body:\n`ImportMemoryRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"import_memory","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportMemoryRequest"}}},"required":true},"responses":{"201":{"description":"Import memory.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportMemoryResponse"}}}},"202":{"description":"Accepted."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/relationships":{"post":{"tags":["graph"],"summary":"Creates memory relationships.","description":"And returns a typed `CreateRelationshipResponse` payload (request body:\n`CreateRelationshipRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_relationship","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRelationshipRequest"}}},"required":true},"responses":{"201":{"description":"Create relationship.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRelationshipResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/relationships/{relationship_id}":{"delete":{"tags":["graph"],"summary":"Deletes memory relationships.","description":"Requires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_relationship","parameters":[{"name":"relationship_id","in":"path","description":"relationship_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete relationship."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/search":{"post":{"tags":["memory"],"summary":"Creates memory search.","description":"And returns a typed `SearchMemoryResponse` payload (request body:\n`SearchMemoryRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"search_memory","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMemoryRequest"}}},"required":true},"responses":{"200":{"description":"Search memory.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMemoryResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/stats":{"get":{"tags":["memory"],"summary":"Returns memory stats.","description":"Via the memory_service service and returns a typed `MemoryStatsResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"memory_get_stats","responses":{"200":{"description":"Get stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryStatsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/webhooks":{"get":{"tags":["memory-webhooks"],"summary":"Lists memory webhooks.","description":"And returns a typed `Vec<WebhookSummary>` payload.\n\nRequires a valid bearer token.","operationId":"memory_list_webhooks","responses":{"200":{"description":"List all registered memory webhooks for the tenant.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSummary"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["memory-webhooks"],"summary":"Registers memory webhooks.","description":"And returns a typed `RegisterWebhookResponse` payload (request body:\n`RegisterWebhookRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"register_webhook","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterWebhookRequest"}}},"required":true},"responses":{"201":{"description":"Register a new memory webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterWebhookResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/webhooks/events":{"get":{"tags":["memory-webhooks"],"summary":"Lists memory webhooks events.","description":"And returns a typed `Vec<String>` payload.\n\nPublic — no authentication required.","operationId":"list_events","responses":{"200":{"description":"List available memory event types.","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/webhooks/{id}":{"delete":{"tags":["memory-webhooks"],"summary":"Deletes memory webhooks.","description":"Requires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"memory_webhooks_delete_webhook","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Delete a memory webhook."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/memory/{memory_id}":{"get":{"tags":["memory"],"summary":"Returns memory.","description":"And returns a typed `MemoryEntryResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_memory","parameters":[{"name":"memory_id","in":"path","description":"memory_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get memory.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryEntryResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["memory"],"summary":"Updates memory.","description":"(request body: `UpdateMemoryRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"update_memory","parameters":[{"name":"memory_id","in":"path","description":"memory_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemoryRequest"}}},"required":true},"responses":{"204":{"description":"Update memory."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["memory"],"summary":"Deletes memory.","description":"Requires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_memory","parameters":[{"name":"memory_id","in":"path","description":"memory_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete memory."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/messages":{"post":{"tags":["gateway"],"summary":"POST /v1/messages — Anthropic Messages API compatible endpoint.","description":"Thin adapter over `chat_completions`. See module docs above for the\ninvariants.","operationId":"messages","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessagesRequest"}}},"required":true},"responses":{"200":{"description":"Success. Request body is `AnthropicMessagesRequest` (model, messages, max_tokens, optional system/tools/tool_choice/stream). Response is `AnthropicMessagesResponse` (non-streaming), or an Anthropic SSE event stream (`text/event-stream`) when `stream: true`."},"400":{"description":"Bad request — malformed Messages body or validation failure. `AnthropicErrorResponse` with `error.type = \"invalid_request_error\"`."},"401":{"description":"Unauthenticated — missing or invalid API key (`Authorization: Bearer` or `x-api-key`). `AnthropicErrorResponse` with `error.type = \"authentication_error\"`."},"429":{"description":"Rate limited or budget exhausted. `AnthropicErrorResponse` with `error.type = \"rate_limit_error\"`."},"500":{"description":"Internal server error. `AnthropicErrorResponse` with `error.type = \"api_error\"`."}},"security":[{"bearer_auth":[]}]}},"/v1/models":{"get":{"tags":["models"],"summary":"Lists models.","description":"Via the model_catalog_cache service and returns a typed `ListModelsResponse`\npayload.\n\nPublic — no authentication required.","operationId":"list_models","responses":{"200":{"description":"List models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListModelsResponse"}}}},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/models/config":{"get":{"tags":["models"],"summary":"GET /v1/models/config - List all models with configuration","description":"Tries to enrich from model_catalog (which has context_window, capabilities, etc.)\nfalling back to model_registry for backwards compatibility.","operationId":"get_model_config","responses":{"200":{"description":"List all models with configuration Tries to enrich from model_catalog (which has context_window, capabilities, etc.) falling back to model_registry for backwards compatibility.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelConfigResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/models/{model_id}":{"get":{"tags":["models"],"summary":"Returns models.","description":"Via the model_catalog_cache service and returns a typed `Model` payload.\n\nPublic — no authentication required.","operationId":"retrieve_model","parameters":[{"name":"model_id","in":"path","description":"Model id; contains slashes","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Retrieve a specific model (OpenAI-compatible)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"404":{"description":"Unknown model id (`model_not_found` envelope)."}},"security":[{"bearer_auth":[]}]}},"/v1/moderations":{"post":{"tags":["gateway"],"summary":"POST /v1/moderations","description":"Resolves the model through the catalog and proxies to the resolved serving\n(legacy OpenAI proxy only when non-Bedrock providers are admitted).","operationId":"moderations","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationRequest"}}},"required":true},"responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/organizations/invitations":{"get":{"tags":["invitations"],"summary":"Lists organizations invitations.","description":"Reads from Postgres and returns a typed `Vec<InvitationResponse>` payload.\n\nRequires a valid bearer token.","operationId":"organizations_list_invitations","responses":{"200":{"description":"List invitations.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvitationResponse"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["invitations"],"summary":"Creates organizations invitations.","description":"Reads from Postgres via the audit_service service and returns a typed\n`CreateInviteResponse` payload (request body: `CreateInviteRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_invite","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteRequest"}}},"required":true},"responses":{"200":{"description":"Create invite.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/organizations/invitations/{id}":{"delete":{"tags":["invitations"],"summary":"Deletes organizations invitations.","description":"Reads from Postgres via the audit_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"revoke_invite","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Revoke invite."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/organizations/invitations/{id}/resend":{"post":{"tags":["invitations"],"summary":"Creates organizations invitations resend.","description":"Reads from Postgres via the audit_service service and returns a typed\n`ResendInviteResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"resend_invite","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Resend invite.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendInviteResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/organizations/members":{"get":{"tags":["team"],"summary":"Lists organizations members.","description":"Reads from Postgres and returns a typed `Vec<TeamMemberResponse>` payload.\n\nRequires a valid bearer token.","operationId":"organizations_list_members","parameters":[{"name":"limit","in":"query","description":"Max rows per page (1..=500, default 500).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}},{"name":"offset","in":"query","description":"Rows to skip for pagination (default 0).","required":false,"schema":{"type":"integer","format":"int64","nullable":true,"minimum":0}}],"responses":{"200":{"description":"List members.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamMemberResponse"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/organizations/members/{id}":{"delete":{"tags":["team"],"summary":"Deletes organizations members.","description":"Reads from Postgres via the audit_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"organizations_members_remove_member","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Remove member."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["team"],"summary":"Changes a member's role within the caller's organization.","description":"Mutating: validates the requested role against `OrgRole`, checks the caller\nmay grant it (`authorize_role_grant`), then atomically updates `users.role`,\nupserts the `organization_memberships` row, and bumps `organizations.authz_version`\nso the permission cache invalidates. Guards against demoting the last owner and\nwrites a `member.role_changed` audit record. Returns the updated\n`TeamMemberResponse` (request body: `UpdateRoleRequest`).\n\nRequires a valid bearer token.","operationId":"update_member","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoleRequest"}}},"required":true},"responses":{"200":{"description":"Update member.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/organizations/{id}":{"get":{"tags":["organizations"],"summary":"Returns an organization by id.","description":"Reads from Postgres and returns a typed `OrganizationDetail` payload.\n\nRequires a valid bearer token.","operationId":"get_organization","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDetail"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["organizations"],"summary":"Updates an organization.","description":"Reads from Postgres and returns a typed `OrganizationDetail` payload (request\nbody: `UpdateOrganizationRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_organization","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrganizationRequest"}}},"required":true},"responses":{"200":{"description":"Update organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationDetail"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["organizations"],"summary":"Deletes an organization.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_organization","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Delete organization."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/planning/config":{"get":{"tags":["planning"],"summary":"Returns planning config.","description":"Reads from Postgres and returns a typed `PlanningConfigResponse` payload.\n\nRequires a valid bearer token.","operationId":"planning_get_config","responses":{"200":{"description":"Get config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanningConfigResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["planning"],"summary":"Updates planning config.","description":"Reads from Postgres and returns a typed `PlanningConfigResponse` payload\n(request body: `UpdatePlanningConfigRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"planning_update_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePlanningConfigRequest"}}},"required":true},"responses":{"200":{"description":"Update config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanningConfigResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/planning/simulate":{"post":{"tags":["planning"],"summary":"Creates planning simulate.","description":"Via the config service and returns a typed `SimulateChainResponse` payload\n(request body: `SimulatePlanRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"simulate_chain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatePlanRequest"}}},"required":true},"responses":{"200":{"description":"Simulate chain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateChainResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/planning/trajectories":{"get":{"tags":["planning"],"summary":"Lists planning trajectories.","description":"And returns a typed `ListTrajectoriesResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_trajectories","responses":{"200":{"description":"List trajectories.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTrajectoriesResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/policies":{"get":{"tags":["policies"],"summary":"Lists the calling organization's policies.","description":"Reads from Postgres and returns a typed `Vec<PolicyResponse>` payload.\n\nRequires a valid bearer token. The previous doc line here claimed this\nendpoint was public and unauthenticated, which was never true: it is nested\nunder the authenticated router in `app.rs` and is not in the public\nallowlist. The handler nevertheless took no `AuthUser` and returned EVERY\norg's policies to any authenticated caller.","operationId":"list_policies","responses":{"200":{"description":"List policies.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyResponse"}}}}},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["policies"],"summary":"Creates policies.","description":"Via the audit_service service and returns a typed `PolicyResponse` payload\n(request body: `CreatePolicyRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"policies_create_policy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePolicyRequest"}}},"required":true},"responses":{"200":{"description":"Create policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/policies/evaluate":{"post":{"tags":["policies"],"summary":"Creates policies evaluate.","description":"Reads from Postgres and returns a typed `EvaluatePolicyResponse` payload\n(request body: `EvaluatePolicyRequest`).\n\nPublic — no authentication required. Mutating: writes a new row or replaces an\nexisting one.","operationId":"evaluate_policy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatePolicyRequest"}}},"required":true},"responses":{"200":{"description":"Evaluate policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluatePolicyResponse"}}}},"400":{"description":"Bad request — validation failed."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/policies/{id}":{"delete":{"tags":["policies"],"summary":"Deletes policies.","description":"Reads from Postgres via the audit_service service and returns a typed\n`DeletePolicyResponse` payload.\n\nRequires a valid bearer token. Mutating: the resource is removed (or marked\ndeleted) on success.","operationId":"delete_policy","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Delete policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePolicyResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/projects":{"get":{"tags":["multi-project"],"summary":"Lists projects.","description":"Reads from Postgres and returns a typed `Vec<Project>` payload. Results are\nkeyset-paginated on `created_at` (newest first): pass `?limit=` and the\n`cursor=` (the last item's `created_at`) to page through large tenants.\n\nRequires a valid bearer token.","operationId":"list_projects","parameters":[{"name":"limit","in":"query","description":"Maximum number of projects to return. Defaults to `100`, hard-capped at\n`500` so a tenant with thousands of projects can't pull the whole set in\none call.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"cursor","in":"query","description":"Keyset cursor: pass the `created_at` of the last project from the\nprevious page to fetch the next (older) page. Omit for the first page.","required":false,"schema":{"type":"string","format":"date-time","nullable":true}}],"responses":{"200":{"description":"List all projects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["multi-project"],"summary":"Creates projects.","description":"Reads from Postgres and returns a typed `Project` payload (request body:\n`CreateProjectRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_project","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}},"required":true},"responses":{"201":{"description":"Create new project","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/projects/{id}":{"patch":{"tags":["multi-project"],"summary":"Updates projects.","description":"Reads from Postgres and returns a typed `Project` payload (request body:\n`UpdateProjectRequest`).\n\nRequires a valid bearer token. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_project","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectRequest"}}},"required":true},"responses":{"200":{"description":"Update project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/projects/{id}/api-keys":{"post":{"tags":["multi-project"],"summary":"Creates projects api keys.","description":"Generates the key, stores only its hash, and returns the plaintext exactly\nonce in a `CreatedApiKeyResponse` body — the caller must save it now.\n\nRequires a valid bearer token. Mutating: writes a new row.","operationId":"create_project_api_key","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Create project-specific API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedApiKeyResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/projects/{id}/usage":{"get":{"tags":["multi-project"],"summary":"Returns projects usage.","description":"Reads from Postgres and returns a typed `ProjectUsage` payload.\n\nRequires a valid bearer token.","operationId":"get_project_usage","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get project usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUsage"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/prompts":{"get":{"tags":["prompts"],"summary":"Lists prompts.","description":"Reads from Postgres and returns a typed `Vec<PromptResponse>` payload.\n\nRequires a valid bearer token.","operationId":"list_prompts","responses":{"200":{"description":"List all prompts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PromptResponse"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["prompts"],"summary":"Creates prompts.","description":"And returns a typed `PromptResponse` payload (request body:\n`CreatePromptRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_prompt","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromptRequest"}}},"required":true},"responses":{"200":{"description":"Create a new prompt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/providers":{"get":{"tags":["providers"],"summary":"Lists providers.","description":"Reads from Postgres and returns a typed `Vec<ProviderResponse>` payload.\n\nRequires a valid bearer token.","operationId":"list_providers","responses":{"200":{"description":"List provider credentials (masked)","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProviderResponse"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["providers"],"summary":"Creates providers.","description":"And returns a typed `ProviderResponse` payload (request body:\n`AddProviderRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"add_provider","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddProviderRequest"}}},"required":true},"responses":{"201":{"description":"Add a new provider credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/providers/{id}":{"delete":{"tags":["providers"],"summary":"Deletes providers.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_provider","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Delete a provider credential"},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/reliability/config":{"put":{"tags":["reliability"],"summary":"Updates reliability config.","description":"Reads from Postgres and returns a typed `UpdateConfigResponse` payload (request\nbody: `ReliabilityConfigUpdate`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"reliability_update_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReliabilityConfigUpdate"}}},"required":true},"responses":{"200":{"description":"update reliability settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConfigResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/reliability/recoveries":{"get":{"tags":["reliability"],"summary":"Lists reliability recoveries.","description":"And returns a typed `ListRecoveriesResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_recoveries","responses":{"200":{"description":"list recent recovery actions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRecoveriesResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/reliability/stats":{"get":{"tags":["reliability"],"summary":"Returns reliability stats.","description":"And returns a typed `GetStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"reliability_get_stats","parameters":[{"name":"time_range","in":"query","description":"Time range.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"get reliability metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetStatsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/responses":{"post":{"tags":["gateway"],"summary":"POST /v1/responses - OpenAI Responses API compatible endpoint","description":"OpenAI-compatible Responses API endpoint, for SDK versions that default to\n`/v1/responses` rather than `/v1/chat/completions`. Supports the same\nrouting, caching, memory and failover behaviour as chat completions,\nincluding streaming.","operationId":"responses","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}},"required":true},"responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/routing/agentic-config":{"get":{"tags":["Routing"],"summary":"Returns routing agentic config.","description":"And returns a typed `AgenticDetectorConfig` payload.\n\nRequires a valid bearer token.","operationId":"get_agentic_config","responses":{"200":{"description":"Current agentic detector config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticDetectorConfig"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["Routing"],"summary":"PATCH /v1/routing/agentic-config — Partially update the live agentic detector config.","description":"Admin-only. All fields are optional; unspecified fields are unchanged.\nChanges take effect immediately for all subsequent requests without a server restart.\nEffective threshold range for confidence_threshold: [0.0, 1.0].","operationId":"patch_agentic_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticConfigPatch"}}},"required":true},"responses":{"200":{"description":"Updated config","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticDetectorConfig"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Admin scope required"}},"security":[{"bearer_auth":[]}]}},"/v1/routing/analyze":{"post":{"tags":["Routing"],"summary":"POST /v1/routing/analyze - Alias for simulate with full detail","description":"Scores a candidate request through the routing pipeline and returns the full\ndecision detail: the signals extracted, the models considered, and why the\nwinner was chosen. Analysis only, no inference is performed and nothing is\nbilled. Equivalent to the simulate endpoint with full detail requested.","operationId":"analyze_signal","requestBody":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateRequest"}}},"required":true},"responses":{"200":{"description":"Success"}},"security":[{"bearer_auth":[]}]}},"/v1/routing/barp/dial":{"patch":{"tags":["barp"],"summary":"Updates routing barp dial.","description":"Via the barp_router service and returns a typed `PreferenceDialUpdateResponse`\npayload (request body: `UpdateDialRequest`).\n\nRequires a valid bearer token. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_barp_dial","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDialRequest"}}},"required":true},"responses":{"200":{"description":"Update the preference dial for the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferenceDialUpdateResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"422":{"description":"Unprocessable entity."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/routing/barp/reset":{"post":{"tags":["barp"],"summary":"Creates routing barp reset.","description":"Via the barp_router service and returns a typed `ResetBarpWeightsResponse`\npayload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"reset_barp_weights","responses":{"200":{"description":"Reset BaRP weights to uniform prior for the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetBarpWeightsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/routing/barp/stats":{"get":{"tags":["barp"],"summary":"Returns routing barp stats.","description":"Via the barp_router service and returns a typed `BarpStatsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_barp_stats","parameters":[{"name":"time_range","in":"query","description":"Time range.","required":false,"schema":{"type":"string","nullable":true}},{"name":"model_filter","in":"query","description":"Model filter.","required":false,"schema":{"type":"string","nullable":true}},{"name":"workflow_type","in":"query","description":"Workflow type.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Returns BaRP routing statistics for the authenticated tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BarpStatsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/routing/feedback":{"post":{"tags":["Routing"],"summary":"Creates routing feedback.","description":"And returns a typed `SubmitFeedbackResponse` payload (request body:\n`FeedbackRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"submit_feedback","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}},"required":true},"responses":{"200":{"description":"Feedback accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitFeedbackResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/routing/patterns":{"get":{"tags":["Routing"],"summary":"Lists routing patterns.","description":"And returns a typed `Vec<PatternResponse>` payload.\n\nRequires a valid bearer token.","operationId":"list_patterns","responses":{"200":{"description":"List of active patterns","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PatternResponse"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/routing/rules":{"get":{"tags":["Routing"],"summary":"Lists routing rules.","description":"And returns a typed `Vec<RuleDefinition>` payload.\n\nRequires a valid bearer token.","operationId":"routing_list_rules","responses":{"200":{"description":"List of active heuristic rules","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleDefinition"}}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/routing/tenants/{tenant_id}/preference-dial":{"get":{"tags":["barp"],"summary":"Returns routing tenants preference dial.","description":"Via the barp_router service and returns a typed `GetPreferenceDialResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"get_tenant_preference_dial","parameters":[{"name":"tenant_id","in":"path","description":"tenant_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Fetch the current preference dial for a tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPreferenceDialResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["barp"],"summary":"Replaces routing tenants preference dial.","description":"Via the barp_router service and returns a typed `PreferenceDialUpdateResponse`\npayload (request body: `UpdateDialRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"put_tenant_preference_dial","parameters":[{"name":"tenant_id","in":"path","description":"tenant_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDialRequest"}}},"required":true},"responses":{"200":{"description":"Legacy per-tenant dial endpoint (admin scope required).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferenceDialUpdateResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"404":{"description":"Resource not found."},"422":{"description":"Unprocessable entity."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/schemas":{"get":{"tags":["schema"],"summary":"Lists schemas.","description":"Via the schema_service service and returns a typed `SchemaListResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_schemas","responses":{"200":{"description":"List schemas.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaListResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["schema"],"summary":"Creates schemas.","description":"And returns a typed `CreateSchemaResponse` payload (request body:\n`CreateSchemaRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_schema","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSchemaRequest"}}},"required":true},"responses":{"201":{"description":"Create schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSchemaResponse"}}}},"400":{"description":"Bad request: validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/schemas/infer":{"post":{"tags":["schema"],"summary":"Creates schemas infer.","description":"Via the schema_service service and returns a typed `InferSchemaResponse` payload\n(request body: `InferSchemaRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"infer_schema","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Infer schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferSchemaResponse"}}}},"400":{"description":"Bad request: validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/schemas/{schema_id}":{"get":{"tags":["schema"],"summary":"Returns schemas.","description":"Via the schema_service service and returns a typed `SchemaResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_schema","parameters":[{"name":"schema_id","in":"path","description":"schema_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["schema"],"summary":"Updates schemas.","description":"Via the schema_service service and returns a typed `SchemaResponse` payload\n(request body: `CreateSchemaRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_schema","parameters":[{"name":"schema_id","in":"path","description":"schema_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSchemaRequest"}}},"required":true},"responses":{"200":{"description":"Update schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaResponse"}}}},"400":{"description":"Bad request: validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"409":{"description":"If-Match precondition failed: schema was modified concurrently. Closes audit P3 be-schema-13 (em-dashes removed from response descriptions)."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["schema"],"summary":"Deletes schemas.","description":"Via the schema_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_schema","parameters":[{"name":"schema_id","in":"path","description":"schema_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete schema."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/schemas/{schema_id}/stats":{"get":{"tags":["schema"],"summary":"Returns schemas stats.","description":"Via the schema_service service and returns a typed `SchemaStatsResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"schemas_get_stats","parameters":[{"name":"schema_id","in":"path","description":"Path parameter.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns stats.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaStatsResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller is not a control-plane admin."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/schemas/{schema_id}/validate":{"post":{"tags":["schema"],"summary":"Validates schemas validate.","description":"Via the schema_service service and returns a typed `ValidationResponse` payload\n(request body: `ValidateDataRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"validate_data","parameters":[{"name":"schema_id","in":"path","description":"schema_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateDataRequest"}}},"required":true},"responses":{"200":{"description":"Validate data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}},"400":{"description":"Bad request: validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/settings":{"get":{"tags":["settings"],"summary":"Returns settings.","description":"Reads from Postgres and returns a typed `SettingsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_v1_settings","responses":{"200":{"description":"Get organization settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["settings"],"summary":"Updates settings.","description":"Reads from Postgres and returns a typed `SettingsResponse` payload (request\nbody: `UpdateSettingsRequest`).\n\nRequires a valid bearer token. Mutating: partial update — only the supplied\nfields are applied.","operationId":"patch_settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Update organization settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"422":{"description":"Unprocessable entity — malformed request body."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/settings/models":{"get":{"tags":["settings"],"summary":"Returns model routing preferences for the caller's org.","description":"Backed by the `org_settings.model_settings` jsonb column (self-heal DDL in\nstate.rs). A NULL column (org never saved) serves the documented defaults:\n`mode=auto`, empty provider allowlist, `preferred_tier=2`. Replaces the\nformer unconditional 501 that the dashboard's `useModelSettings` hook was\nwired to. Closes audit ticket #243.\n\nRequires a valid bearer token.","operationId":"get_model_settings","responses":{"200":{"description":"Get model routing preferences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelSettings"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["settings"],"summary":"Updates model routing preferences for the caller's org.","description":"Validates the domain (`mode` auto|manual, tier 1..=3, bounded provider\nlist) and persists the whole object into `org_settings.model_settings`.\nReturns the stored settings. Closes audit ticket #243.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_model_settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelSettings"}}},"required":true},"responses":{"200":{"description":"Update model routing preferences","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelSettings"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/settings/voice":{"get":{"tags":["settings"],"summary":"Returns settings voice.","description":"Reads from Postgres and returns a typed `VoiceSettingsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_voice_settings","responses":{"200":{"description":"Get voice settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSettingsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["settings"],"summary":"Updates settings voice.","description":"Reads from Postgres and returns a typed `VoiceSettingsResponse` payload (request\nbody: `UpdateVoiceSettingsRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_voice_settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVoiceSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Update voice settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSettingsResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/speculation/circuit/reset":{"post":{"tags":["speculation"],"summary":"Creates speculation circuit reset.","description":"And returns a typed `CircuitResetResponse` payload (request body:\n`CircuitResetRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"reset_circuit_breakers","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CircuitResetRequest"}}},"required":true},"responses":{"200":{"description":"Reset circuit breakers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CircuitResetResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/speculation/config":{"post":{"tags":["speculation"],"summary":"Updates speculation config.","description":"Accepts a `SpeculationConfigUpdate` body. Live config updates are not yet\nwired into the running `SpeculationService`, so this endpoint currently\nreturns 501 rather than silently reporting success.\n\nRequires a valid bearer token and control-plane admin privileges.","operationId":"speculation_update_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeculationConfigUpdate"}}},"required":true},"responses":{"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."},"501":{"description":"Live speculation config updates are not supported by this deployment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConfigResponse"}}}}},"security":[{"bearer_auth":[]}]}},"/v1/speculation/stats":{"get":{"tags":["speculation"],"summary":"Returns speculation stats.","description":"And returns a typed `SpeculationStats` payload.\n\nRequires a valid bearer token.","operationId":"speculation_get_stats","responses":{"200":{"description":"Get REAL speculation metrics from database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeculationStats"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/speculation/suffix/patterns":{"get":{"tags":["speculation"],"summary":"Returns speculation suffix patterns.","description":"And returns a typed `Vec<SuffixPatternResponse>` payload.\n\nRequires a valid bearer token.","operationId":"get_suffix_patterns","responses":{"200":{"description":"Get common suffix patterns from database","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SuffixPatternResponse"}}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/speculation/suffix/seed":{"post":{"tags":["speculation"],"summary":"Creates speculation suffix seed.","description":"And returns a typed `SeedSuffixResponse` payload (request body:\n`SeedSuffixRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"seed_suffix_patterns","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedSuffixRequest"}}},"required":true},"responses":{"200":{"description":"Seed suffix patterns","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedSuffixResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/sso/admin/audit":{"get":{"tags":["sso-admin"],"summary":"GET /audit: SSO-related audit events for the caller's org, newest first.","description":"Covers the admin-plane events this module writes (`sso.*` actions /\nresource_type `sso`), the SCIM provisioning events, and SSO logins (logged\nas action `login` with `metadata.method` = `sso_oidc` / `sso_saml`). Same\nauthz and tenant scoping as every other handler here.","operationId":"list_audit_events","parameters":[{"name":"limit","in":"query","description":"Max events to return. Default 100, server-capped at 500.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}}],"responses":{"200":{"description":"SSO audit events for the org, newest first: { entries: [{ id, event, actor, target, protocol, ip, result, created_at, metadata }] }."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden: caller is not an org owner/admin."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/telemetry/config":{"get":{"tags":["telemetry"],"summary":"Returns telemetry config.","description":"And returns a typed `TelemetryConfig` payload.\n\nPublic — no authentication required.","operationId":"telemetry_get_config","responses":{"200":{"description":"Get config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryConfig"}}}},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["telemetry"],"summary":"Updates telemetry config.","description":"And returns a typed `TelemetryConfig` payload (request body: `TelemetryConfig`).\n\nPublic — no authentication required. Mutating: writes a new row or replaces an\nexisting one.","operationId":"telemetry_update_config","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryConfig"}}},"required":true},"responses":{"200":{"description":"Update config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryConfig"}}}},"400":{"description":"Bad request — validation failed."},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]}},"/v1/telemetry/events":{"post":{"tags":["telemetry"],"summary":"Creates telemetry events.","description":"Via the async_logger service and returns a typed `IngestEventResponse` payload\n(request body: `EventPayload`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"ingest_event","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPayload"}}},"required":true},"responses":{"200":{"description":"Ingest event.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestEventResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/telemetry/traces":{"get":{"tags":["telemetry"],"summary":"Lists telemetry traces.","description":"And returns a typed `Vec<Trace>` payload.\n\nPublic — no authentication required.","operationId":"list_traces","parameters":[{"name":"error_only","in":"query","description":"If true, only return error / failed entries.","required":false,"schema":{"type":"boolean","nullable":true}},{"name":"q","in":"query","description":"Free-text search query.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"List traces.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Trace"}}}}},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]}},"/v1/telemetry/traces/{id}":{"get":{"tags":["telemetry"],"summary":"Returns telemetry traces.","description":"And returns a typed `Trace` payload.\n\nPublic — no authentication required.","operationId":"get_trace","parameters":[{"name":"id","in":"path","description":"Path parameter.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Returns trace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trace"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller is not a control-plane admin."},"404":{"description":"Resource not found."},"501":{"description":"Not implemented."}},"security":[{"bearer_auth":[]}]}},"/v1/usage/requests":{"get":{"tags":["customer-dashboard"],"summary":"Returns the customer's detailed request log (keyset-paginated).","description":"Reads per-request rows from `gateway_requests`, scoped to the caller's org,\nnewest first. Optional `api_key_id` / `model` / `status` / `from` / `to`\nfilters narrow the result. The effective `created_at` window is always\nbounded: absent an explicit `to` it ends at `now`, and absent an explicit\n`from` (with no cursor) it begins 30 days earlier, so a filter that matches\nnothing can never scan the org's full history. Any effective span wider than\n90 days is rejected. Deep history is reached by following `next_cursor`,\nwhich carries its own keyset bound (the default lower bound is then skipped).","operationId":"usage_requests","parameters":[{"name":"api_key_id","in":"query","description":"Restrict to a single API key.","required":false,"schema":{"type":"string","format":"uuid","nullable":true}},{"name":"model","in":"query","description":"Restrict to model ids matching this value (case-insensitive substring match).","required":false,"schema":{"type":"string","nullable":true}},{"name":"status","in":"query","description":"Restrict to a single status: success | error | rate_limited.","required":false,"schema":{"type":"string","nullable":true}},{"name":"from","in":"query","description":"Inclusive lower bound, ISO-8601 / RFC3339. Defaults to 30 days before the effective upper bound when omitted (and no cursor is supplied).","required":false,"schema":{"type":"string","nullable":true}},{"name":"to","in":"query","description":"Upper bound (<=), ISO-8601 / RFC3339. Defaults to now when omitted. The effective from..to span must be <= 90 days.","required":false,"schema":{"type":"string","nullable":true}},{"name":"limit","in":"query","description":"Page size, default 50, hard-capped at 200.","required":false,"schema":{"type":"integer","format":"int64","nullable":true}},{"name":"cursor","in":"query","description":"Opaque keyset cursor from the previous page's next_cursor.","required":false,"schema":{"type":"string","nullable":true}}],"responses":{"200":{"description":"Paginated detailed request log (newest first).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestLogResponse"}}}},"400":{"description":"Bad request — invalid cursor, timestamp, or a from..to span over 90 days."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me":{"get":{"tags":["users"],"summary":"Returns the authenticated user's profile.","description":"Reads from Postgres and returns a typed `UserProfile` payload.\n\nRequires a valid bearer token. Closes audit P3 be-users-24.","operationId":"get_current_user","responses":{"200":{"description":"Get current user profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["users"],"summary":"Updates the authenticated user's profile.","description":"Applies a partial update from the JSON request body and returns the refreshed\n`UserProfile`. Only the supplied fields are written; `email` is rejected here\nand must go through the verified email flow.\n\nRequires a valid bearer token. Closes audit P3 be-users-24.","operationId":"update_current_user","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Update current user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/avatar":{"post":{"tags":["avatar"],"summary":"Creates users me avatar.","description":"Reads from Postgres and returns a typed `UploadAvatarResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"upload_avatar","responses":{"200":{"description":"Upload avatar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadAvatarResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["avatar"],"summary":"Deletes users me avatar.","description":"Reads from Postgres and returns a typed `DeleteAvatarResponse` payload.\n\nRequires a valid bearer token. Mutating: the resource is removed (or marked\ndeleted) on success.","operationId":"delete_avatar","responses":{"200":{"description":"Delete avatar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAvatarResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/delete":{"delete":{"tags":["users"],"summary":"Deletes the authenticated user's account.","description":"Atomically removes the user row and its sessions in one transaction, after\nemitting the GDPR-evidence audit record. The linked Stripe customer is\nretained for billing history.\n\nRequires a valid bearer token and step-up (sudo) re-authentication. Closes\naudit P3 be-users-24.","operationId":"delete_current_user","responses":{"204":{"description":"Delete current user account"},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required: this route is guarded by require_sudo_middleware. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url` naming the elevation endpoint. Elevate, then retry the original request."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/mfa/disable":{"post":{"tags":["mfa"],"summary":"Disables disable.","description":"Reads from Postgres via the audit_service service (request body:\n`MfaDisableRequest`).\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"disable_mfa","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaDisableRequest"}}},"required":true},"responses":{"204":{"description":"No content."},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required: this route is guarded by require_sudo_middleware. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url` naming the elevation endpoint. Elevate, then retry the original request."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/mfa/enable":{"post":{"tags":["mfa"],"summary":"Enables enable.","description":"Reads from Postgres via the audit_service service and returns a typed\n`MfaEnableResponse` payload (request body: `MfaEnableRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"enable_mfa","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaEnableRequest"}}},"required":true},"responses":{"200":{"description":"Enable mfa.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaEnableResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required: this route is guarded by require_sudo_middleware. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url` naming the elevation endpoint. Elevate, then retry the original request."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/mfa/recovery-codes":{"post":{"tags":["mfa"],"summary":"Creates recovery codes.","description":"Reads from Postgres and returns a typed `MfaEnableResponse` payload (request\nbody: `RegenerateCodesRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"regenerate_recovery_codes","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegenerateCodesRequest"}}},"required":true},"responses":{"200":{"description":"Regenerate recovery codes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaEnableResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required: this route is guarded by require_sudo_middleware. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url` naming the elevation endpoint. Elevate, then retry the original request."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/mfa/setup":{"post":{"tags":["mfa"],"summary":"Creates setup.","description":"Reads from Postgres and returns a typed `MfaSetupResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"setup_mfa","responses":{"200":{"description":"Setup mfa.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaSetupResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/mfa/status":{"get":{"tags":["mfa"],"summary":"Returns status.","description":"Reads from Postgres and returns a typed `MfaStatusResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_mfa_status","responses":{"200":{"description":"Get mfa status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaStatusResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/mfa/verify":{"post":{"tags":["mfa"],"summary":"POST /v1/users/me/mfa/verify","description":"Step-up re-authentication endpoint. Validates a TOTP code and, on success,\nwrites `session:mfa:{sid}` to Redis with the current Unix timestamp and a\n30-minute TTL. This timestamp is read by `auth_middleware` into\n`AuthUser::mfa_verified_at`, which `require_recent_mfa` checks on the\nnext request to a step-up-protected endpoint (e.g. `/v1/admin/internal-docs`).\n\nOnly works for JWT/cookie-authenticated sessions with a `sid` (session\nfamily). API-key sessions cannot step up by design.","operationId":"verify_mfa","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Refresh step-up MFA timestamp.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaVerifyResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/users/me/password":{"patch":{"tags":["users"],"summary":"Changes the authenticated user's password.","description":"Verifies the current password, enforces strength rules, and writes the new\nArgon2 hash. Emits success/failure audit records via the audit service.\n\nRequires a valid bearer token and step-up (sudo) re-authentication. Closes\naudit P3 be-users-24.","operationId":"change_password","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}},"required":true},"responses":{"200":{"description":"Change user password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required: this route is guarded by require_sudo_middleware. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url` naming the elevation endpoint. Elevate, then retry the original request."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/chat":{"post":{"tags":["voice-api"],"summary":"Creates voice chat.","description":"Reads from Redis via the config service.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"voice_chat","responses":{"200":{"description":"Voice chat.","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/credentials":{"get":{"tags":["voice-credentials"],"summary":"Lists voice credentials.","description":"Reads from Postgres and returns a typed `ListVoiceCredentialsResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_voice_credentials","responses":{"200":{"description":"List voice credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListVoiceCredentialsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["voice-credentials"],"summary":"Creates voice credentials.","description":"Reads from Postgres via the config service and returns a typed\n`CreateVoiceCredentialResponse` payload (request body:\n`CreateVoiceCredentialRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_voice_credential","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVoiceCredentialRequest"}}},"required":true},"responses":{"201":{"description":"Create voice credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVoiceCredentialResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/credentials/{id}":{"delete":{"tags":["voice-credentials"],"summary":"Deletes voice credentials.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_voice_credential","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Delete voice credential."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"patch":{"tags":["voice-credentials"],"summary":"Updates voice credentials.","description":"Reads from Postgres and returns a typed `UpdateVoiceCredentialResponse` payload\n(request body: `UpdateVoiceCredentialRequest`).\n\nRequires a valid bearer token. Mutating: partial update — only the supplied\nfields are applied.","operationId":"update_voice_credential","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVoiceCredentialRequest"}}},"required":true},"responses":{"200":{"description":"Update voice credential.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVoiceCredentialResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/profiles":{"get":{"tags":["voice"],"summary":"Lists voice profiles.","description":"Reads from Postgres and returns a typed `Vec<VoiceProfileResponse>` payload.\n\nRequires a valid bearer token.","operationId":"list_voice_profiles","responses":{"200":{"description":"List voice profiles.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VoiceProfileResponse"}}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["voice"],"summary":"Creates voice profiles.","description":"Reads from Postgres and returns a typed `VoiceProfileResponse` payload (request\nbody: `CreateVoiceProfileRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_voice_profile","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVoiceProfileRequest"}}},"required":true},"responses":{"200":{"description":"Create voice profile.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceProfileResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/profiles/upload":{"post":{"tags":["voice"],"summary":"Creates voice profiles upload.","description":"Via the config service and returns a typed `VoiceProfileResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"upload_voice_clone","responses":{"200":{"description":"Upload voice clone.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceProfileResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/sessions":{"post":{"tags":["voice"],"summary":"Creates voice sessions.","description":"Reads from Redis and returns a typed `VoiceSessionResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_session","responses":{"200":{"description":"Create session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSessionResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/sessions/{session_id}":{"get":{"tags":["voice"],"summary":"Returns voice sessions.","description":"Reads from Redis and returns a typed `VoiceSessionResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_session","parameters":[{"name":"session_id","in":"path","description":"session_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Get session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSessionResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["voice"],"summary":"Deletes voice sessions.","description":"Reads from Redis and returns a typed `DeleteSessionResponse` payload.\n\nRequires a valid bearer token. Mutating: the resource is removed (or marked\ndeleted) on success.","operationId":"delete_session","parameters":[{"name":"session_id","in":"path","description":"session_id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Delete session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteSessionResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/stream":{"get":{"tags":["voice"],"summary":"Returns voice stream.","description":"Requires a valid bearer token.","operationId":"voice_stream","responses":{"101":{"description":"WebSocket upgrade — bi-directional message stream."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/synthesize":{"post":{"tags":["voice-api"],"summary":"Creates voice synthesize.","description":"Reads from Redis (request body: `SynthesizeRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"voice_synthesize","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SynthesizeRequest"}}},"required":true},"responses":{"200":{"description":"Voice synthesize.","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/transcribe":{"post":{"tags":["voice-api"],"summary":"Creates voice transcribe.","description":"Reads from Redis and returns a typed `TranscribeResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"voice_transcribe","responses":{"200":{"description":"Voice transcribe.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscribeResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"403":{"description":"Forbidden — caller lacks required scope/role."}},"security":[{"bearer_auth":[]}]}},"/v1/voice/turn":{"post":{"tags":["voice"],"summary":"Creates voice turn.","description":"Reads from Redis via the mission_control_bus service and returns a typed\n`VoiceTurnResponse2` payload (request body: `VoiceTurnRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"voice_turn","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTurnRequest"}}},"required":true},"responses":{"200":{"description":"Voice turn.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTurnResponse2"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/webhooks":{"get":{"tags":["webhooks"],"summary":"Lists webhooks.","description":"Reads from Postgres and returns a typed `Vec<WebhookResponse>` payload.\n\nRequires a valid bearer token.","operationId":"list_webhooks","responses":{"200":{"description":"List webhooks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookResponse"}}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["webhooks"],"summary":"Creates webhooks.","description":"And returns a typed `CreateWebhookResponse` payload (request body:\n`CreateWebhookRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_webhook","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}},"required":true},"responses":{"200":{"description":"Create webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/webhooks/events":{"get":{"tags":["webhooks"],"summary":"Lists webhooks events.","description":"And returns a typed `Vec<String>` payload.\n\nPublic — no authentication required.","operationId":"list_webhook_events","responses":{"200":{"description":"List available events","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/webhooks/{id}":{"delete":{"tags":["webhooks"],"summary":"Deletes webhooks.","description":"Reads from Postgres.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"webhooks_delete_webhook","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Delete webhook"},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/webhooks/{id}/test":{"post":{"tags":["webhooks"],"summary":"Sends a sample event to a webhook endpoint.","description":"Loads the endpoint, verifies tenant ownership, then fires one signed sample\npayload at its URL and reports the delivery outcome synchronously so the\nfrontend \"Test\" button can show success/failure. The URL was SSRF-validated\nat creation time, so re-firing to it introduces no new fetch surface.\n\nRequires a valid bearer token. Mutating in effect: triggers an outbound call\nto the registered URL.","operationId":"test_webhook","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Test delivery attempted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestWebhookResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows":{"get":{"tags":["workflow"],"summary":"Lists workflows.","description":"Via the workflow_service service and returns a typed `WorkflowListResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"list_workflows","responses":{"200":{"description":"List workflows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowListResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["workflow"],"summary":"Creates workflows.","description":"And returns a typed `CreateWorkflowResponse` payload (request body:\n`CreateWorkflowRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_workflow","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowRequest"}}},"required":true},"responses":{"201":{"description":"Create workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions":{"get":{"tags":["workflow"],"summary":"Lists workflows executions.","description":"And returns a typed `WorkflowExecutionsListResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_executions","responses":{"200":{"description":"List executions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowExecutionsListResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions/{execution_id}":{"get":{"tags":["workflow"],"summary":"Returns workflows executions.","description":"Via the workflow_service service and returns a typed `WorkflowExecutionDetail`\npayload.\n\nRequires a valid bearer token.","operationId":"get_execution","parameters":[{"name":"execution_id","in":"path","description":"execution_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get execution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowExecutionDetail"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions/{execution_id}/cancel":{"post":{"tags":["workflow"],"summary":"Cancels workflows executions cancel.","description":"And returns a typed `ExecutionCancelledResponse` payload (request body:\n`Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"cancel_execution","parameters":[{"name":"execution_id","in":"path","description":"execution_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Cancel execution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionCancelledResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions/{execution_id}/debug":{"get":{"tags":["workflow"],"summary":"Returns workflows executions debug.","description":"And returns a typed `ExecutionDebugResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_execution_debug","parameters":[{"name":"execution_id","in":"path","description":"execution_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get execution debug.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionDebugResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions/{execution_id}/logs":{"get":{"tags":["workflow"],"summary":"Returns workflows executions logs.","description":"And returns a typed `GetExecutionLogsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_execution_logs","parameters":[{"name":"execution_id","in":"path","description":"execution_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get execution logs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetExecutionLogsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions/{execution_id}/pause":{"post":{"tags":["workflow"],"summary":"Pauses workflows executions pause.","description":"And returns a typed `ExecutionPausedResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"pause_execution","parameters":[{"name":"execution_id","in":"path","description":"execution_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Pause execution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionPausedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions/{execution_id}/resume":{"post":{"tags":["workflow"],"summary":"Resumes workflows executions resume.","description":"And returns a typed `ExecutionResumedResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"resume_execution","parameters":[{"name":"execution_id","in":"path","description":"execution_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Resume execution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionResumedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions/{execution_id}/retry":{"post":{"tags":["workflow"],"summary":"Creates workflows executions retry.","description":"And returns a typed `ExecutionRetryAcceptedResponse` payload (request body:\n`Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"retry_execution","parameters":[{"name":"execution_id","in":"path","description":"execution_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Retry execution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionRetryAcceptedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/executions/{execution_id}/trace":{"get":{"tags":["workflow"],"summary":"Returns workflows executions trace.","description":"And returns a typed `ExecutionTraceResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_execution_trace","parameters":[{"name":"execution_id","in":"path","description":"execution_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get execution trace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionTraceResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/import":{"post":{"tags":["workflow"],"summary":"Creates workflows import.","description":"And returns a typed `ImportWorkflowResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"import_workflow","requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Import workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportWorkflowResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/node-types":{"get":{"tags":["workflow"],"summary":"Lists workflows node types.","description":"And returns a typed `ListNodeTypesResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_node_types","responses":{"200":{"description":"List node types.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListNodeTypesResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/templates":{"get":{"tags":["workflow"],"summary":"Lists workflows templates.","description":"Via the workflow_service service and returns a typed `ListTemplatesResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"list_templates","responses":{"200":{"description":"List templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListTemplatesResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/templates/{template_id}/install":{"post":{"tags":["workflow"],"summary":"Creates workflows templates install.","description":"And returns a typed `InstallTemplateResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"install_template","parameters":[{"name":"template_id","in":"path","description":"template_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Install template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstallTemplateResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/tools":{"get":{"tags":["workflow"],"summary":"Lists workflows tools.","description":"Via the workflow_service service and returns a typed `ListToolsResponse`\npayload.\n\nRequires a valid bearer token.","operationId":"workflows_list_tools","responses":{"200":{"description":"List tools.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListToolsResponse"}}}},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["workflow"],"summary":"Registers workflows tools.","description":"Via the workflow_service service and returns a typed `RegisterToolResponse`\npayload (request body: `RegisterToolRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"workflows_tools_register_tool","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterToolRequest"}}},"required":true},"responses":{"201":{"description":"Register tool.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterToolResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/tools/{tool_id}":{"put":{"tags":["workflow"],"summary":"Updates workflows tools.","description":"Via the workflow_service service and returns a typed `UpdateToolResponse`\npayload (request body: `RegisterToolRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"workflows_tools_update_tool","parameters":[{"name":"tool_id","in":"path","description":"tool_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterToolRequest"}}},"required":true},"responses":{"200":{"description":"Update tool.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateToolResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["workflow"],"summary":"Deletes workflows tools.","description":"Via the workflow_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"workflows_tools_delete_tool","parameters":[{"name":"tool_id","in":"path","description":"tool_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete tool."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/tools/{tool_id}/test":{"post":{"tags":["workflow"],"summary":"Creates workflows tools test.","description":"And returns a typed `ToolTestResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"workflows_tools_test_tool","parameters":[{"name":"tool_id","in":"path","description":"tool_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Test tool.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolTestResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}":{"get":{"tags":["workflow"],"summary":"Returns workflows.","description":"Via the workflow_service service and returns a typed `WorkflowDetail` payload.\n\nRequires a valid bearer token.","operationId":"get_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowDetail"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["workflow"],"summary":"Updates workflows.","description":"And returns a typed `CreateWorkflowResponse` payload (request body:\n`CreateWorkflowRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowRequest"}}},"required":true},"responses":{"200":{"description":"Update workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["workflow"],"summary":"Deletes workflows.","description":"Via the workflow_service service.\n\nRequires a valid bearer token. Idempotent on the resource lifecycle: re-issuing\nthe call after the first success is a no-op.","operationId":"delete_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Delete workflow."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/clone":{"post":{"tags":["workflow"],"summary":"Creates workflows clone.","description":"And returns a typed `CloneWorkflowResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"clone_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Clone workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloneWorkflowResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/execute":{"post":{"tags":["workflow"],"summary":"Creates workflows execute.","description":"And returns a typed `ExecuteWorkflowResponse` payload (request body:\n`ExecuteWorkflowRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"execute_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteWorkflowRequest"}}},"required":true},"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteWorkflowResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/executions":{"get":{"tags":["workflow"],"summary":"Lists workflows executions.","description":"And returns a typed `WorkflowExecutionsListResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_workflow_executions","parameters":[{"name":"workflow_id","in":"path","description":"Path parameter.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Lists workflow executions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowExecutionsListResponse"}}}},"401":{"description":"Unauthenticated."},"403":{"description":"Caller is not a control-plane admin."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/export":{"post":{"tags":["workflow"],"summary":"Creates workflows export.","description":"Via the workflow_service service and returns a typed `ExportWorkflowResponse`\npayload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"export_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Export workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportWorkflowResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/metrics":{"get":{"tags":["workflow"],"summary":"Returns workflows metrics.","description":"And returns a typed `WorkflowMetricsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_workflow_metrics","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get workflow metrics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowMetricsResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/publish":{"post":{"tags":["workflow"],"summary":"Creates workflows publish.","description":"And returns a typed `WorkflowPublishedResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"publish_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Publish workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowPublishedResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/resume":{"post":{"tags":["workflow"],"summary":"Resumes workflows resume.","description":"Via the workflow_service service and returns a typed `WorkflowResumedResponse`\npayload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"resume_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Resume workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResumedResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/share":{"post":{"tags":["workflow"],"summary":"Creates workflows share.","description":"And returns a typed `ShareWorkflowResponse` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"share_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Share workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareWorkflowResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/suspend":{"post":{"tags":["workflow"],"summary":"Creates workflows suspend.","description":"Via the workflow_service service and returns a typed `WorkflowSuspendedResponse`\npayload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"suspend_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Suspend workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowSuspendedResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/validate":{"post":{"tags":["workflow"],"summary":"Validates workflows validate.","description":"And returns a typed `WorkflowValidationResponse` payload (request body:\n`Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"validate_workflow","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"200":{"description":"Validate workflow.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowValidationResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/versions":{"get":{"tags":["workflow"],"summary":"Lists workflows versions.","description":"And returns a typed `WorkflowVersionsListResponse` payload.\n\nRequires a valid bearer token.","operationId":"list_workflow_versions","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List workflow versions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersionsListResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"post":{"tags":["workflow"],"summary":"Creates workflows versions.","description":"And returns a typed `WorkflowVersionDetail` payload (request body: `Value`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"create_workflow_version","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{}}},"required":true},"responses":{"201":{"description":"Create workflow version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersionDetail"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/v1/workflows/{workflow_id}/versions/{version_id}":{"get":{"tags":["workflow"],"summary":"Returns workflows versions.","description":"And returns a typed `WorkflowVersionDetail` payload.\n\nRequires a valid bearer token.","operationId":"get_workflow_version","parameters":[{"name":"workflow_id","in":"path","description":"workflow_id","required":true,"schema":{"type":"string"}},{"name":"version_id","in":"path","description":"version_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get workflow version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowVersionDetail"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/voice/analytics":{"get":{"tags":["observability"],"summary":"Returns voice analytics.","description":"And returns a typed `GetVoiceAnalyticsResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_voice_analytics","responses":{"200":{"description":"Get voice analytics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVoiceAnalyticsResponse"}}}},"401":{"description":"Unauthenticated."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/{id}":{"get":{"tags":["observability"],"summary":"Returns /{id}.","description":"And returns a typed `TraceDetailResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_trace_details","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get trace details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceDetailResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"put":{"tags":["observability"],"summary":"Updates /{id}.","description":"And returns a typed `SloResponse` payload (request body: `SloRequest`).\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"update_slo","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SloRequest"}}},"required":true},"responses":{"200":{"description":"Update slo.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SloResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]},"delete":{"tags":["passkey"],"summary":"Delete (deactivate) a passkey.","description":"# Sudo posture: gated by CONSEQUENCE, not by path (#471)\n\nThis route is not behind `require_sudo_middleware`, because a layer cannot\nsee the thing that matters. It refuses with the same typed\n`403 sudo_required` the guard emits, and it refuses in exactly one case:\n**this delete would leave the account with no enrolled second factor at\nall.**\n\nWhy that line and not the whole route:\n\n* Deleting the LAST factor is the same event as `POST /v1/mfa/disable`,\nwhich is gated. Two doors onto one outcome, one of them locked, is not a\nposture; it is an oversight with a threat model. An AAL1 session (the\nemail-OTP fallback issues one by design, and a password login for a\nTOTP-plus-passkey account is AAL1 until it elevates) could delete every\npasskey and leave the account single-factor, which is precisely what the\ngate on `/mfa/disable` exists to prevent.\n* Deleting a SPARE passkey removes no protection. The account is still\nAAL2-capable on the surviving factor, so it is a rotation, not a\ndowngrade. Gating \"remove my old laptop\" buys nothing and spends a\nre-authentication dialog, and a gate people meet for no reason is how a\nre-auth prompt becomes muscle memory.\n\nThe nothing-mutates-on-refusal property is load-bearing: the check runs\nbefore any write and inside the transaction, so a client that elevates and\nreplays the identical request (which is what X-Website's\n`useSudoGuardedMutation` does) gets the right result.\n\n## What the stranded case is, and why it is the correct cost\n\nA passkey-only account in an unelevated session cannot pass this gate:\n`POST /v1/auth/sudo` has no passkey ceremony and answers\n`passkey_reauth_required`. Two users hit that:\n\n* Still holds the passkey: signs in with it, which mints AAL2, and deletes\nit inside the window. A detour, not a wall.\n* Genuinely lost it: goes through `POST /v1/auth/account-recovery/*`, which\nclears every factor after a 72-hour cooling-off and the account password.\nThat is the deliberate slow door for \"all my factors are gone\", and it is\nthe same answer GitHub and Google give. Letting a live cookie do it in one\nclick instead is not a recovery path, it is the hole in #471.\n\nAccepting a WebAuthn assertion at the elevation endpoint would turn the\nfirst case from a detour into a click, and is still worth building; it is no\nlonger a prerequisite for closing the hole, which is why this ships now.\n\nIf no active passkeys remain after deletion, `users.passkey_enabled` is set\nto false and `users.mfa_enabled` is recomputed from the factors that\nactually survive.","operationId":"delete_passkey","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Delete (deactivate) a passkey. If no active passkeys remain after deletion, `users.passkey_enabled` is set to false and `users.mfa_enabled` is recomputed from the surviving factors."},"401":{"description":"Unauthenticated."},"403":{"description":"Step-up (sudo) re-authentication required, and returned ONLY when this delete would leave the account with no enrolled second factor (it is the last active passkey and there is no enrolled TOTP). Deleting a spare passkey, or a passkey on an account that also has TOTP, needs no elevation. The body carries a stable `error.code` of `sudo_required`, a human-safe `error.message`, and a machine-only `error.sudo_url`. Nothing is mutated on this refusal: elevate, then retry the identical request."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/{id}/primary":{"post":{"tags":["emails"],"summary":"Creates primary.","description":"Reads from Postgres and returns a typed `MessageResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"set_primary_email","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Set email as primary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."},"500":{"description":"Internal server error."}},"security":[{"bearer_auth":[]}]}},"/{id}/spans":{"get":{"tags":["observability"],"summary":"Returns spans.","description":"And returns a typed `TraceSpansResponse` payload.\n\nRequires a valid bearer token.","operationId":"get_trace_spans","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get trace spans.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceSpansResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/{id}/test":{"post":{"tags":["observability"],"summary":"Creates test.","description":"And returns a typed `AlertTestResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"test_alert","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Test alert.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertTestResponse"}}}},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}},"/{id}/verify":{"post":{"tags":["emails"],"summary":"Creates verify.","description":"Reads from Postgres and returns a typed `MessageResponse` payload.\n\nRequires a valid bearer token. Mutating: writes a new row or replaces an\nexisting one.","operationId":"send_verification_email","parameters":[{"name":"id","in":"path","description":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Verification token generated; delivery pending","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"400":{"description":"Bad request — validation failed."},"401":{"description":"Unauthenticated."},"404":{"description":"Resource not found."}},"security":[{"bearer_auth":[]}]}}},"components":{"schemas":{"AcceptInviteResponse":{"type":"object","description":"POST /v1/auth/accept-invite  (public — no auth middleware)\nMatches the handler's actual runtime payload: `{ status, organization_id }`.\nNo session token is issued here — the invitee signs in through the normal\nlogin flow after accepting.","required":["status","organization_id"],"properties":{"organization_id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"accepted"}}},"AcceptPlatformInviteRequest":{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}},"AcknowledgeBudgetAlertResponse":{"type":"object","description":"PATCH /admin/billing/budget-alerts/:id/acknowledge — Mark alert as handled.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["acknowledged","id"],"properties":{"acknowledged":{"type":"boolean","example":true},"id":{}}},"AddEmailRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","example":"alice@acme.io"}}},"AddHealerRuleRequest":{"type":"object","required":["name","stage","pattern","replacement","description","test_cases"],"properties":{"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider."},"name":{"type":"string","example":"Acme Corporation"},"pattern":{"type":"string"},"replacement":{"type":"string"},"stage":{"type":"string"},"test_cases":{"type":"array","items":{"$ref":"#/components/schemas/TestCase"}}}},"AddProviderRequest":{"type":"object","required":["provider","api_key"],"properties":{"api_key":{"type":"string","maxLength":4096,"minLength":1},"provider":{"type":"string","example":"openai","minLength":1}}},"AddRuleResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["rule_id"],"properties":{"rule_id":{}}},"AgentResponse":{"type":"object","required":["id","name","workspace_id","status","model_id","config","created_at","updated_at"],"properties":{"config":{},"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"metadata":{"nullable":true},"model_id":{"type":"string","example":"bedrock/nova-pro/us-east-1"},"name":{"type":"string","example":"Acme Corporation"},"status":{"type":"string","example":"active"},"updated_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"workspace_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"AgenticConfigPatch":{"type":"object","description":"Partial update request for agentic detector config.\nAll fields are optional; only provided fields are applied to the live config.","properties":{"confidence_threshold":{"type":"number","format":"float","nullable":true},"cycles_force_override":{"allOf":[{"$ref":"#/components/schemas/AgenticRoutingOverride"}],"nullable":true},"cycles_signal_enabled":{"type":"boolean","example":true,"nullable":true},"deep_conversation_signal_enabled":{"type":"boolean","example":true,"nullable":true},"deep_conversation_threshold":{"type":"integer","nullable":true,"minimum":0},"enabled":{"type":"boolean","example":true,"nullable":true},"framework_detection_enabled":{"type":"boolean","example":true,"nullable":true},"keyword_force_override":{"allOf":[{"$ref":"#/components/schemas/AgenticRoutingOverride"}],"nullable":true},"keyword_signal_enabled":{"type":"boolean","example":true,"nullable":true},"long_system_force_override":{"allOf":[{"$ref":"#/components/schemas/AgenticRoutingOverride"}],"nullable":true},"long_system_signal_enabled":{"type":"boolean","example":true,"nullable":true},"long_system_token_threshold":{"type":"integer","nullable":true,"minimum":0},"many_cycles_threshold":{"type":"integer","nullable":true,"minimum":0},"many_tools_threshold":{"type":"integer","nullable":true,"minimum":0},"multi_agent_force_override":{"allOf":[{"$ref":"#/components/schemas/AgenticRoutingOverride"}],"nullable":true},"react_force_override":{"allOf":[{"$ref":"#/components/schemas/AgenticRoutingOverride"}],"nullable":true},"structured_chain_force_override":{"allOf":[{"$ref":"#/components/schemas/AgenticRoutingOverride"}],"nullable":true},"structured_chain_min_turns":{"type":"integer","nullable":true,"minimum":0},"structured_chain_signal_enabled":{"type":"boolean","example":true,"nullable":true},"tool_role_signal_enabled":{"type":"boolean","example":true,"nullable":true},"tools_active_force_override":{"allOf":[{"$ref":"#/components/schemas/AgenticRoutingOverride"}],"nullable":true},"tools_min_count":{"type":"integer","example":42,"nullable":true,"minimum":0},"tools_signal_enabled":{"type":"boolean","example":true,"nullable":true},"vision_force_override":{"allOf":[{"$ref":"#/components/schemas/AgenticRoutingOverride"}],"nullable":true},"vision_signal_enabled":{"type":"boolean","example":true,"nullable":true}}},"AgenticDetectorConfig":{"type":"object","required":["enabled","confidence_threshold","tools_signal_enabled","tools_min_count","many_tools_threshold","tool_role_signal_enabled","cycles_signal_enabled","many_cycles_threshold","long_system_signal_enabled","long_system_token_threshold","keyword_signal_enabled","deep_conversation_signal_enabled","deep_conversation_threshold","framework_detection_enabled","structured_chain_signal_enabled","structured_chain_min_turns","cycles_force_override","react_force_override","tools_active_force_override","long_system_force_override","keyword_force_override","structured_chain_force_override","multi_agent_force_override","vision_signal_enabled","vision_force_override"],"properties":{"confidence_threshold":{"type":"number","format":"float"},"cycles_force_override":{"$ref":"#/components/schemas/RoutingOverride"},"cycles_signal_enabled":{"type":"boolean","example":true},"deep_conversation_signal_enabled":{"type":"boolean","example":true},"deep_conversation_threshold":{"type":"integer","minimum":0},"enabled":{"type":"boolean","example":true},"framework_detection_enabled":{"type":"boolean","example":true},"keyword_force_override":{"$ref":"#/components/schemas/RoutingOverride"},"keyword_signal_enabled":{"type":"boolean","example":true},"long_system_force_override":{"$ref":"#/components/schemas/RoutingOverride"},"long_system_signal_enabled":{"type":"boolean","example":true},"long_system_token_threshold":{"type":"integer","minimum":0},"many_cycles_threshold":{"type":"integer","minimum":0},"many_tools_threshold":{"type":"integer","minimum":0},"multi_agent_force_override":{"$ref":"#/components/schemas/RoutingOverride"},"react_force_override":{"$ref":"#/components/schemas/RoutingOverride"},"structured_chain_force_override":{"$ref":"#/components/schemas/RoutingOverride"},"structured_chain_min_turns":{"type":"integer","minimum":0},"structured_chain_signal_enabled":{"type":"boolean","example":true},"tool_role_signal_enabled":{"type":"boolean","example":true},"tools_active_force_override":{"$ref":"#/components/schemas/RoutingOverride"},"tools_min_count":{"type":"integer","example":42,"minimum":0},"tools_signal_enabled":{"type":"boolean","example":true},"vision_force_override":{"$ref":"#/components/schemas/RoutingOverride"},"vision_signal_enabled":{"type":"boolean","description":"Whether to detect vision/image inputs and force T1 routing.","example":true}}},"AlertHistoryResponse":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/AlertHistoryEvent"}}}},"AlertRequest":{"type":"object","required":["name","condition","severity"],"properties":{"channels":{},"condition":{},"name":{"type":"string","example":"Acme Corporation"},"severity":{"type":"string","example":"warning"}}},"AlertResponse":{"type":"object","required":["id","organization_id","name","condition","severity","channels","enabled","created_at","updated_at"],"properties":{"channels":{"description":"Notification channels (slack / email / pagerduty / webhook).  Free-form."},"condition":{"description":"Free-form condition tree (e.g. `{\"metric\": \"error_rate\", \"operator\": \">\", \"threshold\": 0.05}`)."},"created_at":{"type":"string","format":"date-time"},"enabled":{"type":"boolean"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"organization_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"severity":{"type":"string","description":"One of: `info` | `warning` | `critical` | `page`."},"updated_at":{"type":"string","format":"date-time"}}},"AlertTestResponse":{"type":"object","required":["notifications_sent","results"],"properties":{"notifications_sent":{"type":"array","items":{"type":"string"}},"results":{"type":"array","items":{"$ref":"#/components/schemas/AlertTestChannelResult"}}}},"AllocationResponse":{"type":"object","required":["byok_allocation_pct"],"properties":{"byok_allocation_pct":{"type":"integer","format":"int32","example":95},"monthly_spend_limit_usd":{"type":"number","format":"double","example":0.42,"nullable":true}}},"AnalyticsChartsResponse":{"type":"object","required":["metric","resolution","data"],"properties":{"data":{"description":"Ordered time-bucket data points."},"metric":{"type":"string","description":"Metric this chart series covers (e.g. `requests`, `cost_usd`, `latency_ms`)."},"resolution":{"type":"string","description":"Bucket size: `minute` | `hour` | `day`."},"summary":{"description":"Optional headline numbers (total, peak, average).","nullable":true}}},"AnalyticsPeriod":{"type":"object","description":"Time period for analytics queries.","required":["start","end","label"],"properties":{"end":{"type":"string"},"label":{"type":"string","description":"Human-readable label, e.g. \"last_24h\", \"last_7d\", \"last_30d\"."},"start":{"type":"string"}}},"AnalyticsPeriodV2":{"type":"object","description":"Period metadata for V2 responses.","required":["start","end","label"],"properties":{"end":{"type":"string"},"label":{"type":"string"},"start":{"type":"string"}}},"AnalyticsSummaryResponse":{"type":"object","required":["period","total_requests","total_cost_usd","cache_analysis","models","providers","top_tenants","top_consumers","time_series","latency"],"properties":{"cache_analysis":{"description":"Cache subsection — exact + semantic + miss counts and savings."},"latency":{"description":"Latency / error-rate distribution."},"models":{"description":"Per-model breakdown (model → counters + cost)."},"period":{"type":"string","description":"Time window the rollup covers (e.g. `\"24h\"`, `\"7d\"`, `\"30d\"`)."},"providers":{"description":"Per-provider breakdown."},"time_series":{"description":"Cost & traffic time-series."},"top_consumers":{"description":"Top consumers — API keys, projects, users."},"top_tenants":{"description":"Top tenants by cost (admin only, otherwise empty)."},"total_cost_usd":{"type":"number","format":"double","description":"Total cost in USD.","example":12.45},"total_requests":{"type":"integer","format":"int64","description":"Aggregate request counter for the window.","example":15000,"minimum":0}},"additionalProperties":{"description":"Catch-all for fields added by future analytics rollups."}},"AnalyticsV2Response":{"type":"object","description":"Top-level V2 analytics response — no internal layer names.","required":["cache","memory","total_savings_usd","period"],"properties":{"cache":{"$ref":"#/components/schemas/CacheAnalyticsV2"},"memory":{"$ref":"#/components/schemas/MemoryAnalyticsV2"},"period":{"$ref":"#/components/schemas/AnalyticsPeriodV2"},"total_savings_usd":{"type":"number","format":"double"}}},"ApprovalRequest":{"type":"object","required":["call_id","approved"],"properties":{"approved":{"type":"boolean","example":true},"call_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"comment":{"type":"string","nullable":true}}},"ArmShare":{"type":"object","description":"One model's share of the window's routing decisions.","required":["model","decisions","share"],"properties":{"decisions":{"type":"integer","format":"int64","example":42,"minimum":0},"model":{"type":"string","example":"groq/llama-3.1-8b-instant"},"share":{"type":"number","format":"double","example":0.35}}},"AuditDecisionsResponse":{"type":"object","required":["requests","total"],"properties":{"requests":{"type":"array","items":{"$ref":"#/components/schemas/RequestHistory"}},"total":{"type":"integer","format":"int64","example":42}}},"AuditLogResponse":{"type":"object","required":["id","timestamp","actor_type","action","resource_type","outcome","details"],"properties":{"action":{"type":"string"},"actor_id":{"type":"string","description":"The user who performed the action (`None` for system events).","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"actor_type":{"type":"string"},"details":{},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"ip_address":{"type":"string","example":"203.0.113.42","nullable":true},"outcome":{"type":"string"},"resource_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"resource_type":{"type":"string"},"timestamp":{"type":"string","example":"2026-05-17T18:30:00Z"}}},"AuditLogsResponse":{"type":"object","required":["events"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}}}},"AutoTopUpRequest":{"type":"object","required":["enabled"],"properties":{"amount_usd":{"type":"integer","format":"int32","description":"Amount to recharge with (USD, 5..=10000, same limits as manual top-up)","nullable":true,"minimum":0},"enabled":{"type":"boolean","description":"Turn automatic recharge on or off"},"threshold_usd":{"type":"integer","format":"int32","description":"Recharge when the balance falls below this (USD, 1..=1000)","nullable":true,"minimum":0}}},"AwsBeginRequest":{"type":"object","description":"Body for `POST /v1/connections/aws/begin`: start a secure cross-account\n(CloudFormation / AssumeRole) Bedrock connection. The only input is the\nregion the customer wants to invoke Bedrock in; no long-lived keys are ever\naccepted.","properties":{"region":{"type":"string","example":"us-east-1","nullable":true}}},"AwsCompleteRequest":{"type":"object","description":"Body for `POST /v1/connections/aws/complete`: finish a connection started\nby `/aws/begin`. The customer pastes the ARN of the per-connection role\ncreated by the CloudFormation stack; the gateway verifies it with a real\n`sts:AssumeRole`, an ExternalId negative control and\n`bedrock:ListFoundationModels` before activating.","required":["roleArn"],"properties":{"region":{"type":"string","description":"Optional region override; defaults to the region captured at `/aws/begin`.","example":"us-east-1","nullable":true},"roleArn":{"type":"string","example":"arn:aws:iam::123456789012:role/XantlyCC-Bedrock-a1b2c3d4e5f6"},"stackId":{"type":"string","description":"Optional CloudFormation stack id, stored for audit/troubleshooting.","example":"arn:aws:cloudformation:us-east-1:123456789012:stack/XantlyBedrockAccess/abcd","nullable":true}}},"AzureDeployModelRequest":{"type":"object","required":["subscriptionId","resourceGroup","accountName","modelName","deploymentName"],"properties":{"accountName":{"type":"string","example":"acme"},"deploymentName":{"type":"string","example":"acme"},"modelName":{"type":"string","example":"acme"},"resourceGroup":{"type":"string"},"subscriptionId":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"BYOKProvider":{"type":"object","required":["id","tenantId","provider","apiKeyEncrypted","isActive","priority","createdAt"],"properties":{"apiKeyEncrypted":{"type":"string"},"createdAt":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"isActive":{"type":"boolean","example":true},"lastUsedAt":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z","nullable":true},"priority":{"type":"integer","format":"int32"},"provider":{"type":"string"},"tenantId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"BarpOverviewResponse":{"type":"object","required":["learning_status","total_tenants_with_weights","model_pool_size","enabled_model_count","default_exploration_alpha_max","default_exploration_alpha_min","default_decay_horizon"],"properties":{"default_decay_horizon":{"type":"number","format":"float"},"default_exploration_alpha_max":{"type":"number","format":"float"},"default_exploration_alpha_min":{"type":"number","format":"float"},"enabled_model_count":{"type":"integer","example":42,"minimum":0},"learning_status":{"type":"string"},"model_pool_size":{"type":"integer","minimum":0},"total_tenants_with_weights":{"type":"integer","format":"int64","minimum":0}}},"BarpStatsResponse":{"type":"object","required":["time_range","total_requests","model_distribution","confidence_distribution","preference_dial","weight_divergence","cost_savings","workflow_breakdown"],"properties":{"confidence_distribution":{"$ref":"#/components/schemas/ConfidenceDistribution"},"cost_savings":{"$ref":"#/components/schemas/CostSavingsStats"},"model_distribution":{"type":"array","items":{"$ref":"#/components/schemas/BarpModelStat"}},"preference_dial":{"$ref":"#/components/schemas/PreferenceDialStats"},"time_range":{"type":"string"},"total_requests":{"type":"integer","format":"int64","example":15000,"minimum":0},"weight_divergence":{"type":"number","format":"float","example":0.12},"workflow_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowBreakdown"}}}},"BarpTenantDynamicsResponse":{"type":"object","required":["tenant_id","model_count","update_count","exploration_ratio","note"],"properties":{"exploration_ratio":{"type":"number","format":"double"},"model_count":{"type":"integer","example":42,"minimum":0},"note":{"type":"string"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"update_count":{"type":"integer","format":"int64","example":42,"minimum":0}}},"BarpWeightsResponse":{"type":"object","required":["tenant_id","has_signal","arm_norms"],"properties":{"arm_norms":{"description":"L2 norm of θ̂ per arm — higher = more confident."},"has_signal":{"type":"boolean","description":"True once the bandit has accumulated enough signal to recommend\nnon-default arms.","example":true},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"updated_at":{"type":"string","description":"Last update timestamp (RFC 3339).","example":"2026-05-17T18:30:00Z","nullable":true}}},"BillingInfoResponse":{"type":"object","required":["plan_tier","current_month_usage_usd","current_month_voice_usage_usd","credit_balance_cents","pending_credit_cents","has_payment_method","ever_funded","unfunded_allowance_usd","unfunded_allowance_remaining_usd"],"properties":{"contract_beta":{"type":"number","format":"double","description":"Enterprise contract visibility: present when the org has an active (or\nscheduled) contract, so the customer can see their negotiated base rate\nwithout asking support. None for consumer orgs.","example":0.03,"nullable":true},"contract_effective_from":{"type":"string","nullable":true},"contract_expires_at":{"type":"string","nullable":true},"contract_status":{"type":"string","example":"active","nullable":true},"credit_balance_cents":{"type":"integer","format":"int64"},"current_month_usage_usd":{"type":"number","format":"double","example":0.42},"current_month_voice_usage_usd":{"type":"number","format":"double","description":"Voice-only portion of current_month_usage_usd (tracked separately in\n`budget:usage:{org}:voice:{month}` for the modality breakdown UI).\nText usage = current_month_usage_usd - current_month_voice_usage_usd."},"current_period_end":{"type":"string","nullable":true},"ever_funded":{"type":"boolean","description":"True once the org has ever funded credits (any positive-amount\n`credit_transactions` row: purchase, grant or refund). While this is\nfalse the org is subject to `unfunded_allowance_usd` below."},"has_payment_method":{"type":"boolean","description":"True when the org has a default card on file in Stripe."},"payment_method_brand":{"type":"string","example":"visa","nullable":true},"payment_method_last4":{"type":"string","example":"4242","nullable":true},"pending_credit_cents":{"type":"integer","format":"int64"},"plan_tier":{"type":"string","example":"pro"},"stripe_customer_id":{"type":"string","nullable":true},"subscription_status":{"type":"string","nullable":true},"unfunded_allowance_remaining_usd":{"type":"number","format":"double","description":"What is left of `unfunded_allowance_usd` this calendar month, floored at\nzero. `0.0` when the ceiling does not apply.","example":0.58},"unfunded_allowance_usd":{"type":"number","format":"double","description":"USD of billed usage per calendar month this org may spend before it must\nfund. `0.0` means the ceiling does not apply: the org has funded, or an\nexplicit budget is configured and governs instead.\n\nComputed by `middleware::budget::spend_ceiling`, the same function the\nentitlement preflight enforces, so this can never quote a cap other than\nthe one that actually stops the request. Before this field existed the\ncustomer met the ceiling as an unexplained 402.","example":1.0}}},"BillingLimitsResponse":{"type":"object","required":["plan_tier","plan_budget_cap_usd","voice_enabled","budget_alert_thresholds","hard_block_on_cap","overage_enabled","overage_hard_cap_usd"],"properties":{"budget_alert_thresholds":{"type":"array","items":{"type":"number","format":"double"}},"hard_block_on_cap":{"type":"boolean","example":true},"monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"overage_enabled":{"type":"boolean","example":true},"overage_hard_cap_usd":{"type":"number","format":"double","example":0.42},"plan_budget_cap_usd":{"type":"number","format":"double","example":0.42},"plan_tier":{"type":"string","example":"pro"},"voice_enabled":{"type":"boolean","example":true},"voice_monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true}}},"BlockedActionsResponse":{"type":"object","required":["blocked","total_count"],"properties":{"blocked":{"type":"array","items":{"$ref":"#/components/schemas/BlockedAction"}},"total_count":{"type":"integer","example":42,"minimum":0}}},"BreakerStatus":{"type":"object","required":["name","state","failure_count"],"properties":{"failure_count":{"type":"integer","format":"int32","example":42,"minimum":0},"last_failure":{"type":"string","nullable":true},"name":{"type":"string","example":"Acme Corporation"},"state":{"type":"string"}}},"BridgeCall":{"type":"object","description":"One bridge call, as emitted in the `list_calls` envelope.\nMirrors `x_core::entities::bridge_calls::Model`.","required":["id","bridge_id","tool_id","tool","status","arguments","queued_at","priority","timeout_ms","requires_approval","created_at"],"properties":{"approval_comment":{"type":"string","nullable":true},"approved":{"type":"boolean","nullable":true},"approved_at":{"type":"string","format":"date-time","nullable":true},"approved_by":{"type":"string","nullable":true},"arguments":{},"bridge_id":{"type":"string","example":"br_3f2e1a90"},"completed_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"duration_ms":{"type":"integer","format":"int32","example":145,"nullable":true},"error":{"nullable":true},"id":{"type":"string","example":"call_3f2e1a90"},"priority":{"type":"string","example":"normal"},"queued_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"request_size_bytes":{"type":"integer","format":"int32","nullable":true},"requires_approval":{"type":"boolean"},"response_size_bytes":{"type":"integer","format":"int32","nullable":true},"result":{"nullable":true},"sent_at":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","example":"queued"},"timeout_ms":{"type":"integer","format":"int32","example":30000},"tool":{"type":"string","example":"Acme Corporation"},"tool_id":{"type":"string","example":"tool_3f2e1a90"},"trace_id":{"type":"string","nullable":true}}},"BridgeCallDetail":{"type":"object","required":["id","bridge_id","tool_id","status","started_at","arguments"],"properties":{"arguments":{},"bridge_id":{"type":"string","example":"br_3f2e1a90"},"completed_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z","nullable":true},"duration_ms":{"type":"integer","format":"int32","example":145,"nullable":true},"error_message":{"type":"string","nullable":true},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"result":{"nullable":true},"started_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"status":{"type":"string","example":"active"},"tool_id":{"type":"string","example":"tool_3f2e1a90"}}},"BridgeDetailResponse":{"type":"object","required":["id","name","status","config","security","stats"],"properties":{"config":{"$ref":"#/components/schemas/BridgeConfig"},"connection":{"allOf":[{"$ref":"#/components/schemas/BridgeConnectionInfo"}],"nullable":true},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"security":{"$ref":"#/components/schemas/BridgeSecurityConfig"},"stats":{"$ref":"#/components/schemas/BridgeStats"},"status":{"type":"string","example":"active"},"version":{"type":"string","example":"1.0.0","nullable":true}}},"BridgeHealthResponse":{"type":"object","required":["status","last_heartbeat","latency_ms","connection_age_seconds","pending_calls","errors_last_hour"],"properties":{"connection_age_seconds":{"type":"integer","format":"int64","example":3600},"errors_last_hour":{"type":"integer","format":"int64"},"last_heartbeat":{"type":"string","example":"2026-05-17T18:30:00Z"},"latency_ms":{"type":"integer","format":"int64","example":145},"pending_calls":{"type":"integer","format":"int64"},"status":{"type":"string","description":"One of: `healthy` | `degraded` | `offline`.","example":"active"}}},"BridgeRegistrationRequest":{"type":"object","required":["name","config","security"],"properties":{"config":{"$ref":"#/components/schemas/BridgeConfig"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"metadata":{"nullable":true},"name":{"type":"string","example":"Acme Corporation"},"security":{"$ref":"#/components/schemas/BridgeSecurityConfig"}}},"BridgeRegistrationResponse":{"type":"object","required":["id","name","status","secret","activation_url"],"properties":{"activation_url":{"type":"string","example":"https://api.xantly.com"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"secret":{"type":"string"},"status":{"type":"string","example":"active"}}},"BridgeSecurityStatusResponse":{"type":"object","required":["bridge_id","encryption","authentication","access_control","compliance"],"properties":{"access_control":{"$ref":"#/components/schemas/BridgeAccessControl"},"authentication":{"$ref":"#/components/schemas/BridgeAuthInfo"},"bridge_id":{"type":"string","example":"br_3f2e1a90"},"compliance":{"$ref":"#/components/schemas/BridgeCompliance"},"encryption":{"$ref":"#/components/schemas/BridgeEncryptionInfo"}}},"BridgeStatusResponse":{"type":"object","required":["id","name","status","tools_count","calls_24h","avg_latency_ms"],"properties":{"avg_latency_ms":{"type":"number","format":"double","example":145},"calls_24h":{"type":"integer","format":"int64"},"connected_since":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z","nullable":true},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"last_heartbeat":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z","nullable":true},"name":{"type":"string","example":"Acme Corporation"},"status":{"type":"string","example":"active"},"tools_count":{"type":"integer","example":42,"minimum":0},"version":{"type":"string","example":"1.0.0","nullable":true}}},"BridgeTool":{"type":"object","description":"One registered bridge tool, as emitted in the `list_tools` envelope.\nMirrors `x_core::entities::bridge_tools::Model`.","required":["id","bridge_id","name","type","parameters","returns","security","usage24h","avg_latency_ms","created_at","updated_at"],"properties":{"avg_latency_ms":{"type":"number","format":"double","example":145},"bridge_id":{"type":"string","example":"br_3f2e1a90"},"category":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"description":{"type":"string","nullable":true},"examples":{"nullable":true},"id":{"type":"string","example":"tool_3f2e1a90"},"name":{"type":"string","example":"Acme Corporation"},"parameters":{},"returns":{},"security":{},"type":{"type":"string","example":"query"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"usage24h":{"type":"integer","format":"int64","example":42}}},"BrowserSessionResponse":{"type":"object","required":["user","reauthenticationRequired","isSocialUser","organization","role","permissions","platform"],"properties":{"isSocialUser":{"type":"boolean","description":"True when the account was created via Google/GitHub OAuth and has no password set.","example":true},"organization":{"$ref":"#/components/schemas/SessionOrganization"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/crate.services.authorizer.Permission"},"description":"Exactly what the backend will authorize for `role`, from the same\nmatrix the enforcement path evaluates, so the UI cannot drift from it."},"platform":{"$ref":"#/components/schemas/SessionPlatform"},"reauthenticationRequired":{"type":"boolean","example":true},"role":{"type":"string","description":"The membership role for that organization, or the literal `\"none\"` when\nno membership row exists. `user.role` mirrors it (falling back to\n`users.role`); this one is the authorizer's own answer.","example":"owner"},"user":{"$ref":"#/components/schemas/UserResponse"}}},"BudgetBurnRow":{"type":"object","description":"GET /admin/analytics/budget-burn - Daily budget burn rate + projections (admin only)\n\nReturns per-day cost actuals plus a 7-day linear projection for the top-N orgs\nand a platform-wide total.","required":["date","total_cost_usd","total_customer_charge_usd","total_requests","is_projection"],"properties":{"date":{"type":"string","format":"date"},"is_projection":{"type":"boolean","example":true},"total_cost_usd":{"type":"number","format":"double","example":12.45},"total_customer_charge_usd":{"type":"number","format":"double","example":0.42},"total_requests":{"type":"integer","format":"int64","example":15000}}},"BudgetCapResponse":{"type":"object","required":["id","scope_type","scope_id","budget_type","limit_usd","current_spend_usd","is_active","alert_threshold","created_at","updated_at"],"properties":{"alert_threshold":{"type":"number","format":"float"},"budget_type":{"type":"string"},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"current_spend_usd":{"type":"number","format":"double","example":0.42},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"is_active":{"type":"boolean","example":true},"limit_usd":{"type":"number","format":"double","example":0.42},"scope_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"scope_type":{"type":"string"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"}}},"BudgetCurrentResponse":{"type":"object","required":["spend_today_usd","spend_month_usd","burn_rate_per_hour_usd"],"properties":{"burn_rate_per_hour_usd":{"type":"number","format":"double","example":0.42},"daily_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"remaining_month_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"remaining_today_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"spend_month_usd":{"type":"number","format":"double","example":0.42},"spend_today_usd":{"type":"number","format":"double","example":0.42},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true}}},"BudgetOverviewResponse":{"type":"object","required":["organization_id","organization_caps","api_key_caps"],"properties":{"api_key_caps":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyBudgetResponse"}},"organization_caps":{"type":"array","items":{"$ref":"#/components/schemas/BudgetCapResponse"}},"organization_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"BudgetResponse":{"type":"object","required":["used_usd","currency","plan_tier","voice_minutes_used","voice_concurrent_sessions_limit","voice_rpm_limit"],"properties":{"budget_cap_usd":{"type":"number","format":"double","description":"Hard budget cap in USD (e.g., $500 for Scale)","example":0.42,"nullable":true},"budget_utilization_pct":{"type":"number","format":"double","description":"Fraction of budget cap consumed (0.0 - 1.0+)","example":0.95,"nullable":true},"currency":{"type":"string"},"included_budget_usd":{"type":"number","format":"double","description":"Included monthly USD budget from plan (e.g., $20 for Pro)","example":0.42,"nullable":true},"monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"plan_tier":{"type":"string","example":"pro"},"remaining_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"used_usd":{"type":"number","format":"double","example":0.42},"voice_concurrent_sessions_limit":{"type":"integer","format":"int32","minimum":0},"voice_minutes_limit":{"type":"integer","format":"int32","nullable":true,"minimum":0},"voice_minutes_used":{"type":"number","format":"double"},"voice_rpm_limit":{"type":"integer","format":"int32","minimum":0}}},"BulkEnableModelsRequest":{"type":"object","description":"Body for `POST /v1/connections/{provider}/enable-models`.","required":["modelIds"],"properties":{"modelIds":{"type":"array","items":{"type":"string"},"description":"Bedrock model ids to enable, as discovered into this connection.\nDuplicates are collapsed. At most\n`bedrock_discovery::BULK_ENABLE_MAX_MODELS` per call: a \"select all\"\nover a large account sends several batches, which also gives the UI real\nprogress instead of one opaque wait."}}},"BulkEnableModelsResponse":{"type":"object","description":"200 response from `POST /v1/connections/{provider}/enable-models`.\n\nThis is 200 even when every model failed: the per model results ARE the\nanswer, and a non-2xx would leave a UI with nothing to render but a blank\nerror. `enabled` is the count AWS confirmed, never the count we attempted.","required":["provider","connectionId","requested","enabled","pending","failed","notAttempted","results","modelCount","enabledModelCount","routableModelCount","ready","message"],"properties":{"connectionId":{"type":"string","format":"uuid"},"enabled":{"type":"integer","description":"Confirmed invokable after this call.","minimum":0},"enabledModelCount":{"type":"integer","format":"int64"},"failed":{"type":"integer","description":"Refused or not completed.","minimum":0},"message":{"type":"string","description":"Plain summary of what just happened."},"modelCount":{"type":"integer","format":"int64","description":"Connection wide counts AFTER this call."},"notAttempted":{"type":"integer","description":"Never reached inside the request's time budget.","minimum":0},"pending":{"type":"integer","description":"Accepted by AWS but not invokable yet, or waiting on a console action.","minimum":0},"provider":{"type":"string","example":"bedrock"},"ready":{"type":"boolean","description":"Whether the connection can serve traffic now."},"requested":{"type":"integer","description":"Distinct model ids acted on.","minimum":0},"results":{"type":"array","items":{"$ref":"#/components/schemas/bedrock_discovery.ModelEnableResult"},"description":"One entry per requested id, in request order."},"routableModelCount":{"type":"integer","format":"int64"}}},"BulkImportRequest":{"type":"object","required":["memories"],"properties":{"memories":{"type":"array","items":{"$ref":"#/components/schemas/StoreMemoryRequest"}},"options":{"allOf":[{"$ref":"#/components/schemas/BulkImportOptions"}],"nullable":true}}},"BulkImportResponse":{"type":"object","required":["imported","skipped_duplicates","errors"],"properties":{"errors":{"type":"array","items":{"type":"string"}},"imported":{"type":"integer","minimum":0},"skipped_duplicates":{"type":"integer","minimum":0}}},"CacheAnalyticsV2":{"type":"object","description":"Cache hit/miss/rate/cost.","required":["hits","misses","hit_rate","cost_saved_usd"],"properties":{"cost_saved_usd":{"type":"number","format":"double"},"hit_rate":{"type":"number","format":"double"},"hits":{"type":"integer","format":"int64"},"misses":{"type":"integer","format":"int64"}}},"CacheConfigResponse":{"type":"object","required":["tenant_id","config","stats"],"properties":{"config":{"$ref":"#/components/schemas/CacheConfig"},"stats":{"$ref":"#/components/schemas/CacheStats"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"CacheEfficiencyResponse":{"type":"object","required":["period","total_requests","exact_hit_count","semantic_hit_count","miss_count","hit_rate_pct","cost_savings_usd","by_model"],"properties":{"by_model":{"description":"Per-model breakdown of cache effectiveness."},"cost_savings_usd":{"type":"number","format":"double","example":0.42},"exact_hit_count":{"type":"integer","format":"int64","example":42,"minimum":0},"hit_rate_pct":{"type":"number","format":"double","example":78.5},"miss_count":{"type":"integer","format":"int64","example":42,"minimum":0},"period":{"type":"string"},"semantic_hit_count":{"type":"integer","format":"int64","example":42,"minimum":0},"total_requests":{"type":"integer","format":"int64","example":15000,"minimum":0}}},"CacheEntriesResponse":{"type":"object","required":["entries","pagination"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/CacheEntryPreview"}},"pagination":{"$ref":"#/components/schemas/PaginationInfo"}}},"CacheInspectResponse":{"type":"object","required":["entries"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/CacheInspectEntry"}}}},"CacheInvalidateRequest":{"type":"object","properties":{"pattern":{"type":"string","nullable":true}}},"CacheInvalidateResponse":{"type":"object","required":["status","invalidated_count"],"properties":{"invalidated_count":{"type":"integer","format":"int64","example":42,"minimum":0},"status":{"type":"string","description":"\"success\"","example":"success"}}},"CachePurgeRequest":{"type":"object","required":["scope","dry_run"],"properties":{"dry_run":{"type":"boolean","example":true},"model":{"type":"string","example":"bedrock/nova-pro/us-east-1","nullable":true},"pattern":{"type":"string","nullable":true},"scope":{"$ref":"#/components/schemas/PurgeScope"}}},"CachePurgeResponse":{"type":"object","required":["purge_id","entries_deleted","storage_freed_mb"],"properties":{"entries_deleted":{"type":"integer","format":"int64","minimum":0},"purge_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"storage_freed_mb":{"type":"number","format":"double"}}},"CacheStats":{"type":"object","required":["keys","memory_used_mb","hit_rate"],"properties":{"hit_rate":{"type":"number","format":"double","example":0.95},"keys":{"type":"integer","format":"int64","minimum":0},"memory_used_mb":{"type":"number","format":"double"}}},"CacheStatsResponse":{"type":"object","required":["hit_rate","hits","misses","total_entries"],"properties":{"hit_rate":{"type":"number","format":"double","example":0.95},"hits":{"type":"integer","format":"int64","minimum":0},"misses":{"type":"integer","format":"int64","minimum":0},"total_entries":{"type":"integer","format":"int64","minimum":0}}},"CacheWarmRequest":{"type":"object","required":["queries"],"properties":{"queries":{"type":"array","items":{"type":"string"}}}},"CacheWarmResponse":{"type":"object","required":["warm_job_id","queries_queued"],"properties":{"queries_queued":{"type":"integer","minimum":0},"warm_job_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"CalibrationIngestBody":{"type":"object","description":"Items to embed and store.","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CalibrationItem"}}}},"CalibrationItem":{"type":"object","description":"One labelled request. `outcomes` maps a catalog slug to whether that\nmodel answered it correctly.","required":["uid","text","source","split","outcomes"],"properties":{"outcomes":{"type":"object","additionalProperties":{"type":"boolean"}},"source":{"type":"string"},"split":{"type":"string","description":"`\"calibration\"` or `\"eval\"`. Eval items are refused."},"text":{"type":"string"},"uid":{"type":"string"}}},"CalibrationStatus":{"type":"object","description":"What the store holds.","required":["enabled","collection"],"properties":{"collection":{"type":"string"},"enabled":{"type":"boolean","description":"Whether lookups are enabled (`XANTLY_FF_MEASURED_DIFFICULTY`)."},"points":{"type":"integer","format":"int64","description":"Points in the collection, when Qdrant answered.","nullable":true,"minimum":0}}},"CapabilityMatrixHealth":{"type":"object","required":["model_count","benchmark_count","benchmarks","axes","history"],"properties":{"active_dim":{"type":"integer","format":"int32","nullable":true,"minimum":0},"axes":{"type":"array","items":{"$ref":"#/components/schemas/AxisSummary"}},"benchmark_count":{"type":"integer","format":"int32","example":42,"minimum":0},"benchmarks":{"type":"array","items":{"$ref":"#/components/schemas/BenchmarkHealth"}},"converged":{"type":"boolean","example":true,"nullable":true},"current_version":{"type":"integer","format":"int64","nullable":true,"minimum":0},"fit_method":{"type":"string","example":"mml","nullable":true},"history":{"type":"array","items":{"$ref":"#/components/schemas/MatrixVersionEntry"}},"holdout_rmse":{"type":"number","format":"double","nullable":true},"iterations":{"type":"integer","format":"int32","nullable":true,"minimum":0},"log_likelihood":{"type":"number","format":"double","nullable":true},"model_count":{"type":"integer","format":"int32","example":42,"minimum":0},"published_at":{"type":"integer","format":"int64","example":1747506600,"nullable":true}}},"ChainDetailResponse":{"type":"object","description":"Single chain detail (returned by `get_chain` on success).","required":["chain_id","status","fields"],"properties":{"chain_id":{"type":"string","example":"chain_3f2e1a90"},"created_at":{"type":"string","example":"2026-05-17T18:30:00Z","nullable":true},"fields":{"description":"Per-step results so far (free-form per chain type)."},"last_updated_at":{"type":"string","example":"2026-05-17T18:30:00Z","nullable":true},"objective":{"type":"string","example":"summarize last quarter's sales calls","nullable":true},"status":{"type":"string","description":"Lifecycle: `Executing` | `Completed` | `Cancelled` | `Failed`.","example":"active"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true}}},"ChainStateAckResponse":{"type":"object","description":"Common ack envelope for `cancel_chain` / `resume_chain`.","required":["chain_id","status"],"properties":{"chain_id":{"type":"string","example":"chain_3f2e1a90"},"status":{"type":"string","description":"New chain status after the action: e.g. `Cancelled`, `Executing`.","example":"active"}}},"ChainStatsResponse":{"type":"object","required":["total_chains","executing","completed","cancelled","failed","avg_duration_ms","by_status"],"properties":{"avg_duration_ms":{"type":"number","format":"double","example":145},"by_status":{"description":"Per-status counters; mirrors the top-level fields for convenience."},"cancelled":{"type":"integer","format":"int64"},"completed":{"type":"integer","format":"int64"},"executing":{"type":"integer","format":"int64"},"failed":{"type":"integer","format":"int64"},"total_chains":{"type":"integer","format":"int64"}}},"ChangePasswordRequest":{"type":"object","required":["current_password","new_password"],"properties":{"current_password":{"type":"string"},"new_password":{"type":"string"}}},"CheckByokStatusResponse2":{"type":"object","description":"Checks byok status.\nAuto-typed response envelope for `check_byok_status` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["error"],"properties":{"error":{}}},"CheckoutRequest":{"type":"object","properties":{"price_id":{"type":"string","nullable":true}}},"CheckoutResponse":{"type":"object","required":["url"],"properties":{"url":{"type":"string","example":"https://api.xantly.com"}}},"CircuitResetRequest":{"type":"object","properties":{"strategy":{"type":"string","nullable":true}}},"CircuitResetResponse":{"type":"object","required":["reset_strategies","status"],"properties":{"reset_strategies":{"type":"array","items":{"type":"string"}},"status":{"type":"string","example":"circuit_breakers_reset"}}},"ClassifyComplexityRequest":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string"}}},"ClassifyComplexityResponse":{"type":"object","required":["complexity_score","category","recommended_tier"],"properties":{"category":{"type":"string"},"complexity_score":{"type":"integer","format":"int32","description":"Heuristic complexity on a 0-100 scale (higher = more complex). In practice\nthe heuristic emits values in the 20..=85 range.","example":85,"maximum":100,"minimum":0},"recommended_tier":{"type":"string"}}},"ClearMemoryRequest":{"type":"object","required":["scope"],"properties":{"preserve_entities":{"type":"boolean","example":true},"scope":{"$ref":"#/components/schemas/ClearScope"},"user_id":{"type":"string","example":"a3bb189e-8bf9-3888-9912-ace4e6543002","nullable":true}}},"ClearMemoryResponse":{"type":"object","required":["deleted_memories","deleted_entities","deleted_relationships"],"properties":{"deleted_entities":{"type":"integer","format":"int64","minimum":0},"deleted_memories":{"type":"integer","format":"int64","minimum":0},"deleted_relationships":{"type":"integer","format":"int64","minimum":0}}},"CloneWorkflowResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["workflow_id"],"properties":{"workflow_id":{}}},"CloudConnectAcceptedResponse":{"type":"object","description":"201 Accepted response from `POST /v1/connections/{aws|gcp|azure}` — the\nconnection record has been written and model discovery is running\nasynchronously.  Poll `GET /v1/connections/{provider}` for the\ndiscovered model list.","required":["status","connectionId","message"],"properties":{"connectionId":{"type":"string","format":"uuid","description":"Opaque identifier for the new connection row in `byok_providers`.","example":"550e8400-e29b-41d4-a716-446655440000"},"message":{"type":"string","description":"Human-readable progress note.","example":"Operation accepted; results will be available shortly."},"modelsFound":{"type":"integer","format":"int64","description":"Count of models found during the initial discovery sweep.  Only set\nwhen discovery completed synchronously inside the connect call.","nullable":true},"status":{"type":"string","description":"One of: `connecting` | `connected` | `discovering`.","example":"active"}}},"CloudConnection":{"type":"object","required":["id","provider","providerType","cloudStatus","healthStatus","modelCount","enabledModelCount","createdAt"],"properties":{"awsAccountId":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"awsRegion":{"type":"string","nullable":true},"azureSubscriptionId":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"cloudStatus":{"type":"string"},"createdAt":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"enabledModelCount":{"type":"integer","format":"int64","example":42},"gcpProjectId":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"healthError":{"type":"string","nullable":true},"healthStatus":{"type":"string"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"lastHealthCheck":{"type":"string","format":"date-time","nullable":true},"modelCount":{"type":"integer","format":"int64","example":42},"provider":{"type":"string","example":"openai"},"providerType":{"type":"string"}}},"CloudConnectionDetail":{"allOf":[{"$ref":"#/components/schemas/CloudConnection"},{"type":"object","required":["models"],"properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/CloudModel"}}}}]},"CloudCreditsConnectionItem":{"type":"object","description":"One cloud-credits connection belonging to an organization.","required":["id","provider_type","cloud_status","is_active","serving","fee_bps"],"properties":{"cloud_status":{"type":"string","description":"`pending` | `connecting` | `active` | `error` | `disconnected`.","example":"active"},"connected_at":{"type":"string","nullable":true},"fee_bps":{"type":"integer","format":"int32","description":"This connection's fee, in basis points of measured provider cost.","example":300},"fee_updated_at":{"type":"string","nullable":true},"fee_updated_by":{"type":"string","description":"Admin who last set this connection's fee, or `null` if it has never\nbeen set (the value is whatever the default was at connect time).","nullable":true},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"is_active":{"type":"boolean"},"provider_type":{"type":"string","description":"`bedrock`, `vertex_ai`, and so on: which cloud this connection routes to.","example":"bedrock"},"serving":{"type":"boolean","description":"Whether this connection would actually serve traffic right now\n(`cloud_status = 'active' AND is_active`). The same rule the request\npath applies, so the operator sees serve-readiness, not a raw status."}}},"CloudCreditsFeeItem":{"type":"object","description":"One organization that has at least one cloud-credits connection.","required":["id","name","slug","plan_tier","fee_bps_uniform","is_pilot","fee_explicitly_set","connections"],"properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/CloudCreditsConnectionItem"}},"fee_bps":{"type":"integer","format":"int32","description":"The org's effective fee in basis points, present ONLY when every one of\nits cloud-credits connections carries the same value. `null` means the\nconnections disagree and the per-connection numbers must be read\ninstead; it never means \"no fee\".","example":300,"nullable":true},"fee_bps_uniform":{"type":"boolean","description":"Whether all this org's connections agree on a fee. False makes the\n`null` above readable rather than ambiguous."},"fee_explicitly_set":{"type":"boolean","description":"Whether an operator has explicitly set this fee (any connection has\nprovenance). A `fee_bps` of 0 with this false is a historical default,\nnot a granted pilot."},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"is_pilot":{"type":"boolean","description":"True only when the org is UNIFORMLY at 0 bps: Xantly bills nothing on\ntop of this org's own cloud spend."},"name":{"type":"string"},"plan_tier":{"type":"string","example":"enterprise"},"slug":{"type":"string"}}},"CompileGrammarRequest":{"type":"object","required":["schema_id","models"],"properties":{"models":{"type":"array","items":{"type":"string"}},"schema_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"CompileGrammarResponse":{"type":"object","required":["grammar_id","schema_id","compiled_for","size_kb","compile_time_ms"],"properties":{"compile_time_ms":{"type":"integer","format":"int32","example":145},"compiled_for":{"type":"array","items":{"type":"string"}},"grammar_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"schema_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"size_kb":{"type":"integer","format":"int32"}}},"ConfidenceBin":{"type":"object","description":"GET /admin/analytics/routing-confidence - Per-confidence-bin calibration data (admin only)\n\nReturns rows bucketed by routing_confidence score (0-1 in 0.1 increments) with actual\nsuccess rates and request counts so the UI can render a calibration plot.","required":["bin_low","bin_high","request_count","success_count","actual_success_rate"],"properties":{"actual_success_rate":{"type":"number","format":"double","example":0.95},"avg_latency_ms":{"type":"number","format":"double","example":145,"nullable":true},"bin_high":{"type":"number","format":"double"},"bin_low":{"type":"number","format":"double"},"provider":{"type":"string","example":"openai","nullable":true},"request_count":{"type":"integer","format":"int64","example":15000},"routing_recommended_tier":{"type":"integer","format":"int32","nullable":true},"routing_tier_used":{"type":"integer","format":"int32","nullable":true},"success_count":{"type":"integer","format":"int64","example":42}}},"ConnectAzureRequest":{"type":"object","required":["apiKey","endpoint"],"properties":{"apiKey":{"type":"string"},"endpoint":{"type":"string"},"resourceName":{"type":"string","example":"acme","nullable":true}}},"ConnectGCPRequest":{"type":"object","required":["projectId","serviceAccountKey"],"properties":{"projectId":{"type":"string","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479"},"region":{"type":"string","example":"us-east-1","nullable":true},"serviceAccountKey":{"type":"string"}}},"ConnectionReadiness":{"type":"object","description":"Answer to \"can this customer send traffic, and if not, what is missing\".","required":["provider","connectionId","ready","cloudStatus","healthStatus","modelCount","enabledModelCount","routableModelCount","modelStatusCounts","sampleRoutableModels","blockers","warnings","summary"],"properties":{"blockers":{"type":"array","items":{"$ref":"#/components/schemas/ReadinessItem"},"description":"Hard stops. Non-empty means `ready` is false."},"cloudStatus":{"type":"string"},"connectionId":{"type":"string","format":"uuid"},"enabledModelCount":{"type":"integer","format":"int64","description":"Models AWS confirmed the account is authorized AND entitled to invoke."},"healthError":{"type":"string","nullable":true},"healthStatus":{"type":"string"},"modelCount":{"type":"integer","format":"int64","description":"Models discovered in the customer's account."},"modelStatusCounts":{"type":"object","description":"Every distinct stored status with its count, so nothing is hidden.","additionalProperties":{"type":"integer","format":"int64"}},"provider":{"type":"string","example":"bedrock"},"ready":{"type":"boolean","description":"True when the gateway will accept and route requests for this org right\nnow. Blockers are what makes it false."},"region":{"type":"string","nullable":true},"routableModelCount":{"type":"integer","format":"int64","description":"Models the gateway will route to, which includes discovered models whose\naccess has not been confirmed yet."},"sampleRoutableModels":{"type":"array","items":{"type":"string"},"description":"A few routable model ids, for showing what the key can reach."},"summary":{"type":"string","description":"One sentence version of the whole payload."},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/ReadinessItem"},"description":"Things that are not stopping traffic but will bite later."}}},"ConstrainedDecodingConfigResponse":{"type":"object","required":["enabled","supported_models","grammar_cache_size","default_mode","performance"],"properties":{"default_mode":{"type":"string"},"enabled":{"type":"boolean","example":true},"grammar_cache_size":{"type":"integer","format":"int32"},"performance":{"$ref":"#/components/schemas/PerformanceStats"},"supported_models":{"type":"array","items":{"type":"string"}}}},"ConsumersResponse":{"type":"object","required":["endpoint_id","frontend_callers","api_key_callers"],"properties":{"api_key_callers":{"type":"array","items":{"$ref":"#/components/schemas/ConsumerRow"}},"endpoint_id":{"type":"string","example":"GET /v1/chat/completions"},"frontend_callers":{"type":"array","items":{"$ref":"#/components/schemas/ConsumerRow"}}}},"CostBreakdownResponse":{"type":"object","required":["window","dimension","rows","total_cost_usd"],"properties":{"dimension":{"type":"string"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/CostBreakdownRow"}},"total_cost_usd":{"type":"number","format":"double","example":12.45},"window":{"type":"string"}}},"CreateAgentRequest":{"type":"object","required":["name","workspace_id","model_id","config"],"properties":{"config":{},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"metadata":{"nullable":true},"model_id":{"type":"string","example":"bedrock/nova-pro/us-east-1","minLength":1},"name":{"type":"string","example":"Acme Corporation","maxLength":100,"minLength":1},"workspace_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"CreateAgentResponse":{"type":"object","description":"Create Agent (Idempotent)\nPOST /v1/agents\nAuto-typed response envelope for `create_agent` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["id","status","created_at"],"properties":{"created_at":{},"id":{},"status":{}}},"CreateApiKeyResponse":{"type":"object","description":"Create a new API key (Idempotent)\nPOST /v1/api-keys\nAuto-typed response envelope for `create_api_key` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"CreateBYOKRequest":{"type":"object","required":["provider"],"properties":{"api_key":{"type":"string","description":"Standard API key (for OpenAI, Anthropic, Groq, etc.)","nullable":true},"credentials":{"description":"Cloud credentials JSON (for Bedrock, Vertex AI)","nullable":true},"priority":{"type":"integer","format":"int32","nullable":true},"provider":{"type":"string","example":"openai"},"provider_type":{"type":"string","description":"Provider type: \"api_key\" (default), \"bedrock\", \"vertex_ai\"","nullable":true}}},"CreateCredentialRequest":{"type":"object","required":["provider_id","label"],"properties":{"env_reference":{"type":"string","nullable":true},"kms_reference":{"type":"string","nullable":true},"label":{"type":"string","maxLength":128,"minLength":1},"provider_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"rpm_limit":{"type":"integer","format":"int32","nullable":true},"secret":{"type":"string","nullable":true,"maxLength":16384},"tpm_limit":{"type":"integer","format":"int32","nullable":true}}},"CreateCredentialResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","label","status"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"label":{"type":"string"},"status":{"type":"string","example":"active"}}},"CreateEntityRequest":{"type":"object","required":["name","type"],"properties":{"aliases":{"type":"array","items":{"type":"string"},"nullable":true},"name":{"type":"string","example":"Acme Corporation","maxLength":255,"minLength":1},"properties":{"nullable":true},"type":{"type":"string"}}},"CreateEntityResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id"],"properties":{"id":{}}},"CreateExperimentResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","name"],"properties":{"id":{},"name":{}}},"CreateFormalSpecRequest":{"type":"object","required":["tool_name","description","preconditions","postconditions","invariants"],"properties":{"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider."},"invariants":{"type":"array","items":{}},"postconditions":{"type":"array","items":{}},"preconditions":{"type":"array","items":{}},"tool_name":{"type":"string","example":"acme"}}},"CreateFormalSpecResponse":{"type":"object","required":["spec_id","message"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"spec_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"CreateInviteRequest":{"type":"object","required":["email","role"],"properties":{"email":{"type":"string","example":"alice@acme.io"},"role":{"type":"string","description":"One of: admin | billing | member | viewer"}}},"CreateInviteResponse":{"type":"object","description":"POST /v1/organizations/invitations\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","id","email","role","expires_at"],"properties":{"email":{"type":"string","example":"alice@acme.io"},"expires_at":{"type":"string","example":"2026-05-17T19:30:00Z"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"role":{"type":"string"},"status":{"type":"string","example":"invited"}}},"CreateKeyRequest":{"type":"object","properties":{"allowed_ips":{"nullable":true},"allowed_models":{"nullable":true},"allowed_referrers":{"nullable":true},"allowed_tiers":{"nullable":true},"budget_action":{"type":"string","nullable":true},"budget_alert_pct":{"type":"number","format":"float","example":0.95,"nullable":true},"daily_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"environment":{"type":"string","nullable":true},"margin_policy_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"max_tier":{"type":"integer","format":"int32","nullable":true},"monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"name":{"type":"string","example":"Acme Corporation","nullable":true,"maxLength":50,"minLength":1},"organization_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"project_id":{"type":"string","format":"uuid","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479","nullable":true},"rate_limit_per_minute":{"type":"integer","format":"int32","nullable":true},"scopes":{"nullable":true},"tags":{"nullable":true},"team_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"tokens_per_day":{"type":"integer","format":"int32","nullable":true},"tokens_per_minute":{"type":"integer","format":"int32","nullable":true}}},"CreateModelRequest":{"type":"object","required":["id","name","provider","tier","cost_per_input_token","cost_per_output_token","avg_latency_ms","is_active"],"properties":{"avg_latency_ms":{"type":"integer","format":"int32","example":145},"context_window":{"type":"integer","format":"int32","nullable":true},"cost_per_input_token":{"type":"number","format":"double","example":"xnt_3f2e1a90c4d5b8e2"},"cost_per_output_token":{"type":"number","format":"double","example":"xnt_3f2e1a90c4d5b8e2"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"is_active":{"type":"boolean","example":true},"name":{"type":"string","example":"Acme Corporation"},"provider":{"type":"string","example":"openai"},"tier":{"type":"integer","format":"int32","example":"pro"}}},"CreatePlatformInviteRequest":{"type":"object","required":["email","role"],"properties":{"email":{"type":"string","example":"alice@acme.io"},"role":{"type":"string","description":"\"admin\" or \"viewer\""}}},"CreatePolicyRequest":{"type":"object","required":["name","resource","action"],"properties":{"action":{},"conditions":{},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"effect":{"type":"string"},"name":{"type":"string","example":"Acme Corporation"},"resource":{}}},"CreatePolicyResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","name"],"properties":{"id":{},"name":{}}},"CreateProjectRequest":{"type":"object","required":["name","environment"],"properties":{"budget_limit_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"environment":{"$ref":"#/components/schemas/Environment"},"name":{"type":"string","example":"Acme Corporation"}}},"CreatePromoRequest":{"type":"object","required":["plan_tier","multiplier","starts_at","ends_at"],"properties":{"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"ends_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"multiplier":{"type":"number","format":"double"},"peak_hours_only":{"type":"boolean","example":true,"nullable":true},"plan_tier":{"type":"string","example":"pro"},"starts_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"}}},"CreatePromotionResponse":{"type":"object","description":"POST /admin/billing/promotions — Create plan-wide promo\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","plan_tier","multiplier","starts_at","ends_at"],"properties":{"ends_at":{},"id":{},"multiplier":{},"plan_tier":{},"starts_at":{}}},"CreatePromptRequest":{"type":"object","required":["name","content","version"],"properties":{"content":{"type":"string","maxLength":100000,"minLength":1},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"name":{"type":"string","example":"Acme Corporation","maxLength":100,"minLength":1},"version":{"type":"string","example":"1.0.0","maxLength":64,"minLength":1}}},"CreateProviderRequest":{"type":"object","required":["name","display_name","base_url"],"properties":{"api_format":{"type":"string","nullable":true},"base_url":{"type":"string","example":"https://api.xantly.com"},"display_name":{"type":"string","example":"Alice Chen"},"health_probe_url":{"type":"string","example":"https://api.xantly.com","nullable":true},"name":{"type":"string","example":"Acme Corporation"}}},"CreateProviderResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","name"],"properties":{"id":{},"name":{}}},"CreateRelationshipRequest":{"type":"object","required":["from_entity","to_entity","type"],"properties":{"from_entity":{"type":"string"},"properties":{"nullable":true},"to_entity":{"type":"string"},"type":{"type":"string"}}},"CreateRelationshipResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id"],"properties":{"id":{}}},"CreateRuleRequest":{"type":"object","required":["name","rule_type","condition","action"],"properties":{"action":{},"condition":{},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"name":{"type":"string","example":"Acme Corporation"},"priority":{"type":"integer","format":"int32","nullable":true},"rule_type":{"type":"string"}}},"CreateSchemaRequest":{"type":"object","required":["name","version","description","schema","enforcement"],"properties":{"auto_heal":{"type":"boolean","example":true},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider."},"enforcement":{"type":"string"},"healing_hints":{"nullable":true},"name":{"type":"string","example":"Acme Corporation"},"schema":{},"version":{"type":"string","example":"1.0.0"}}},"CreateTransformRequest":{"type":"object","required":["name","type","expression","applies_to"],"properties":{"applies_to":{"type":"string"},"enabled":{"type":"boolean","example":true},"expression":{"type":"string"},"name":{"type":"string","example":"Acme Corporation"},"order":{"type":"integer","format":"int32"},"type":{"type":"string"}}},"CreateTransformResponse":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"}}},"CreateVoiceCredentialRequest":{"type":"object","required":["provider","provider_type","api_key"],"properties":{"api_key":{"type":"string"},"label":{"type":"string","nullable":true},"provider":{"type":"string","example":"openai"},"provider_type":{"type":"string"}}},"CreateVoiceCredentialResponse":{"type":"object","description":"Response body for `POST /v1/voice/credentials`.","required":["credential"],"properties":{"credential":{"$ref":"#/components/schemas/VoiceCredentialResponse"}}},"CreateVoiceProfileRequest":{"type":"object","required":["provider","voice_id"],"properties":{"profile_name":{"type":"string","example":"acme","nullable":true},"provider":{"type":"string","example":"openai"},"s3_key":{"type":"string","nullable":true},"voice_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"CreateWebhookRequest":{"type":"object","required":["url","events"],"properties":{"events":{"type":"array","items":{"type":"string"}},"url":{"type":"string","example":"https://api.xantly.com"}}},"CreateWebhookResponse":{"type":"object","required":["id","url","secret","events","created_at"],"properties":{"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"events":{"type":"array","items":{"type":"string"}},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"secret":{"type":"string"},"url":{"type":"string","example":"https://api.xantly.com"}}},"CreateWorkflowRequest":{"type":"object","required":["name"],"properties":{"config":{"$ref":"#/components/schemas/WorkflowConfig"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider."},"graph":{"$ref":"#/components/schemas/WorkflowGraph"},"name":{"type":"string","example":"Acme Corporation"},"triggers":{"allOf":[{"$ref":"#/components/schemas/WorkflowTriggers"}],"nullable":true},"version":{"type":"string","example":"1.0.0"}}},"CreateWorkflowResponse":{"type":"object","required":["id","name","version","status","graph_hash","validation"],"properties":{"graph_hash":{"type":"string","example":"sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"status":{"type":"string","example":"active"},"validation":{"$ref":"#/components/schemas/ValidationResult"},"version":{"type":"string","example":"1.0.0"}}},"CreatedApiKeyResponse":{"type":"object","description":"Response returned exactly once when a project API key is created. The\n`plaintext_key` is never persisted (only its hash is) and is shown only in\nthis body, so the caller must store it now. Closes audit P1 be-multi_project-2.","required":["key_id","plaintext_key","prefix"],"properties":{"key_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"plaintext_key":{"type":"string","example":"xantly_proj_f47ac10b_3a1f..."},"prefix":{"type":"string","example":"xantly_proj_f47ac10b"}}},"CreditTransactionsResponse":{"type":"object","required":["transactions"],"properties":{"transactions":{"type":"array","items":{"$ref":"#/components/schemas/CreditTransactionItem"}}}},"DashboardSummary":{"type":"object","description":"GET /admin/analytics/summary - High-level dashboard summary (admin only)","required":["total_requests_24h","total_cost_24h","avg_latency_24h","success_rate_24h","active_providers","active_tenants_24h"],"properties":{"active_providers":{"type":"integer","format":"int64"},"active_tenants_24h":{"type":"integer","format":"int64"},"avg_latency_24h":{"type":"number","format":"double"},"success_rate_24h":{"type":"number","format":"double"},"total_cost_24h":{"type":"number","format":"double"},"total_requests_24h":{"type":"integer","format":"int64"}}},"DebugRoutingResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["routes","middleware"],"properties":{"middleware":{"type":"array","items":{}},"routes":{"type":"array","items":{}}}},"DecisionDetail":{"type":"object","required":["request_id","tenant_id","timestamp","decision_source","barp_fired","task_family","intelligence_mode","model","tier","provider","confidence","preference_dial","rationale","fallback","capability_match","ucb_exploitation","ucb_exploration","heuristic_prior","cost_penalty","latency_penalty","reliability","policy_penalty","total_score","alternatives_json","filtered_json","outcome"],"properties":{"alternatives_json":{"type":"string"},"barp_fired":{"type":"integer","format":"int32","minimum":0},"capability_match":{"type":"number","format":"float"},"confidence":{"type":"number","format":"float","example":0.92},"cost_penalty":{"type":"number","format":"float"},"cost_usd":{"type":"number","format":"double","example":0.0042,"nullable":true},"decision_source":{"type":"string"},"fallback":{"type":"integer","format":"int32","minimum":0},"filtered_json":{"type":"string"},"heuristic_prior":{"type":"number","format":"float"},"intelligence_mode":{"type":"string"},"latency_ms":{"type":"integer","format":"int32","example":145,"nullable":true,"minimum":0},"latency_penalty":{"type":"number","format":"float"},"matrix_version":{"type":"integer","format":"int64","nullable":true,"minimum":0},"model":{"type":"string","example":"bedrock/nova-pro/us-east-1"},"observed_reward":{"type":"number","format":"float","nullable":true},"outcome":{"type":"string"},"policy_penalty":{"type":"number","format":"float"},"preference_dial":{"type":"number","format":"float"},"provider":{"type":"string","example":"openai"},"rationale":{"type":"string","example":"Selected gpt-4o-mini for short factual prompts."},"reliability":{"type":"number","format":"float"},"request_id":{"type":"string","example":"req_3f2e1a90c4d5b8e2"},"task_family":{"type":"string"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"tier":{"type":"string","example":"pro"},"timestamp":{"type":"integer","format":"int32","example":1747506600,"minimum":0},"total_score":{"type":"number","format":"float","example":0.85},"ucb_exploitation":{"type":"number","format":"float"},"ucb_exploration":{"type":"number","format":"float"}}},"DecisionSummary":{"type":"object","required":["request_id","tenant_id","timestamp","model","tier","task_family","confidence","total_score","capability_match","heuristic_prior","outcome"],"properties":{"capability_match":{"type":"number","format":"float"},"confidence":{"type":"number","format":"float","example":0.92},"cost_usd":{"type":"number","format":"double","example":0.0042,"nullable":true},"heuristic_prior":{"type":"number","format":"float"},"latency_ms":{"type":"integer","format":"int32","example":145,"nullable":true,"minimum":0},"matrix_version":{"type":"integer","format":"int64","nullable":true,"minimum":0},"model":{"type":"string","example":"bedrock/nova-pro/us-east-1"},"outcome":{"type":"string"},"request_id":{"type":"string","example":"req_3f2e1a90c4d5b8e2"},"task_family":{"type":"string"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"tier":{"type":"string","example":"pro"},"timestamp":{"type":"integer","format":"int32","example":1747506600,"minimum":0},"total_score":{"type":"number","format":"float","example":0.85}}},"DegradationUpdate":{"type":"object","properties":{"error_rate":{"type":"number","format":"float","example":0.95,"nullable":true},"level":{"type":"string","nullable":true},"p99_latency_ms":{"type":"integer","format":"int32","example":145,"nullable":true,"minimum":0}}},"DeleteAvatarResponse":{"type":"object","description":"DELETE /v1/users/me/avatar - Delete avatar\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["message"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."}}},"DeleteByokProviderResponse2":{"type":"object","description":"Deletes byok provider.\nAuto-typed response envelope for `delete_byok_provider` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["error"],"properties":{"error":{}}},"DeletePolicyResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["success"],"properties":{"success":{"type":"boolean","example":true}}},"DeletePromotionResponse":{"type":"object","description":"DELETE /admin/billing/promotions/:id — Cancel promo early\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["cancelled","id"],"properties":{"cancelled":{"type":"boolean","example":true},"id":{}}},"DeleteRuleResponse":{"type":"object","description":"Response body for `delete_rule`. Closes audit P2 be-admin_rules-8: this is now\nthe handler's real return type (was an untyped `serde_json::Value` envelope),\nso the documented schema matches the wire shape exactly.","required":["status"],"properties":{"status":{"type":"string","example":"deleted"}}},"DeleteSessionResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"active"}}},"DependencyGraph":{"type":"object","required":["endpoint_id","nodes","edges"],"properties":{"edges":{"type":"array","items":{"$ref":"#/components/schemas/DependencyEdge"}},"endpoint_id":{"type":"string","example":"GET /v1/chat/completions"},"nodes":{"type":"array","items":{"$ref":"#/components/schemas/DependencyNode"}}}},"DeployAzureModelAcceptedResponse":{"type":"object","description":"201 Accepted response from `POST /v1/connections/azure/models/deploy`.","required":["status","model_name","deployment_name","message"],"properties":{"deployment_name":{"type":"string","example":"acme"},"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"model_name":{"type":"string","example":"acme"},"status":{"type":"string","example":"active"}}},"DigestResponse":{"type":"object","required":["generated_at","top_at_risk"],"properties":{"generated_at":{"type":"string","format":"date-time","description":"Generation timestamp.","example":"2026-05-17T18:30:00Z"},"top_at_risk":{"type":"array","items":{"$ref":"#/components/schemas/DigestRow"},"description":"Top N risk-ranked endpoints."}}},"DisconnectRequest":{"type":"object","required":["reconnect_allowed"],"properties":{"reason":{"type":"string","example":"customer requested","nullable":true},"reconnect_allowed":{"type":"boolean","example":true}}},"DiversityReport":{"type":"object","description":"Diversity report for one scope (global or a single tenant).","required":["scope","total_decisions","distinct_models","shannon_entropy_bits","max_entropy_bits","normalized_entropy","top_share","sample_sufficient","arm_collapse","alarms","thresholds","shares"],"properties":{"alarms":{"type":"array","items":{"type":"string"},"description":"Machine-readable alarm reasons; empty when healthy."},"arm_collapse":{"type":"boolean","description":"True when the distribution has collapsed (entropy below the floor or\na single model above the share cap, with a sufficient sample)."},"distinct_models":{"type":"integer","example":7,"minimum":0},"max_entropy_bits":{"type":"number","format":"double","description":"log2(distinct_models): the entropy of a perfectly uniform spread.","example":2.807},"normalized_entropy":{"type":"number","format":"double","description":"shannon / max, in [0, 1]. 0.0 when a single model takes everything.","example":0.75},"sample_sufficient":{"type":"boolean","description":"True when the window has enough decisions for alarms to be meaningful."},"scope":{"type":"string","description":"Scope label: \"global\" or the tenant id.","example":"global"},"shannon_entropy_bits":{"type":"number","format":"double","description":"Shannon entropy of the winner distribution, in bits.","example":2.1},"shares":{"type":"array","items":{"$ref":"#/components/schemas/ArmShare"},"description":"Per-model shares, largest first."},"thresholds":{"$ref":"#/components/schemas/DiversityThresholds"},"top_model":{"type":"string","description":"The model winning the largest share, if any decisions exist.","nullable":true},"top_share":{"type":"number","format":"double","example":0.35},"total_decisions":{"type":"integer","format":"int64","example":120,"minimum":0}}},"DiversityThresholds":{"type":"object","description":"Alarm thresholds for the diversity analyzer.","required":["entropy_floor_bits","share_cap","min_decisions"],"properties":{"entropy_floor_bits":{"type":"number","format":"double","description":"Shannon entropy floor (bits) below which arm collapse is flagged.","example":1.5},"min_decisions":{"type":"integer","format":"int64","description":"Minimum window decisions before alarms fire (cold-start suppression).","example":30,"minimum":0},"share_cap":{"type":"number","format":"double","description":"Max share of window decisions a single model may win.","example":0.6}}},"DocDetailResponse":{"type":"object","required":["slug","title","description","order","content","etag","served_at_ms"],"properties":{"content":{"type":"string","description":"Raw markdown content (with YAML frontmatter stripped)."},"description":{"type":"string"},"etag":{"type":"string","description":"Weak ETag (BLAKE3 hex of content). Clients may send `If-None-Match`\non subsequent requests to receive `304 Not Modified` with empty body\nwhen content is unchanged."},"order":{"type":"integer","format":"int32","minimum":0},"served_at_ms":{"type":"integer","format":"int64","description":"Unix timestamp (ms) that this content was read. Used for frontend\nwatermark overlay and telemetry."},"slug":{"type":"string"},"title":{"type":"string"}}},"DocSummary":{"type":"object","required":["slug","title","description","order"],"properties":{"description":{"type":"string"},"order":{"type":"integer","format":"int32","minimum":0},"slug":{"type":"string"},"title":{"type":"string"}}},"DriftAlertResponse":{"type":"object","required":["model_id","tenant_id","drift_detected","drift_score","mean_before_drift","running_mean","observation_count"],"properties":{"drift_detected":{"type":"boolean","example":true},"drift_score":{"type":"number","format":"float","example":0.85},"last_drift_epoch":{"type":"integer","format":"int64","nullable":true},"mean_before_drift":{"type":"number","format":"float"},"model_id":{"type":"string","example":"bedrock/nova-pro/us-east-1"},"observation_count":{"type":"integer","format":"int64","example":42,"minimum":0},"running_mean":{"type":"number","format":"double"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"DriftFeed":{"type":"object","required":["total_events","active_count","events"],"properties":{"active_count":{"type":"integer","format":"int64","example":42,"minimum":0},"events":{"type":"array","items":{"$ref":"#/components/schemas/DriftRow"}},"total_events":{"type":"integer","format":"int64","minimum":0}}},"EmailResponse":{"type":"object","required":["id","email","is_primary","is_verified","created_at"],"properties":{"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"email":{"type":"string","example":"alice@acme.io"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"is_primary":{"type":"boolean","example":true},"is_verified":{"type":"boolean","example":true},"synthetic":{"type":"boolean","example":false}}},"EnableModelAcceptedResponse":{"type":"object","description":"201 Created response from `POST /v1/connections/{provider}/models/enable`.","required":["status","model_id","message"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"model_id":{"type":"string","example":"bedrock/nova-pro/us-east-1"},"status":{"type":"string","example":"active"}}},"EnableModelRequest":{"type":"object","required":["modelId"],"properties":{"modelId":{"type":"string","example":"bedrock/nova-pro/us-east-1"}}},"EnableOutcome":{"type":"string","description":"Precise outcome of one model enablement attempt.\n\nThis is deliberately finer grained than the stored status: the stored status\nis what the router keys off, this is what the customer is told. The two are\nlinked by [`EnableOutcome::db_status`].","enum":["enabled","already_enabled","agreement_pending","needs_console_action","not_available_in_region","model_not_found","permission_denied","throttled","failed","not_attempted","not_discovered"]},"EndpointDetail":{"type":"object","required":["endpoint","tests","recent_buckets","usage","dependencies"],"properties":{"dependencies":{"type":"array","items":{"$ref":"#/components/schemas/EndpointDependency"}},"endpoint":{"$ref":"#/components/schemas/EndpointRow"},"recent_buckets":{"type":"array","items":{"$ref":"#/components/schemas/HealthBucket"}},"scorecard":{"allOf":[{"$ref":"#/components/schemas/EndpointScorecard"}],"nullable":true},"tests":{"type":"array","items":{"$ref":"#/components/schemas/TestResultRow"}},"usage":{"$ref":"#/components/schemas/EndpointUsage"}}},"EndpointSurface":{"type":"string","description":"Who an endpoint is FOR.  The orphan check (\"no X-Website call site\") is only\nmeaningful for the surface X-Website is supposed to drive; applying it to the\nrest produces false deprecation candidates.\n\nThis exists because of Xantly/X-Website#142: the orphan report counted\n`POST /v1/embeddings`, `POST /v1/messages` and the rest of the customer API\nas deletion candidates purely because our own dashboard does not call them.\nDeleting a customer-facing endpoint on that evidence is a breaking change for\nevery API user, so the classification is deliberately conservative: anything\non a documented customer path is `PublicApi`, and only clearly control-plane\npaths are `Dashboard`.","enum":["public_api","internal","dashboard"]},"EntitiesListResponse":{"type":"object","required":["entities","pagination"],"properties":{"entities":{"type":"array","items":{"$ref":"#/components/schemas/EntityDetail"}},"pagination":{"$ref":"#/components/schemas/PaginationInfo"}}},"EntityRelationshipsResponse":{"type":"object","required":["entity","relationships"],"properties":{"entity":{"$ref":"#/components/schemas/EntitySummary"},"relationships":{"type":"array","items":{"$ref":"#/components/schemas/RelationshipDetail"}}}},"Environment":{"type":"string","description":"Deployment environment for a project. Closed enum so callers cannot write\narbitrary values that would break downstream filters/reports.\nCloses audit P1 be-multi_project-3.","enum":["dev","staging","production"]},"EvaluatePolicyRequest":{"type":"object","required":["resource","action","context"],"properties":{"action":{},"context":{},"resource":{}}},"EvaluatePolicyResponse":{"type":"object","required":["allowed"],"properties":{"allowed":{"type":"boolean","example":true},"reason":{"type":"string","example":"customer requested","nullable":true}}},"EventPayload":{"type":"object","required":["event_type","payload"],"properties":{"event_type":{"type":"string"},"payload":{},"url":{"type":"string","example":"https://api.xantly.com","nullable":true},"user_agent":{"type":"string","nullable":true}}},"EventsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["days","limit","events"],"properties":{"days":{},"events":{},"limit":{}}},"ExecuteAgentResponse":{"type":"object","description":"Execute Agent (stub implementation)\nPOST /v1/agents/:id/execute\nAuto-typed response envelope for `execute_agent` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"ExecuteRequest":{"type":"object","required":["tool","arguments"],"properties":{"arguments":{},"async":{"type":"boolean","nullable":true},"timeout_seconds":{"type":"integer","format":"int32","example":60,"nullable":true},"tool":{"type":"string"}}},"ExecuteResponse":{"type":"object","required":["call_id","status","bridge"],"properties":{"bridge":{"type":"string"},"call_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"execution_ms":{"type":"integer","format":"int32","example":145,"nullable":true},"result":{"nullable":true},"status":{"type":"string","example":"active"}}},"ExecuteWorkflowRequest":{"type":"object","required":["input"],"properties":{"input":{},"options":{"allOf":[{"$ref":"#/components/schemas/ExecutionOptions"}],"nullable":true},"parameters":{"allOf":[{"$ref":"#/components/schemas/ExecutionParameters"}],"nullable":true}}},"ExecuteWorkflowResponse":{"type":"object","required":["execution_id","workflow_id","status","created_at","tracking_url"],"properties":{"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"estimated_completion_seconds":{"type":"integer","format":"int32","example":60,"nullable":true},"execution_id":{"type":"string","example":"exec_3f2e1a90c4d5b8e2"},"status":{"type":"string","example":"active"},"tracking_url":{"type":"string","example":"https://api.xantly.com"},"workflow_id":{"type":"string","example":"wf_3f2e1a90c4d5b8e2"}}},"ExecutionCancelledResponse":{"type":"object","required":["execution_id","status","cost_incurred_usd"],"properties":{"cost_incurred_usd":{"type":"number","format":"double","example":0.34},"execution_id":{"type":"string","example":"exec_3f2e1a90c4d5b8e2"},"status":{"type":"string","example":"active"}}},"ExecutionDebugResponse":{"type":"object","required":["execution_id","checkpoints","errors","warnings"],"properties":{"checkpoints":{"type":"array","items":{}},"errors":{"type":"array","items":{}},"execution_id":{"type":"string","example":"exec_3f2e1a90c4d5b8e2"},"trace":{"description":"Same shape as `ExecutionTraceResponse.trace` — surfaced here so the\ndebug UI can fetch trace + checkpoints + errors in one round-trip.","nullable":true},"warnings":{"type":"array","items":{}}}},"ExecutionPausedResponse":{"type":"object","required":["execution_id","status","paused_at_node","resume_token"],"properties":{"execution_id":{"type":"string","example":"exec_3f2e1a90c4d5b8e2"},"paused_at_node":{"type":"string"},"resume_token":{"type":"string","description":"Opaque token caller must present to `POST .../resume`.","example":"xnt_3f2e1a90c4d5b8e2"},"status":{"type":"string","example":"active"}}},"ExecutionResumedResponse":{"type":"object","required":["execution_id","status","resumed_from_node"],"properties":{"execution_id":{"type":"string","example":"exec_3f2e1a90c4d5b8e2"},"resumed_from_node":{"type":"string"},"status":{"type":"string","example":"active"}}},"ExecutionRetryAcceptedResponse":{"type":"object","required":["execution_id","status"],"properties":{"execution_id":{"type":"string","example":"exec_3f2e1a90c4d5b8e2"},"status":{"type":"string","example":"active"}}},"ExecutionTraceResponse":{"type":"object","required":["execution_id","trace"],"properties":{"execution_id":{"type":"string","example":"exec_3f2e1a90c4d5b8e2"},"trace":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionTraceStep"}}}},"ExperimentOutcomesResponse":{"type":"object","description":"GET /v1/admin/routing-experiments/:id/outcomes\n\nAggregates gateway_requests rows where request metadata contains an experiment\nassignment for this experiment id, grouped by variant. Returns per-variant\nrequest count, success rate, average latency, average provider cost, average\ncustomer charge, and average gross margin so operators can evaluate which\nvariant is performing better.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["experiment_id","window_days","variant_outcomes","total_variants"],"properties":{"experiment_id":{},"total_variants":{},"variant_outcomes":{},"window_days":{}}},"ExportAnalyticsRequest":{"type":"object","required":["format"],"properties":{"agent_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"api_key_id":{"type":"string","example":"a3bb189e-8bf9-3888-9912-ace4e6543002","nullable":true},"cache_hit":{"type":"boolean","example":false,"nullable":true},"endpoint":{"type":"string","nullable":true},"environment":{"type":"string","nullable":true},"format":{"type":"string"},"model":{"type":"string","example":"bedrock/nova-pro/us-east-1","nullable":true},"period":{"type":"string","nullable":true},"project_id":{"type":"string","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479","nullable":true},"provider":{"type":"string","example":"openai","nullable":true},"status":{"type":"string","example":"active","nullable":true},"workflow_id":{"type":"string","example":"wf_3f2e1a90c4d5b8e2","nullable":true}}},"ExportFormat":{"type":"string","description":"Serialisation format for a synchronous audit-log export.","enum":["json","csv"]},"ExportMemoryRequest":{"type":"object","required":["format","destination"],"properties":{"compression":{"allOf":[{"$ref":"#/components/schemas/CompressionType"}],"nullable":true},"destination":{"$ref":"#/components/schemas/ExportDestination"},"filters":{"allOf":[{"$ref":"#/components/schemas/ExportFilters"}],"nullable":true},"format":{"$ref":"#/components/schemas/ExportFormat"},"include":{"allOf":[{"$ref":"#/components/schemas/ExportIncludes"}],"nullable":true}}},"ExportMemoryResponse":{"type":"object","required":["export_id","status","estimated_records","estimated_size_mb","callback_url"],"properties":{"callback_url":{"type":"string","example":"https://api.xantly.com"},"estimated_records":{"type":"integer","format":"int64","minimum":0},"estimated_size_mb":{"type":"number","format":"double"},"export_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","example":"active"}}},"ExportMemorySyncResponse":{"type":"object","description":"Sync streaming fast-path: directly returns L1 conversations as JSONL.\nFor small tenants — no R2 storage, no worker queue, no polling needed.\n\nLimits:\n- 25-second hard timeout (Cloudflare LB kills at 30s)\n- 50 MB max response body\n- L1 conversations only (L2/L3 require async path for scroll semantics)\n\nIf limits exceeded, returns 413 pointing to async POST /v1/memory/export.\nAuto-typed response envelope for `export_memory_sync` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["_meta","schema_version","tenant_id","exported_at","mode","layers","note"],"properties":{"_meta":{},"exported_at":{},"layers":{},"mode":{},"note":{},"schema_version":{},"tenant_id":{}}},"ExportWorkflowResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["workflow","version"],"properties":{"version":{"type":"string","example":"1.0.0"},"workflow":{}}},"FeatureAdoptionResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["days","events"],"properties":{"days":{},"events":{}}},"FeatureAnalysisResponse":{"type":"object","required":["embedding_dim","scalar_feature_count","total_feature_dim","model_pool"],"properties":{"embedding_dim":{"type":"integer","minimum":0},"model_pool":{"type":"array","items":{"$ref":"#/components/schemas/ModelPoolInfo"}},"scalar_feature_count":{"type":"integer","example":42,"minimum":0},"total_feature_dim":{"type":"integer","minimum":0}}},"FeedbackRequest":{"type":"object","description":"Feedback request with validation.","required":["request_id","rating"],"properties":{"comment":{"type":"string","nullable":true,"maxLength":1000},"rating":{"type":"integer","format":"int32","maximum":5,"minimum":1},"request_id":{"type":"string","example":"3f2e1a90-c4d5-4b8e-9a1f-2b7c6d5e4f30","maxLength":36,"minLength":36}}},"FeedbackResponse":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean","example":true}}},"FormalSpecResponse":{"type":"object","required":["spec_id","name","status","source","language","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"language":{"type":"string","description":"Spec language: `tla+` | `alloy` | `dafny`."},"name":{"type":"string","example":"Acme Corporation"},"source":{"type":"string","description":"Full TLA+/Alloy/etc. spec source."},"spec_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","example":"active"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"}}},"FrontendCallersPayload":{"type":"object","required":["callers"],"properties":{"callers":{"type":"array","items":{"$ref":"#/components/schemas/FrontendCaller"}}}},"FrontendCallersReport":{"type":"object","required":["callers_in_payload","endpoints_with_callers","orphans","dashboard_orphans","public_api_orphans","internal_orphans","unmatched_callers"],"properties":{"callers_in_payload":{"type":"integer","description":"How many callers the payload contained.","minimum":0},"dashboard_orphans":{"type":"integer","description":"Orphans on the control-plane surface, the only ones that mean anything.","minimum":0},"endpoints_with_callers":{"type":"integer","description":"Endpoints that now show ≥1 caller.","minimum":0},"internal_orphans":{"type":"integer","description":"Orphans that are machine-to-machine (health, webhooks, SCIM, IdP).","minimum":0},"orphans":{"type":"integer","description":"Endpoints in the registry that received 0 callers.\n\nNOT a deprecation-candidate count: it includes the whole customer-facing\nAPI, which is not supposed to have a dashboard caller.  Alert on\n`dashboard_orphans` instead.","minimum":0},"public_api_orphans":{"type":"integer","description":"Orphans that are customer-callable API. Expected, never actionable.","minimum":0},"unmatched_callers":{"type":"integer","description":"Callers whose (method, path) didn't match any registered endpoint.","minimum":0}}},"FunnelResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["days","steps"],"properties":{"days":{},"steps":{"type":"array","items":{}}}},"GateStatsResponse":{"type":"object","required":["time_range","gate_1","gate_2","gate_3","overall"],"properties":{"gate_1":{"$ref":"#/components/schemas/GateStats"},"gate_2":{"$ref":"#/components/schemas/GateStats"},"gate_3":{"$ref":"#/components/schemas/GateStats"},"overall":{"$ref":"#/components/schemas/OverallGateStats"},"time_range":{"type":"string"}}},"GetAgentUsageResponse":{"type":"object","description":"GET /v1/analytics/agents\nGroup usage by agent_id and workflow_id (first-class columns, fallback to metadata).\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["agents","handoffs"],"properties":{"agents":{},"handoffs":{}}},"GetAnomaliesResponse":{"type":"object","description":"GET /v1/analytics/anomalies\nDetect active spend, latency, traffic, and error-rate anomalies from aggregated rollups.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["read_path","period","granularity","status","anomalies","series","series_decomposition"],"properties":{"anomalies":{},"granularity":{},"period":{},"read_path":{"type":"string","example":"/v1/chat/completions"},"series":{},"series_decomposition":{},"status":{}}},"GetAuditLogsAliasResponse":{"type":"object","description":"GET /v1/admin/audit/logs (Alias)\nAuto-typed response envelope for `get_audit_logs_alias` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"GetBenchmarksResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["tenant_id","summary"],"properties":{"summary":{},"tenant_id":{}}},"GetBreakdownResponse":{"type":"object","description":"GET /v1/analytics/breakdown\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["by_model","by_user"],"properties":{"by_model":{},"by_user":{}}},"GetBudgetAlertsResponse":{"type":"object","description":"GET /admin/billing/budget-alerts — Unacknowledged budget alerts across all orgs.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["alerts","count"],"properties":{"alerts":{},"count":{"type":"integer","format":"int64","example":42}}},"GetBudgetStatusResponse2":{"type":"object","description":"Returns budget status.\nAuto-typed response envelope for `get_budget_status` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["scope_type","scope_id","caps"],"properties":{"caps":{},"scope_id":{},"scope_type":{}}},"GetBurnRateResponse":{"type":"object","description":"GET /v1/connections/usage/burn-rate — Daily burn rate estimate.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["dailyAverageCostUsd","last7DaysTotalUsd","activeDays","note"],"properties":{"activeDays":{},"dailyAverageCostUsd":{},"last7DaysTotalUsd":{},"note":{"type":"string"}}},"GetByokSavingsResponse":{"type":"object","description":"GET /v1/analytics/byok-savings\nShows per-tenant BYOK cost attribution breakdown: how much traffic was served via\nthe customer's own API keys (byok_cost_usd) vs Xantly's provider pool (cost_usd),\nthe implied savings from Xantly's cheaper models, and a per-model + per-task breakdown\nso customers can see exactly which model and task type drove each dollar of savings.\n\nRequires migrations 20260315_byok_cost_attribution.sql and 20260315_byok_spend_cap.sql.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["period","summary","costs","tokens","by_model","by_task"],"properties":{"by_model":{},"by_task":{},"costs":{},"period":{},"summary":{},"tokens":{}}},"GetByokSpendResponse":{"type":"object","description":"GET /byok/spend — Monthly estimated BYOK cloud spend by provider.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["month","by_provider"],"properties":{"by_provider":{},"month":{}}},"GetBypassTokensResponse":{"type":"object","description":"GET /v1/sdk/bypass/tokens - List valid bypass tokens\n\nSECURITY: Restricted to control-plane admins only.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["tokens","ttl_seconds","note"],"properties":{"note":{"type":"string"},"tokens":{"type":"array","items":{}},"ttl_seconds":{"type":"integer","format":"int64","example":60}}},"GetCachePerformanceResponse":{"type":"object","description":"GET /v1/analytics/cache-performance\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["hour","hit_rate","hits","total"],"properties":{"hit_rate":{},"hits":{},"hour":{},"total":{}}},"GetCostBreakdownResponse":{"type":"object","description":"GET /v1/analytics/cost-breakdown\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["date","cost_usd"],"properties":{"cost_usd":{},"date":{}}},"GetCostForecastResponse":{"type":"object","description":"GET /v1/analytics/costs/forecast\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["current_month_projection","next_month_forecast","trend","daily_costs"],"properties":{"current_month_projection":{},"daily_costs":{},"next_month_forecast":{},"trend":{}}},"GetCraneStatsResponse":{"type":"object","description":"Crane activation stats returned by `get_crane_stats`. Fields are typed\nconcretely to match the runtime values (a count and two rates) so FE consumers\nand OpenAPI codegen get a precise contract. Closes audit P3 be-output-7.","required":["activations","success_rate","avg_latency_ms"],"properties":{"activations":{"type":"integer","format":"int64","example":1024,"minimum":0},"avg_latency_ms":{"type":"number","format":"double","example":145.0},"success_rate":{"type":"number","format":"double","example":0.995}}},"GetDegradationResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["level"],"properties":{"level":{}}},"GetEdgeConfigResponse":{"type":"object","description":"GET /v1/admin/edge/config\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["cdn","waf","ddos"],"properties":{"cdn":{},"ddos":{},"waf":{}}},"GetEmbeddingsStatusResponse":{"type":"object","description":"GET /v1/tools/embeddings/status - Embedding Model Status\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["model","dimension","status","cache_size","device"],"properties":{"cache_size":{},"device":{"type":"string"},"dimension":{},"model":{},"status":{}}},"GetEntryResponse":{"type":"object","description":"Returns entry.\nAuto-typed response envelope for `get_entry` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"GetErrorsResponse":{"type":"object","description":"GET /v1/analytics/errors\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["period","total_requests","total_errors","error_rate","by_message","by_provider","recent_samples"],"properties":{"by_message":{},"by_provider":{},"error_rate":{},"period":{"type":"string"},"recent_samples":{},"total_errors":{},"total_requests":{}}},"GetExecutionLogsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["logs"],"properties":{"logs":{}}},"GetFlagsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data"],"properties":{"data":{}}},"GetGatewayConfigResponse":{"type":"object","description":"GET /v1/admin/gateway/config\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["version","features"],"properties":{"features":{},"version":{"type":"string","example":"1.0.0"}}},"GetHedgingStatsResponse":{"type":"object","description":"GET /v1/hedging/stats\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["total_requests","hedged_requests","primary_wins","backup_wins","p95_latency_ms","avg_latency_saved_ms","hedge_win_rate"],"properties":{"avg_latency_saved_ms":{"type":"number","format":"double"},"backup_wins":{"type":"integer","format":"int64"},"hedge_win_rate":{"type":"number","format":"double","example":0.42},"hedged_requests":{"type":"integer","format":"int64"},"p95_latency_ms":{"type":"integer","format":"int64","example":145},"primary_wins":{"type":"integer","format":"int64"},"total_requests":{"type":"integer","format":"int64"}}},"GetKeyAuditResponse":{"type":"object","description":"GET /v1/api-keys/{key_id}/audit - Get audit trail\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["events"],"properties":{"events":{"type":"array","items":{}}}},"GetKeyUsageResponse":{"type":"object","description":"GET /v1/api-keys/{key_id}/usage - Get usage statistics\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["key_id","summary"],"properties":{"key_id":{},"summary":{}}},"GetLatencyHeatmapResponse":{"type":"object","description":"GET /v1/analytics/latency/heatmap\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["read_path","heatmap"],"properties":{"heatmap":{},"read_path":{"type":"string","example":"/v1/chat/completions"}}},"GetLatencyResponse":{"type":"object","description":"GET /v1/analytics/latency\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["bucket_ms","count"],"properties":{"bucket_ms":{},"count":{}}},"GetMcpCacheStatsResponse":{"type":"object","description":"GET /v1/mcp/cache/stats - MCP Cache Statistics\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["total_cached_servers","total_cached_tools","hit_rate_24h","memory_usage_mb"],"properties":{"hit_rate_24h":{},"memory_usage_mb":{},"total_cached_servers":{},"total_cached_tools":{}}},"GetMemoryStatsResponse":{"type":"object","description":"GET /v1/analytics/memory-stats\n\nConversation memory retention analysis + L2 semantic memory storage metrics.\nDemonstrates data retention value and customer stickiness to enterprise buyers.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["organization_id","period","data_span_days","conversation_memory","semantic_memory","memory_value","customer_retention_signals"],"properties":{"conversation_memory":{},"customer_retention_signals":{},"data_span_days":{},"memory_value":{},"organization_id":{},"period":{"type":"string"},"semantic_memory":{}}},"GetMetricsSummaryResponse":{"type":"object","description":"GET /v1/metrics/summary\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["requests_24h","p95_latency_ms","error_rate","total_cost_usd"],"properties":{"error_rate":{"type":"number","format":"double","example":0.95},"p95_latency_ms":{"type":"integer","format":"int64","example":145},"requests_24h":{"type":"integer","format":"int64"},"total_cost_usd":{"type":"number","format":"double","example":12.45}}},"GetMetricsSwcResponse":{"type":"object","description":"GET /v1/metrics/swc - Specialized Workload Costs\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["workloads","total_cost_usd"],"properties":{"total_cost_usd":{"type":"number","format":"double"},"workloads":{"description":"Map of detected workload class (`intent`) -> `{ cost, count }`."}}},"GetModelHistoryResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["model_id","tenant_id","history"],"properties":{"history":{},"model_id":{},"tenant_id":{}}},"GetModelsUsageResponse":{"type":"object","description":"GET /v1/analytics/models\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["requests","prompt_tokens","completion_tokens","total_tokens","cost_usd","byok_cost_usd","combined_cost_usd"],"properties":{"byok_cost_usd":{},"combined_cost_usd":{},"completion_tokens":{},"cost_usd":{},"prompt_tokens":{},"requests":{},"total_tokens":{}}},"GetPlansAdminResponse":{"type":"object","description":"GET /admin/billing/plans — Read-only view of all plan configurations.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["plans","allowed_topup_amounts","minimum_credit_purchase_usd","default_overage_hard_cap_usd","budget_alert_thresholds"],"properties":{"allowed_topup_amounts":{},"budget_alert_thresholds":{},"default_overage_hard_cap_usd":{},"minimum_credit_purchase_usd":{},"plans":{}}},"GetPreferenceDialResponse":{"type":"object","required":["tenant_id","value"],"properties":{"last_updated":{"type":"string","example":"2026-05-17T18:30:00Z","nullable":true},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"updated_by":{"type":"string","example":"alice@acme.io","nullable":true},"value":{"type":"number","format":"float","example":0.7}}},"GetProtocolsResponse":{"type":"object","description":"GET /v1/admin/protocols\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["protocols"],"properties":{"protocols":{"type":"array","items":{}}}},"GetProviderHealthResponse":{"type":"object","description":"Returns provider health.\nAuto-typed response envelope for `get_provider_health` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["id","name","status","error_rate_5m","p50_latency_ms","p99_latency_ms","circuit_opened_at","circuit_opens","last_probe_at","last_probe_success"],"properties":{"circuit_opened_at":{},"circuit_opens":{},"error_rate_5m":{},"id":{},"last_probe_at":{},"last_probe_success":{},"name":{},"p50_latency_ms":{},"p99_latency_ms":{},"status":{}}},"GetReliabilitySloResponse":{"type":"object","description":"GET /v1/analytics/reliability/slo\nCombine latency and error stats for SLO view.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["period","errors","latency","by_model","error_budget","burn_rate_by_window","error_budget_timeline","error_categories"],"properties":{"burn_rate_by_window":{},"by_model":{},"error_budget":{},"error_budget_timeline":{},"error_categories":{},"errors":{},"latency":{},"period":{}}},"GetRoiResponse":{"type":"object","description":"GET /v1/analytics/roi\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["period","actual","baseline_gpt4","savings","breakdown","monthly_projection"],"properties":{"actual":{},"baseline_gpt4":{},"breakdown":{},"monthly_projection":{},"period":{"type":"string"},"savings":{}}},"GetRoutingDebugResponse":{"type":"object","description":"GET /v1/admin/routing/debug\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["organization_id","providers_registered","routing_strategy","tiers_available","lanes_available","cache_enabled","speculation_enabled","hedging_enabled","debug_info"],"properties":{"cache_enabled":{"type":"boolean","example":true},"debug_info":{},"hedging_enabled":{"type":"boolean","example":true},"lanes_available":{"type":"array","items":{}},"organization_id":{},"providers_registered":{},"routing_strategy":{"type":"string"},"speculation_enabled":{"type":"boolean","example":true},"tiers_available":{"type":"array","items":{}}}},"GetRoutingExplainResponse":{"type":"object","description":"GET /v1/analytics/routing/explain\nReturn recent routing decisions with requested vs selected model, lane/tier, scores.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["items"],"properties":{"items":{}}},"GetRoutingFlowResponse":{"type":"object","description":"GET /v1/analytics/routing-flow\nReturns (lane × tier × provider × model) edge counts for Sankey / alluvial flow diagrams.\nEach entry in `flows` represents a unique routing path with the number of requests that\ntraversed it. This is the data structure required for a live routing flow visualization.\n\nExample Sankey nodes: request → smart → T1 → openai → gpt-4o\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["period","total_requests","flows","nodes"],"properties":{"flows":{},"nodes":{},"period":{},"total_requests":{}}},"GetRoutingResponse":{"type":"object","description":"GET /v1/analytics/routing\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["model","count"],"properties":{"count":{},"model":{}}},"GetStatsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; field types mirror the concrete numeric values the handler emits.","required":["system_prompt_cache_hits","system_prompt_cache_misses","conversation_compaction_tokens_saved","tool_pruning_tokens_saved","total_cost_saved_usd","total_tokens_saved"],"properties":{"conversation_compaction_tokens_saved":{"type":"integer","format":"int64","minimum":0},"system_prompt_cache_hits":{"type":"integer","format":"int64","minimum":0},"system_prompt_cache_misses":{"type":"integer","format":"int64","minimum":0},"tool_pruning_tokens_saved":{"type":"integer","format":"int64","minimum":0},"total_cost_saved_usd":{"type":"number","format":"double","example":0.42},"total_tokens_saved":{"type":"integer","format":"int64","minimum":0}}},"GetSubagentResponse":{"type":"object","description":"Subagent retrieval (stub implementation)\nPOST /v1/agents/subagent\nAuto-typed response envelope for `get_subagent` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"GetSystemHealthResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["postgres","redis","embedding_model","region"],"properties":{"embedding_model":{},"postgres":{},"redis":{},"region":{}}},"GetTestRunSummaryResponse":{"type":"object","description":"GET /v1/analytics/test-run-summary?run_id=...&since=...\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["run_id","total_requests","successes","failures","models_used","requests","routing_distribution","routing_quality","cost_analysis","data_quality","latency","errors"],"properties":{"cost_analysis":{},"data_quality":{},"errors":{},"failures":{},"latency":{},"models_used":{},"requests":{},"routing_distribution":{},"routing_quality":{},"run_id":{},"successes":{},"total_requests":{}}},"GetTokenLedgerResponse":{"type":"object","description":"GET /v1/analytics/tokens/ledger\nToken ledger: input/output tokens and cache savings (reuse cache_efficiency logic)\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["read_path","period","tokens","cache","timeseries","requests","total_cost_usd"],"properties":{"cache":{},"period":{},"read_path":{"type":"string","example":"/v1/chat/completions"},"requests":{},"timeseries":{},"tokens":{},"total_cost_usd":{}}},"GetUsageResponse":{"type":"object","description":"GET /v1/connections/usage — Credit usage breakdown by provider and model.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["month","byProvider","byModel"],"properties":{"byModel":{},"byProvider":{},"month":{}}},"GetVoiceAnalyticsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["tenant_id","rows"],"properties":{"rows":{},"tenant_id":{}}},"GrammarListResponse":{"type":"object","required":["grammars"],"properties":{"grammars":{"type":"array","items":{"$ref":"#/components/schemas/GrammarSummary"}}}},"GrantCreditRequest":{"type":"object","required":["amount_cents","reason"],"properties":{"amount_cents":{"type":"integer","format":"int64","description":"Amount to add, in whole cents. Must be positive.","example":2000},"reason":{"type":"string","description":"Why this grant was made. Stored on the ledger row, so it is what the\naudit reads back months later. Required: an unexplained grant is exactly\nthe row nobody can account for.","example":"Pilot credit for ACME, approved by founder"}}},"GraphQueryRequest":{"type":"object","required":["query"],"properties":{"parameters":{"nullable":true},"query":{"type":"string","maxLength":5000,"minLength":1},"timeout_ms":{"type":"integer","format":"int64","example":145,"minimum":0}}},"GraphQueryResponse":{"type":"object","required":["results","execution_time_ms","rows_returned"],"properties":{"execution_time_ms":{"type":"integer","format":"int64","example":145,"minimum":0},"results":{"type":"array","items":{}},"rows_returned":{"type":"integer","minimum":0}}},"HandshakeRequest":{"type":"object","required":["server_url"],"properties":{"server_url":{"type":"string","example":"https://api.xantly.com"},"timeout_ms":{"type":"integer","format":"int64","example":145,"nullable":true,"minimum":0}}},"HandshakeResponse":{"type":"object","required":["success","latency_ms","cached"],"properties":{"cached":{"type":"boolean","example":true},"capabilities":{"allOf":[{"$ref":"#/components/schemas/McpCapabilities"}],"nullable":true},"latency_ms":{"type":"integer","format":"int64","example":145,"minimum":0},"success":{"type":"boolean","example":true}}},"HealerConfigResponse":{"type":"object","required":["enabled","stages","fallback_behavior","stats"],"properties":{"enabled":{"type":"boolean","example":true},"fallback_behavior":{"type":"string"},"stages":{"type":"array","items":{"$ref":"#/components/schemas/HealerStage"}},"stats":{"$ref":"#/components/schemas/HealerConfigStats"}}},"HealerRulesResponse":{"type":"object","required":["rules"],"properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/HealerRuleSummary"}}}},"HealerStatsResponse":{"type":"object","required":["period","total_requests","needed_healing","healing_rate","healed_successfully","healing_success_rate","by_stage","failed_samples","cost_of_llm_healing_usd"],"properties":{"by_stage":{"type":"array","items":{"$ref":"#/components/schemas/StageStats"}},"cost_of_llm_healing_usd":{"type":"number","format":"double","example":0.42},"failed_samples":{"type":"array","items":{"$ref":"#/components/schemas/FailedSample"}},"healed_successfully":{"type":"integer","format":"int64"},"healing_rate":{"type":"number","format":"double","example":0.95},"healing_success_rate":{"type":"number","format":"double","example":0.95},"needed_healing":{"type":"integer","format":"int64"},"period":{"type":"string"},"total_requests":{"type":"integer","format":"int64","example":15000}}},"HealthCheckResponse":{"type":"object","description":"GET /v1/mcp/health - Health check for MCP gateway\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","timestamp","services"],"properties":{"services":{},"status":{},"timestamp":{"type":"string","example":"2026-05-17T18:30:00Z"}}},"HealthResponse":{"type":"object","description":"Health status response","required":["status","timestamp"],"properties":{"status":{"type":"string","example":"healthy"},"timestamp":{"type":"string","example":"2026-05-17T18:30:00Z"},"version":{"type":"string","example":"1.0.0","nullable":true}}},"HealthSnapshot":{"type":"object","required":["overall","generated_at","categories"],"properties":{"categories":{"type":"array","items":{"$ref":"#/components/schemas/CategoryResult"}},"generated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"overall":{"$ref":"#/components/schemas/CheckStatus"}}},"HedgingConfigUpdate":{"type":"object","properties":{"enabled":{"type":"boolean","example":true,"nullable":true},"p95_threshold_ms":{"type":"integer","format":"int64","example":145,"nullable":true,"minimum":0}}},"HedgingStats":{"type":"object","required":["total_requests","hedged_requests","primary_wins","backup_wins","avg_latency_primary","avg_latency_backup","cost_overhead_usd"],"properties":{"avg_latency_backup":{"type":"number","format":"double"},"avg_latency_primary":{"type":"number","format":"double"},"backup_wins":{"type":"integer","format":"int64"},"cost_overhead_usd":{"type":"number","format":"double","example":4.52},"hedged_requests":{"type":"integer","format":"int64"},"primary_wins":{"type":"integer","format":"int64"},"total_requests":{"type":"integer","format":"int64","example":15000}}},"ImportMemoryRequest":{"type":"object","required":["source"],"properties":{"options":{"allOf":[{"$ref":"#/components/schemas/ImportOptions"}],"nullable":true},"source":{"$ref":"#/components/schemas/ImportSource"}}},"ImportMemoryResponse":{"type":"object","required":["import_id","status"],"properties":{"import_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","example":"active"}}},"ImportWorkflowResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["workflow_id","status"],"properties":{"status":{"type":"string","example":"active"},"workflow_id":{}}},"InferSchemaRequest":{"type":"object","required":["samples"],"properties":{"options":{"allOf":[{"$ref":"#/components/schemas/InferOptions"}],"nullable":true},"samples":{"type":"array","items":{}}}},"InferSchemaResponse":{"type":"object","required":["inferred_schema","confidence","warnings"],"properties":{"confidence":{"type":"number","format":"double","example":0.92},"inferred_schema":{},"warnings":{"type":"array","items":{"type":"string"}}}},"InferredContractActionSetting":{"type":"string","description":"Posture for an INFERRED output contract (#518).\n\nDistinct from [`OutputContractTierSetting`], which governs a contract the\ncaller DECLARED (`response_format`, `tools`, `xantly.contract`). This one\ngoverns a contract the caller stated in prose in their system prompt, which\nis what every agent framework does, and which the gateway infers.\n\nThe rungs are a ladder: each does everything the one before it does.","enum":["default","off","observe","normalize","repair","enforce"]},"IngestEventResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"queued"}}},"IngestReport":{"type":"object","required":["ingested","refused_eval","embed_failures","upsert_failures"],"properties":{"embed_failures":{"type":"integer","format":"int32","minimum":0},"ingested":{"type":"integer","format":"int32","minimum":0},"refused_eval":{"type":"integer","format":"int32","minimum":0},"upsert_failures":{"type":"integer","format":"int32","minimum":0}}},"InspectPlatformInviteResponse":{"type":"object","required":["valid","account_exists"],"properties":{"account_exists":{"type":"boolean","description":"Whether a Xantly account already exists for the invited email. `true` →\nthe invitee logs in and we promote them; `false` → they create an account\nvia the invite (auto-verified, no OTP)."},"email":{"type":"string","description":"The invited email (present only when `valid`).","nullable":true},"platform_role":{"type":"string","description":"The invited platform role: \"admin\" or \"viewer\" (present only when `valid`).","nullable":true},"valid":{"type":"boolean","description":"True when the token maps to a pending, non-expired invitation."}}},"InstallTemplateResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["workflow_id"],"properties":{"workflow_id":{}}},"IntelligenceMode":{"type":"string","description":"Intelligence layer preset. Single source of truth for the accepted\n`default_intelligence_mode` values so serde rejects unknown variants before\nthey reach the handler and the OpenAPI schema advertises the enum to the FE.\nCloses audit P2 be-settings-6.","enum":["proxy","cache","full"]},"IntrospectRequest":{"type":"object","required":["token"],"properties":{"_token_type_hint":{"type":"string","nullable":true},"token":{"type":"string"}}},"IntrospectResponse":{"type":"object","required":["active"],"properties":{"active":{"type":"boolean","example":true},"aud":{"type":"array","items":{"type":"string"},"nullable":true},"client_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"exp":{"type":"integer","format":"int64","nullable":true},"iat":{"type":"integer","format":"int64","nullable":true},"iss":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"sub":{"type":"string","nullable":true},"token_type":{"type":"string","nullable":true},"username":{"type":"string","example":"alice","nullable":true}}},"InvalidateCacheResponse2":{"type":"object","description":"Returns invalidate cache.\nAuto-typed response envelope for `invalidate_cache` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["status","key"],"properties":{"key":{},"status":{}}},"InvalidateRequest":{"type":"object","required":["provider"],"properties":{"provider":{"type":"string","example":"openai"},"tool_hash":{"type":"string","example":"sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","nullable":true}}},"InvitationResponse":{"type":"object","required":["id","organizationId","email","role","status","expiresAt","createdAt"],"properties":{"createdAt":{"type":"string","example":"2026-05-17T18:30:00Z"},"email":{"type":"string","example":"alice@acme.io"},"expiresAt":{"type":"string","example":"2026-05-17T19:30:00Z"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationId":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"role":{"type":"string"},"status":{"type":"string","example":"active"}}},"InviteCreatedResponse":{"type":"object","required":["id","email","role","message"],"properties":{"email":{"type":"string","example":"alice@acme.io"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"role":{"type":"string"}}},"InvitePreviewResponse":{"type":"object","required":["valid","email","organizationName","role","expiresAt","userExists"],"properties":{"email":{"type":"string","example":"alice@acme.io"},"expiresAt":{"type":"string","example":"2026-05-17T19:30:00Z"},"inviterName":{"type":"string","example":"acme","nullable":true},"organizationName":{"type":"string","example":"acme"},"role":{"type":"string"},"userExists":{"type":"boolean","example":true},"valid":{"type":"boolean","example":true}}},"InvoiceHeaderResponse":{"type":"object","required":["id","organization_id","amount_cents","currency","status","date","created_at"],"properties":{"amount_cents":{"type":"integer","format":"int64"},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"currency":{"type":"string"},"date":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organization_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"pdf_url":{"type":"string","example":"https://api.xantly.com","nullable":true},"status":{"type":"string","example":"active"}}},"InvoiceLineItem":{"type":"object","required":["model_name","token_type","units","price_per_1m_snapshot","line_total_usd","metadata"],"properties":{"api_key_id":{"type":"string","format":"uuid","description":"The API key this usage was billed under, when known — enables per-key\ninvoice detail. Nullable: legacy rows and non-key traffic have no key.","nullable":true},"canonical_model_id":{"type":"string","format":"uuid","nullable":true},"line_total_usd":{"type":"number","format":"double"},"metadata":{},"model_name":{"type":"string"},"price_per_1m_snapshot":{"type":"number","format":"double"},"token_type":{"type":"string"},"units":{"type":"integer","format":"int64"}}},"InvoicesResponse":{"type":"object","required":["invoices"],"properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceItem"}}}},"JwksResponse":{"type":"object","required":["keys"],"properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/Jwk"}}}},"LearningDynamicsResponse":{"type":"object","required":["tenant_id","update_count","convergence_metric","exploration_ratio","total_reward_sum","last_weight_delta_norm","model_weight_norms"],"properties":{"convergence_metric":{"type":"number","format":"float"},"exploration_ratio":{"type":"number","format":"float"},"last_weight_delta_norm":{"type":"number","format":"float"},"model_weight_norms":{"type":"array","items":{"$ref":"#/components/schemas/ModelWeightNorm"}},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"total_reward_sum":{"type":"number","format":"double"},"update_count":{"type":"integer","format":"int64","example":42,"minimum":0}}},"ListAgentsResponse":{"type":"object","description":"List Agents (Paginated)\nGET /v1/agents\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data","meta"],"properties":{"data":{},"meta":{}}},"ListApiKeysResponse":{"type":"object","description":"List all API keys for the user (Cursor Pagination)\nGET /v1/api-keys\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data","meta"],"properties":{"data":{},"meta":{}}},"ListCallsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.\nThe inner field is typed `Vec<BridgeCall>` (not `Value`) so the published\nOpenAPI carries the element schema instead of `unknown[]`.\nCloses audit P2 be-bridge-28.","required":["calls"],"properties":{"calls":{"type":"array","items":{"$ref":"#/components/schemas/BridgeCall"}}}},"ListChainsNotesResponse":{"type":"object","required":["chains"],"properties":{"chains":{"type":"array","items":{"$ref":"#/components/schemas/ChainListEntry"}}}},"ListChainsResponse":{"type":"object","required":["chains","total","limit","offset"],"properties":{"chains":{"type":"array","items":{"$ref":"#/components/schemas/ChainListEntry"}},"limit":{"type":"integer","example":50,"minimum":0},"offset":{"type":"integer","example":0,"minimum":0},"total":{"type":"integer","format":"int64","example":42}}},"ListCloudCreditsFeesResponse":{"type":"object","description":"Response for `GET /v1/admin/organizations/cloud-credits-fees`.","required":["organizations","total","has_more","standard_fee_bps"],"properties":{"has_more":{"type":"boolean"},"organizations":{"type":"array","items":{"$ref":"#/components/schemas/CloudCreditsFeeItem"}},"standard_fee_bps":{"type":"integer","format":"int32","description":"The fee a NEW cloud-credits connection is created with, in basis points.\nSurfaced so the operator UI can state the default instead of hardcoding\nits own copy of the number.","example":300},"total":{"type":"integer","format":"int64","description":"Total number of orgs with a cloud-credits connection, independent of the\npage `limit`.","example":3}}},"ListCredentialsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data"],"properties":{"data":{}}},"ListDiscrepanciesResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data","count"],"properties":{"count":{"type":"integer","format":"int64","example":42},"data":{}}},"ListDocsResponse":{"type":"object","required":["docs"],"properties":{"docs":{"type":"array","items":{"$ref":"#/components/schemas/DocSummary"}}}},"ListExperimentsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data"],"properties":{"data":{}}},"ListFormalSpecsResponse":{"type":"object","required":["specs","total_count"],"properties":{"specs":{"type":"array","items":{"$ref":"#/components/schemas/FormalSpecSummary"}},"total_count":{"type":"integer","example":42,"minimum":0}}},"ListMaskingConfigsResponse":{"type":"object","description":"GET /v1/context/masking-config\nList masking configs.\nAuto-typed response envelope for `list_masking_configs` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["error"],"properties":{"error":{}}},"ListModelsResponse":{"type":"object","required":["object","data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}},"object":{"type":"string"}}},"ListNodeTypesResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["node_types"],"properties":{"node_types":{"type":"array","items":{}}}},"ListOrgLimitsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["organizations","total","has_more"],"properties":{"has_more":{"type":"boolean","description":"Whether more orgs exist beyond this page (`offset + returned < total`)."},"organizations":{"type":"array","items":{"$ref":"#/components/schemas/OrgLimitItem"}},"total":{"type":"integer","format":"int64","description":"Total number of non-deleted orgs, independent of the page `limit`.","example":42}}},"ListPasskeysResponse":{"type":"object","description":"List the authenticated user's active passkeys.\n\nReturns only non-sensitive metadata (id, name, dates, transports).\nDoes NOT return credential_id or public_key material.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["passkeys"],"properties":{"passkeys":{}}},"ListPendingApprovalsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.\nThe inner field is typed `Vec<PendingApproval>` (not `Value`) so the\npublished OpenAPI carries the element schema instead of `unknown[]`.\nCloses audit P2 be-bridge-30.","required":["pending"],"properties":{"pending":{"type":"array","items":{"$ref":"#/components/schemas/PendingApproval"}}}},"ListPoliciesResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data"],"properties":{"data":{}}},"ListPromotionsResponse":{"type":"object","description":"GET /admin/billing/promotions — List active + upcoming promos\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["promotions"],"properties":{"promotions":{}}},"ListProvidersResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data"],"properties":{"data":{}}},"ListReconciliationRunsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data"],"properties":{"data":{}}},"ListRecoveriesResponse":{"type":"object","description":"GET /v1/reliability/recoveries — list recent recovery actions\nAuto-typed response envelope for `list_recoveries` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["error"],"properties":{"error":{}}},"ListResponse":{"type":"object","required":["endpoints","count","total_count"],"properties":{"count":{"type":"integer","description":"Number of rows in this page (i.e. `endpoints.len()`). Kept for backward\ncompatibility; use `total_count` to compute the number of pages.","example":42,"minimum":0},"endpoints":{"type":"array","items":{"$ref":"#/components/schemas/EndpointRow"}},"total_count":{"type":"integer","format":"int64","description":"Total rows matching the filter across all pages, ignoring limit/offset.\nLets the pagination UI derive the page count.\nCloses audit P2 be-admin_endpoints-13","example":137}}},"ListSchemasResponse":{"type":"object","description":"List schemas.\nAuto-typed response envelope for `list_schemas`; field types mirror the\n`schemas::Model` columns serialized by the handler.","required":["id","name","version","status","enforcement","created_at","usage_count24h"],"properties":{"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"enforcement":{"type":"string"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"status":{"type":"string","example":"active"},"usage_count24h":{"type":"integer","format":"int64"},"version":{"type":"string","example":"1.0.0"}}},"ListTemplatesResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["templates"],"properties":{"templates":{}}},"ListTenantsResponse":{"type":"object","required":["tenants"],"properties":{"next_cursor":{"type":"string","description":"Keyset cursor for the next page (the `created_at` of the last row,\nRFC 3339). `null` when there are no more rows. Pass it back as\n`?cursor=` to fetch the following page.","nullable":true},"tenants":{"type":"array","items":{"$ref":"#/components/schemas/TenantSummary"}}}},"ListToolsResponse":{"type":"object","required":["tools","total_count"],"properties":{"tools":{"type":"array","items":{"$ref":"#/components/schemas/ToolSummary"}},"total_count":{"type":"integer","example":42,"minimum":0}}},"ListTrajectoriesResponse":{"type":"object","description":"Response payload for `GET /v1/planning/trajectories`.","required":["trajectories"],"properties":{"trajectories":{"type":"array","items":{"$ref":"#/components/schemas/TrajectoryRow"}}}},"ListVoiceCredentialsResponse":{"type":"object","description":"Response body for `GET /v1/voice/credentials`.","required":["credentials"],"properties":{"credentials":{"type":"array","items":{"$ref":"#/components/schemas/VoiceCredentialResponse"}}}},"LogEntry":{"type":"object","description":"A single log line as consumed by the Mission Control \"Logs\" page\n(frontend `LogEntry` in hooks/useTelemetry.ts).","required":["id","timestamp","level","message","service","metadata"],"properties":{"id":{"type":"string","example":"req_3f2e1a90c4d5b8e2"},"level":{"type":"string","description":"info | warn | error | debug","example":"info"},"message":{"type":"string"},"metadata":{},"service":{"type":"string"},"timestamp":{"type":"string","example":"2026-05-04T18:30:00Z"},"traceId":{"type":"string","nullable":true}}},"LoginBeginRequest":{"type":"object","properties":{"email":{"type":"string","example":"alice@acme.io","nullable":true}}},"LoginCompleteRequest":{"type":"object","required":["credential"],"properties":{"credential":{"$ref":"#/components/schemas/PublicKeyCredential"}}},"LoginCompleteResponse":{"type":"object","description":"Complete passkey authentication ceremony and create a browser session.\n\nOn success, creates a session with AAL2 (passkey is inherently multi-factor).\nPasskey sessions receive **session-long sudo** — the AAL2 status persists\nfor the entire session lifetime without requiring re-authentication.\nAuto-typed response envelope for `login_complete` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"LoginOtpSendRequest":{"type":"object","required":["login_token"],"properties":{"login_token":{"type":"string","example":"xnt_3f2e1a90c4d5b8e2"}}},"LoginOtpSendResponse":{"type":"object","description":"Response from `POST /v1/auth/login-otp/send`.","required":["status","emailHint"],"properties":{"emailHint":{"type":"string","description":"Masked email address the OTP went to."},"status":{"type":"string","description":"`\"sent\"` on success.","example":"active"}}},"LoginOtpVerifyRequest":{"type":"object","required":["login_token","code"],"properties":{"code":{"type":"string"},"login_token":{"type":"string","example":"xnt_3f2e1a90c4d5b8e2"},"trust_browser":{"type":"boolean","example":true,"nullable":true}}},"LoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email","example":"alice@acme.io"},"mfa_code":{"type":"string","nullable":true},"password":{"type":"string"},"remember_me":{"type":"boolean","example":true,"nullable":true},"trust_browser":{"type":"boolean","example":true,"nullable":true}}},"LoginResponse":{"type":"object","description":"Response from `POST /v1/auth/login`.\n\nPolymorphic: returns a full `BrowserSessionResponse` on direct success,\nor `{email_otp_required: true, login_token}` when step-up MFA is required.","properties":{"emailHint":{"type":"string","description":"Optional masked email hint shown alongside the OTP prompt.","nullable":true},"emailOtpRequired":{"type":"boolean","description":"True when the caller must complete the email-OTP step before getting\na session.  In that case `login_token` is set and `session` is not.","example":true,"nullable":true},"loginToken":{"type":"string","description":"Opaque short-lived token the caller passes to `login-otp/send` and\nthen to `login-otp/verify` to complete the MFA hand-off.","example":"xnt_3f2e1a90c4d5b8e2","nullable":true},"session":{"allOf":[{"$ref":"#/components/schemas/BrowserSessionResponse"}],"nullable":true}}},"ManualVerifyRequest":{"type":"object","required":["tool_name","tool_arguments","user_context"],"properties":{"tool_arguments":{},"tool_name":{"type":"string","example":"acme"},"user_context":{"type":"string"}}},"ManualVerifyResponse":{"type":"object","required":["status","tool_name","verified_at"],"properties":{"note":{"type":"string","description":"Optional human-readable note (e.g. reviewer comment, rejection reason).","nullable":true},"status":{"type":"string","description":"Verification outcome: `verified` | `rejected` | `pending`.","example":"active"},"tool_name":{"type":"string","example":"acme"},"verified_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"}}},"MarginPolicyRequest":{"type":"object","properties":{"alpha":{"type":"number","format":"double","description":"Savings share (0..1) for List-Indexed. Omit to leave unchanged.","example":0.25,"nullable":true},"beta":{"type":"number","format":"double","description":"Take rate on provider cost (0..1) for List-Indexed. Omit to leave unchanged.","example":0.03,"nullable":true},"default_markup_pct":{"type":"number","format":"double","example":0.95,"nullable":true},"is_default":{"type":"boolean","example":true,"nullable":true},"name":{"type":"string","example":"Acme Corporation","nullable":true},"pricing_mode":{"type":"string","description":"List-Indexed pricing mode (\"markup\" | \"list_indexed\"). Omit to leave unchanged.","example":"list_indexed","nullable":true},"specialization_overrides":{"nullable":true},"tier_overrides":{"nullable":true}}},"MatrixRefreshResponse":{"type":"object","description":"Admin-triggered capability-matrix refresh. Pulls the current catalog\nsnapshot + five HTTP leaderboard sources, runs the IRT fit, persists\nthe new version, retires older ones, and returns the fit summary.\n\nSynchronous — blocks the request until the fit completes. Safe to\ncall on cold-boot when the auto-provisioning first-fit silently\nfailed, and safe to re-call after catalog changes to immediately\npick them up (instead of waiting for the weekly tick).","required":["ok","message"],"properties":{"error_detail":{"type":"string","description":"Raw error detail — this endpoint is admin-only so the full error\nchain is returned to aid diagnosis. Null on success.","nullable":true},"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"ok":{"type":"boolean","example":true},"version":{"type":"integer","format":"int64","example":"1.0.0","nullable":true,"minimum":0}}},"McDashboardsCostsResponse":{"type":"object","description":"`GET /v1/analytics/costs/summary`\n\nReturns the shape the Analytics cost view expects:\nprojected monthly cost, savings split (cache / routing / memory), and a\nstacked time series of cost by provider. Pulls from `analytics_rollups`\nfor cost timeseries (already keyed by provider + day) and from\n`mission_control_events` for the savings classification.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["total_cost","projected_monthly_cost","burn_rate_per_day_usd","cache_savings","routing_savings","memory_savings","total_savings","by_provider","granularity","period"],"properties":{"burn_rate_per_day_usd":{},"by_provider":{},"cache_savings":{},"granularity":{},"memory_savings":{},"period":{"type":"string"},"projected_monthly_cost":{},"routing_savings":{},"total_cost":{},"total_savings":{}}},"McDashboardsTokensResponse":{"type":"object","description":"`GET /v1/analytics/tokens/usage`\n\nOne-shot consolidated payload for the Token Usage dashboard.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["totals","projection","trend","by_api_key","by_model","by_provider","granularity","period"],"properties":{"by_api_key":{},"by_model":{},"by_provider":{},"granularity":{},"period":{"type":"string"},"projection":{},"totals":{},"trend":{}}},"McProvidersHealthResponse":{"type":"object","required":["providers","total","healthy","degraded"],"properties":{"degraded":{"type":"integer","minimum":0},"healthy":{"type":"integer","minimum":0},"providers":{"type":"array","items":{"$ref":"#/components/schemas/McProviderHealth"}},"total":{"type":"integer","example":42,"minimum":0}}},"McRequestTraceResponse":{"type":"object","required":["request_id","trace","note"],"properties":{"note":{"type":"string"},"request_id":{"type":"string","example":"req_3f2e1a90c4d5b8e2"},"trace":{}}},"McpMemoryRecallRequest":{"type":"object","description":"MCP `memory_recall` tool request.","required":["conversation_id"],"properties":{"conversation_id":{"type":"string","description":"Conversation ID to recall context for.","example":"550e8400-e29b-41d4-a716-446655440000"}}},"McpMemoryRecallResponse":{"type":"object","description":"MCP `memory_recall` tool response.","required":["conversation_id","turns","total_turns"],"properties":{"conversation_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"total_turns":{"type":"integer","minimum":0},"turns":{"type":"array","items":{"$ref":"#/components/schemas/ConversationTurn"}}}},"McpMemorySearchRequest":{"type":"object","description":"MCP `memory_search` tool request.","required":["query"],"properties":{"limit":{"type":"integer","description":"Maximum number of results (default: 10).","example":50,"minimum":0},"query":{"type":"string","description":"Natural-language query for semantic search."}}},"McpMemorySearchResponse":{"type":"object","description":"MCP `memory_search` tool response.","required":["results","total","query"],"properties":{"query":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/McpMemorySearchResult"}},"total":{"type":"integer","description":"Number of results returned in `results`. Closes audit P2 be-mcp_memory-4:\nthis is the size of the returned page (bounded by `limit`), not the total\nnumber of matches across the corpus — the example is corrected and the\nvalue is now sourced from the service rather than re-derived locally.","example":10,"minimum":0}}},"McpMemoryStoreRequest":{"type":"object","description":"MCP `memory_store` tool request.","required":["content"],"properties":{"content":{"type":"string","description":"The content to store in long-term memory."},"memory_type":{"allOf":[{"$ref":"#/components/schemas/MemoryType"}],"nullable":true},"metadata":{"description":"Optional metadata (session, tags, source, etc.).","nullable":true}}},"McpMemoryStoreResponse":{"type":"object","description":"MCP `memory_store` tool response.","required":["memory_id","stored","entities_extracted"],"properties":{"entities_extracted":{"type":"integer","minimum":0},"memory_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"stored":{"type":"boolean","example":true}}},"MemoryAnalytics":{"type":"object","description":"Analytics for the memory subsystem over a given period.","required":["l0_hit_rate","l1_hit_rate","l2_hit_rate","l3_hit_rate","total_requests","memory_served_requests","estimated_cost_saved_usd","avg_tokens_saved_per_request","period"],"properties":{"avg_tokens_saved_per_request":{"type":"number","format":"double","description":"Average tokens saved per request thanks to memory context injection."},"estimated_cost_saved_usd":{"type":"number","format":"double","description":"Estimated cost saved by serving from cache/memory instead of fresh LLM calls."},"l0_hit_rate":{"type":"number","format":"double","description":"Cache hit rate for L0 (Moka in-process)."},"l1_hit_rate":{"type":"number","format":"double","description":"Cache hit rate for L1 (Redis)."},"l2_hit_rate":{"type":"number","format":"double","description":"Hit rate for L2 (Qdrant vector search)."},"l3_hit_rate":{"type":"number","format":"double","description":"Hit rate for L3 (Neo4j graph)."},"memory_served_requests":{"type":"integer","format":"int64","description":"Requests that were served (at least partially) from memory.","minimum":0},"period":{"$ref":"#/components/schemas/AnalyticsPeriod"},"total_requests":{"type":"integer","format":"int64","description":"Total requests that queried the memory subsystem.","minimum":0}}},"MemoryAnalyticsResponse":{"oneOf":[{"$ref":"#/components/schemas/MemoryAnalytics"},{"$ref":"#/components/schemas/AnalyticsV2Response"}],"description":"GET /v1/memory/analytics\n\nReturns analytics for the memory subsystem over the requested period.\n\nWhen `XANTLY_FF_ANALYTICS_V2` == \"true\", returns the abstract V2 shape\n(no internal layer names). Otherwise returns the legacy L0/L1/L2/L3 shape.\n\nResponse body for `GET /v1/memory/analytics`. The endpoint returns one of\ntwo real shapes depending on the `XANTLY_FF_ANALYTICS_V2` rollout flag, so\nthis is an untagged union of those concrete types rather than an opaque\n`{ data: <json> }` envelope — the previous placeholder did not match either\nruntime shape and made generated FE clients produce a wrong type.\nCloses audit P2 be-analytics_memory-15"},"MemoryAnalyticsV2":{"type":"object","description":"Memory context analytics.","required":["contexts_served"],"properties":{"avg_cache_relevance":{"type":"number","format":"double","description":"Placeholder — not yet populated.","nullable":true},"contexts_served":{"type":"integer","format":"int64"}}},"MemoryContextResponse":{"type":"object","required":["request_id","context_loaded","loading_time_ms","vector_search","graph_traversal","merge_result"],"properties":{"context_loaded":{"type":"boolean","example":true},"graph_traversal":{"$ref":"#/components/schemas/GraphTraversalInfo"},"loading_time_ms":{"type":"integer","format":"int64","example":145,"minimum":0},"merge_result":{"$ref":"#/components/schemas/MergeResult"},"request_id":{"type":"string","example":"req_3f2e1a90c4d5b8e2"},"vector_search":{"$ref":"#/components/schemas/VectorSearchInfo"}}},"MemoryEntryResponse":{"type":"object","required":["memory_id","content","type","embedding","entities","created_at","access_count"],"properties":{"access_count":{"type":"integer","format":"int64","example":42,"minimum":0},"content":{"type":"string"},"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"embedding":{"type":"array","items":{"type":"number","format":"float"}},"entities":{"type":"array","items":{"type":"string"}},"last_accessed_at":{"type":"string","example":"2026-05-17T18:30:00Z","nullable":true},"memory_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"metadata":{"nullable":true},"type":{"type":"string"}}},"MemoryHealthScore":{"type":"object","description":"Overall health score for the memory subsystem (0–100).","required":["overall_score","entity_coverage","fact_freshness","retrieval_relevance","contradiction_ratio","procedure_success_rate"],"properties":{"contradiction_ratio":{"type":"number","format":"double","description":"Ratio of detected contradictions to total facts.\nNOTE: contradiction-detection telemetry does not exist yet, so this is\nalways reported as 0.0 and is INFORMATIONAL ONLY — it is deliberately\nexcluded from `overall_score` so an unmeasured metric can't silently\ninflate the composite (it previously added a flat +15 every response)."},"entity_coverage":{"type":"number","format":"double","description":"Percentage of entities with up-to-date embeddings."},"fact_freshness":{"type":"number","format":"double","description":"Heuristic freshness proxy in [0,1], bucketed from total fact count.\nNOTE: not yet a measured \"updated within 24h\" rate — no time-window\ntelemetry exists for facts, so this is a coarse volume-based estimate."},"overall_score":{"type":"integer","format":"int32","description":"Composite score 0–100.","example":0.85,"minimum":0},"procedure_success_rate":{"type":"number","format":"double","description":"Success rate of procedural memory retrievals.\nNOTE: the procedural-memory subsystem does not yet emit a retrieval\nsuccess-rate signal, so this is reported as 0.0 rather than being\nsourced from an unrelated metric (it previously aliased the L0\nin-process cache hit rate, which is a different thing entirely).","example":0.95},"retrieval_relevance":{"type":"number","format":"double","description":"Heuristic retrieval-quality proxy in [0,1], bucketed from indexed chunk\ncount. NOTE: not yet a measured cosine-similarity score — no similarity\ntelemetry is captured, so this is a coarse volume-based estimate."}}},"MemoryRecallRequest":{"type":"object","required":["query"],"properties":{"limit":{"type":"integer","example":50,"minimum":0},"query":{"type":"string"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"top_k":{"type":"integer","nullable":true,"minimum":0}}},"MemoryRecallResponse":{"type":"object","required":["matches"],"properties":{"graph":{"type":"array","items":{"$ref":"#/components/schemas/GraphNeighbor"}},"matches":{"type":"array","items":{"$ref":"#/components/schemas/MemoryMatch"}},"semantic":{"type":"array","items":{"$ref":"#/components/schemas/MemoryMatch"}}}},"MemoryStatsResponse":{"type":"object","required":["tenant_id","totals","by_type","by_user","quotas"],"properties":{"by_type":{"type":"array","items":{"$ref":"#/components/schemas/TypeCount"}},"by_user":{"type":"array","items":{"$ref":"#/components/schemas/UserCount"}},"quotas":{"$ref":"#/components/schemas/MemoryQuotas"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"totals":{"$ref":"#/components/schemas/MemoryTotals"}}},"MemoryStoreRequest":{"type":"object","required":["content"],"properties":{"content":{"type":"string"},"metadata":{"nullable":true},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true}}},"MemoryStoreResponse":{"type":"object","required":["memory_id","stored_at","fact_id","stored_layer"],"properties":{"fact_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"memory_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"stored_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"stored_layer":{"type":"string"}}},"MessageResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."}}},"MetricsSummary":{"type":"object","required":["total_requests","avg_cost_per_1m","avg_ttft","uptime","schema_integrity","tier_distribution","savings_vs_gpt4"],"properties":{"avg_cost_per_1m":{"type":"number","format":"double"},"avg_ttft":{"type":"integer","format":"int32"},"savings_vs_gpt4":{"type":"number","format":"double"},"schema_integrity":{"type":"number","format":"double"},"tier_distribution":{"$ref":"#/components/schemas/TierDistribution"},"total_requests":{"type":"integer","format":"int64","example":15000},"uptime":{"type":"number","format":"double"}}},"MfaDisableRequest":{"type":"object","required":["password"],"properties":{"password":{"type":"string"}}},"MfaEnableRequest":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}},"MfaEnableResponse":{"type":"object","required":["recovery_codes"],"properties":{"recovery_codes":{"type":"array","items":{"type":"string"}}}},"MfaSetupResponse":{"type":"object","required":["secret","qr_code","expires_in_seconds"],"properties":{"expires_in_seconds":{"type":"integer","format":"int64","description":"How long this pending enrolment stays valid, in seconds. After it\nlapses, `POST /mfa/enable` answers \"setup expired\" and the panel has to\nbe reopened for a fresh secret. Advertised so the UI can say so instead\nof letting the user discover it by typing a code that gets rejected."},"qr_code":{"type":"string"},"secret":{"type":"string"}}},"MfaStatusResponse":{"type":"object","required":["enabled","totp_enrolled","passkey_enrolled","recovery_codes_remaining"],"properties":{"enabled":{"type":"boolean","example":true},"passkey_enrolled":{"type":"boolean","description":"True when the account has at least one live passkey.","example":true},"recovery_codes_remaining":{"type":"integer","format":"int64","description":"Unused recovery codes left. Zero on an enrolled account is a lockout\nwaiting to happen; the UI should prompt for a regeneration.","example":10},"totp_enrolled":{"type":"boolean","description":"True when the account has a CONFIRMED TOTP factor. `enabled` alone does\nnot imply one: a passkey registration sets `enabled` with a NULL secret\non purpose, because the passkey IS the second factor.\n\nThis used to report `mfa_secret IS NOT NULL`, which was true for an\nabandoned `/mfa/setup` as well and so told the UI that an account with\nno second factor had TOTP enrolled. Rows written by the current\n`setup_mfa` cannot be in that state at all (the pending secret never\nreaches Postgres), and the enrolment check here covers the ones written\nbefore that change.","example":true}}},"MfaVerifyRequest":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"6-digit TOTP code from the authenticator app."}}},"MfaVerifyResponse":{"type":"object","required":["verified","verified_at","expires_in"],"properties":{"expires_in":{"type":"integer","format":"int64","description":"Seconds until this step-up assertion expires server-side.","minimum":0},"verified":{"type":"boolean","example":true},"verified_at":{"type":"integer","format":"int64","description":"Unix timestamp (seconds) when this MFA assertion was recorded.","example":"2026-05-17T18:30:00Z"}}},"Model":{"type":"object","required":["id","object","created","owned_by"],"properties":{"created":{"type":"integer","format":"int64"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"object":{"type":"string"},"owned_by":{"type":"string"}}},"ModelCatalogEntryResponse":{"type":"object","required":["provider","name","slug","display_name","tier","supports_streaming","supports_structured_output","cost_per_1k_input","cost_per_1k_output","api_format","is_active"],"properties":{"api_format":{"type":"string"},"cost_per_1k_input":{"type":"number","format":"double"},"cost_per_1k_output":{"type":"number","format":"double"},"display_name":{"type":"string","example":"Alice Chen"},"is_active":{"type":"boolean","example":true},"max_context_tokens":{"type":"integer","format":"int32","nullable":true},"name":{"type":"string","example":"Acme Corporation"},"provider":{"type":"string","example":"openai"},"slug":{"type":"string"},"supports_streaming":{"type":"boolean","example":true},"supports_structured_output":{"type":"boolean","example":true},"tier":{"type":"string","example":"pro"}}},"ModelCatalogResponse":{"type":"object","required":["id","slug","display_name","base_url","upstream_model","tier","cost_per_1k_input","cost_per_1k_output","is_active","has_api_key","api_format","created_at","updated_at"],"properties":{"api_format":{"type":"string","description":"Wire-protocol format used for dispatch: \"openai\" | \"anthropic\" | \"gemini\" | \"custom\""},"api_key_env":{"type":"string","nullable":true},"base_url":{"type":"string","example":"https://api.xantly.com"},"cost_per_1k_input":{"type":"number","format":"double"},"cost_per_1k_output":{"type":"number","format":"double"},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"display_name":{"type":"string","example":"Alice Chen"},"has_api_key":{"type":"boolean","description":"api_key is omitted from responses for security; only shows whether set","example":true},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"is_active":{"type":"boolean","example":true},"slug":{"type":"string"},"tier":{"type":"string","example":"T2"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"upstream_model":{"type":"string"}}},"ModelConfigResponse":{"type":"object","required":["models"],"properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelConfig"}}}},"ModelEnableResult":{"type":"object","description":"Per model result of an enablement attempt. One of these is produced for\nEVERY requested model id, including the ones that were never attempted.","required":["modelId","outcome","ready","message"],"properties":{"awsErrorCode":{"type":"string","description":"AWS's own error code, when AWS refused. Diagnostic only.","nullable":true},"message":{"type":"string","description":"What the customer should DO next. Never blames the customer for a\nXantly side fault, and never says a model was enabled when it was not."},"modelId":{"type":"string","description":"The Bedrock model id exactly as requested.","example":"amazon.nova-micro-v1:0"},"outcome":{"$ref":"#/components/schemas/EnableOutcome"},"ready":{"type":"boolean","description":"Whether this model is invokable right now."},"storedStatus":{"type":"string","description":"The status `cloud_connection_models` holds after this attempt, which is\nwhat the router will key off. Absent when the attempt deliberately did\nnot touch the row at all (see [`EnableOutcome::db_status`]), so this\nnever implies a write that did not happen.\n\n#528: this is the status that is actually stored, NOT the verdict the\nattempt proposed. When AWS's answer would have demoted a model the\nrouter serves, the write is withheld and this reports the status that\nsurvived, with `message` saying so in words.","nullable":true}}},"ModelPerfResponse":{"type":"object","required":["model_id","tenant_id","request_count","success_rate","mean_reward","mean_latency_ms","p95_latency_ms","mean_cost_usd","total_cost_usd"],"properties":{"mean_cost_usd":{"type":"number","format":"double","example":0.42},"mean_latency_ms":{"type":"number","format":"float","example":145},"mean_reward":{"type":"number","format":"float"},"model_id":{"type":"string","example":"bedrock/nova-pro/us-east-1"},"p95_latency_ms":{"type":"number","format":"float","example":145},"request_count":{"type":"integer","example":15000,"minimum":0},"success_rate":{"type":"number","format":"float","example":0.995},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"total_cost_usd":{"type":"number","format":"double","example":12.45}}},"ModelRankingResponse":{"type":"object","required":["period","models"],"properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelRankingEntry"}},"period":{"type":"string"}}},"ModelSettings":{"type":"object","required":["mode","enabled_providers","preferred_tier"],"properties":{"enabled_providers":{"type":"array","items":{"type":"string"},"description":"Provider allowlist. Empty means every provider is eligible."},"mode":{"type":"string","description":"Routing mode: `auto` (router picks) or `manual` (respect the\npreferences below strictly).","example":"auto"},"non_compliant_mode":{"type":"boolean","description":"Whether this organization has opted in to models that do NOT carry the\nfull compliance guarantee set (SOC 2 + HIPAA + zero retention +\ncontracted).\n\nFALSE by default, for every organization, existing and new: an account\nmust opt IN to non-attested models, never discover after the fact that\nit was opted in by a default. Per-organization and stored on the org's\nown `org_settings` row, so one account's choice cannot reach another's.\n\nWhen true, the compliant models remain available and the non-attested\nones are ADDED to them; it widens the pool, it never swaps it."},"preferred_tier":{"type":"integer","format":"int32","description":"Preferred model tier: 1 (premium), 2 (standard), or 3 (economy).","example":2}}},"ModelUsage":{"type":"object","required":["model_name","provider","tokens","provider_cost","platform_fee","total"],"properties":{"model_name":{"type":"string"},"platform_fee":{"type":"number","format":"double"},"provider":{"type":"string"},"provider_cost":{"type":"number","format":"double"},"tokens":{"type":"integer","format":"int64"},"total":{"type":"number","format":"double"}}},"MonthlyInvoice":{"type":"object","description":"Monthly invoice summary","required":["invoice_id","organization_id","month","currency","pricing_mode","total_provider_cost","total_platform_fee","total_customer_charge","gross_margin_total","grand_total","total_tokens","baseline_cost","savings","commit_cents","commit_drawdown_usd","by_model","line_items"],"properties":{"baseline_cost":{"type":"number","format":"double"},"by_model":{"type":"array","items":{"$ref":"#/components/schemas/ModelUsage"}},"commit_cents":{"type":"integer","format":"int64","description":"Contract spend commitment in cents (0 = no active commitment). Minor (d)."},"commit_drawdown_usd":{"type":"number","format":"double","description":"Cumulative spend drawn down against the commitment since the contract took\neffect, in USD — for postpaid true-up reconciliation. Minor (d)."},"currency":{"type":"string"},"grand_total":{"type":"number","format":"double"},"gross_margin_total":{"type":"number","format":"double"},"invoice_id":{"type":"string","format":"uuid"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLineItem"}},"month":{"type":"string"},"organization_id":{"type":"string","format":"uuid"},"pricing_mode":{"type":"string"},"savings":{"type":"number","format":"double"},"total_customer_charge":{"type":"number","format":"double"},"total_platform_fee":{"type":"number","format":"double"},"total_provider_cost":{"type":"number","format":"double"},"total_tokens":{"type":"integer","format":"int64"}}},"NextStepRecommendation":{"type":"object","description":"GET /onboarding/next-step - Get next recommended onboarding step","required":["step","title","description","action_url"],"properties":{"action_url":{"type":"string","example":"https://api.xantly.com"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider."},"step":{"type":"string"},"title":{"type":"string"}}},"NotificationSettingsPayload":{"type":"object","required":["marketing_emails","security_emails","product_updates","billing_alerts","email_digest_frequency"],"properties":{"billing_alerts":{"type":"boolean","example":true},"email_digest_frequency":{"type":"string"},"marketing_emails":{"type":"boolean","example":true},"product_updates":{"type":"boolean","example":true},"security_emails":{"type":"boolean","example":true}}},"OidcDiscoveryResponse":{"type":"object","description":"OIDC Discovery endpoint\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["issuer","authorization_endpoint","token_endpoint","userinfo_endpoint","jwks_uri","response_types_supported","grant_types_supported","scopes_supported","token_endpoint_auth_methods_supported","subject_types_supported","id_token_signing_alg_values_supported"],"properties":{"authorization_endpoint":{"type":"string"},"grant_types_supported":{"type":"array","items":{}},"id_token_signing_alg_values_supported":{"type":"array","items":{}},"issuer":{"type":"string"},"jwks_uri":{"type":"string"},"response_types_supported":{"type":"array","items":{}},"scopes_supported":{"type":"array","items":{}},"subject_types_supported":{"type":"array","items":{}},"token_endpoint":{"type":"string"},"token_endpoint_auth_methods_supported":{"type":"array","items":{}},"userinfo_endpoint":{"type":"string"}}},"OnboardingProgress":{"type":"object","required":["id","tenant_id","api_key_created","first_request_made","dashboard_visited","billing_configured","tutorial_completed","completion_percentage","created_at","updated_at"],"properties":{"api_key_created":{"type":"boolean","example":true},"billing_configured":{"type":"boolean","example":true},"completion_percentage":{"type":"integer","format":"int32"},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"dashboard_visited":{"type":"boolean","example":true},"first_request_made":{"type":"boolean","example":true},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"tenant_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"tutorial_completed":{"type":"boolean","example":true},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"}}},"OrgLimitItem":{"type":"object","description":"A single organization's effective limits as emitted by the listing handler.","required":["id","name","slug","plan_tier"],"properties":{"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"inference_rpm_limit":{"type":"integer","format":"int32","nullable":true},"monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"name":{"type":"string"},"override_budget_cap_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"override_included_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"override_margin_pct":{"type":"number","format":"double","example":0.95,"nullable":true},"override_rpm_limit":{"type":"integer","format":"int32","nullable":true},"override_tpm_efficient":{"type":"integer","format":"int32","nullable":true},"override_tpm_premium":{"type":"integer","format":"int32","nullable":true},"override_tpm_standard":{"type":"integer","format":"int32","nullable":true},"plan_tier":{"type":"string","description":"Canonical plan tier (e.g. `free`, `pro`), normalized from `plan_tier`."},"slug":{"type":"string"}}},"OrgMembershipResponse":{"type":"object","required":["id","name","slug","planTier","role","isActive"],"properties":{"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"isActive":{"type":"boolean","example":true},"name":{"type":"string","example":"Acme Corporation"},"planTier":{"type":"string","example":"pro"},"role":{"type":"string"},"slug":{"type":"string"}}},"OrganizationDetail":{"type":"object","required":["id","name","slug","needs_name","created_at","updated_at"],"properties":{"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"needs_name":{"type":"boolean","description":"True when nobody has ever named this organization (E3). While it is\ntrue, inference, voice, API-key creation and invitations return 403\n`organization_name_required`; the rename below is the way out.","example":false},"slug":{"type":"string","description":"The URL-safe identifier. Generated from the name the first time a human\nchooses one and stable forever after.","example":"acme-corporation"},"updated_at":{"type":"string","example":"2026-05-17T18:30:00Z"}}},"OrganizationSettings":{"type":"object","properties":{"cache_enabled":{"type":"boolean","example":true,"nullable":true},"default_model":{"type":"string","nullable":true},"hedging_enabled":{"type":"boolean","example":true,"nullable":true},"speculation_enabled":{"type":"boolean","example":true,"nullable":true},"tier_ceiling":{"type":"integer","format":"int32","nullable":true}}},"OutputConfigResponse":{"type":"object","required":["output_strategy","crane_enabled","cross_model_verify_enabled","pii_categories"],"properties":{"crane_enabled":{"type":"boolean","example":true},"cross_model_verify_enabled":{"type":"boolean","example":true},"output_strategy":{"type":"string"},"pii_categories":{"type":"array","items":{"$ref":"#/components/schemas/KnownPiiCategory"}}}},"OutputContractTierSetting":{"type":"string","description":"Output-guarantee tier for the whole org (#391). Single source of truth for\nthe accepted `output_contract_tier` values so serde rejects unknown variants\nbefore they reach the handler and the OpenAPI schema advertises the enum.","enum":["observe","enforce"]},"OverageToggleRequest":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean","example":true}}},"OverviewResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["days","total_pageviews","unique_visitors","top_pages","pageviews_per_day","top_referrers","browsers","countries","recent_visitors"],"properties":{"browsers":{},"countries":{},"days":{},"pageviews_per_day":{},"recent_visitors":{},"top_pages":{},"top_referrers":{},"total_pageviews":{},"unique_visitors":{}}},"PasskeyInfo":{"type":"object","required":["id","name","created_at","transports"],"properties":{"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"last_used_at":{"type":"string","example":"2026-05-17T18:30:00Z","nullable":true},"name":{"type":"string","example":"Acme Corporation"},"transports":{"type":"array","items":{"type":"string"}}}},"PatternResponse":{"type":"object","required":["category","pattern_count","examples"],"properties":{"category":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"pattern_count":{"type":"integer","example":42,"minimum":0}}},"Permission":{"type":"string","enum":["OrgUpdate","OrgDelete","MembersList","MembersInvite","MembersRemove","MembersChangeRole","BillingRead","BillingManage","ApiKeysCreate","ApiKeysReadAll","ApiKeysRevokeAny","ModelsConfigure","SettingsRead","SettingsUpdate","UsageReadAll","UsageReadOwn","InferenceInvoke","AuditRead","GovernanceManage","MCPRead","MCPWrite"]},"PersonsResponse":{"type":"object","description":"Returns persons.\nAuto-typed response envelope for `persons` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"PlanningConfigResponse":{"type":"object","required":["planning_mode","max_planning_latency_ms","trajectory_collection_enabled"],"properties":{"max_planning_latency_ms":{"type":"integer","format":"int32","example":145,"minimum":0},"planner_model_override":{"type":"string","nullable":true},"planning_mode":{"type":"string"},"trajectory_collection_enabled":{"type":"boolean","example":true}}},"PlatformInvitationsResponse":{"type":"object","required":["invitations"],"properties":{"invitations":{"type":"array","items":{"$ref":"#/components/schemas/platform_admins.PlatformInvitationEntry"}}}},"PlatformMembersResponse":{"type":"object","required":["members"],"properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/platform_admins.PlatformAdminEntry"}}}},"PolicyComplianceStats":{"type":"object","required":["total_filtered","by_reason","timeseries"],"properties":{"by_reason":{"type":"array","items":{"$ref":"#/components/schemas/ReasonCount"}},"timeseries":{"type":"array","items":{"$ref":"#/components/schemas/PolicyTimeseriesBucket"}},"total_filtered":{"type":"integer","format":"int64","minimum":0}}},"PolicyResponse":{"type":"object","required":["id","name","policy_type","effect","resource","action","conditions","is_enabled","created_at"],"properties":{"action":{},"conditions":{},"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"effect":{"type":"string"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"is_enabled":{"type":"boolean","example":true},"name":{"type":"string","example":"Acme Corporation"},"policy_type":{"type":"string"},"resource":{}}},"PortalResponse":{"type":"object","required":["url"],"properties":{"url":{"type":"string","example":"https://api.xantly.com"}}},"PostGatewayReloadResponse":{"type":"object","description":"POST /v1/admin/gateway/reload\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["reload_id","status"],"properties":{"reload_id":{},"status":{"type":"string","example":"active"}}},"PostProtocolTestResponse":{"type":"object","description":"POST /v1/admin/protocols/test\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["validation"],"properties":{"validation":{}}},"PostRateLimitOverrideResponse":{"type":"object","description":"POST /v1/admin/rate-limits/{tenant_id}/override\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["override_id","tenant_id"],"properties":{"override_id":{},"tenant_id":{}}},"PreferenceDialRequest":{"type":"object","required":["tenant_id","value"],"properties":{"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"value":{"type":"number","format":"double","example":0.7}}},"PreferenceDialResponse":{"type":"object","required":["tenant_id","value","updated_at","updated_by"],"properties":{"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"updated_by":{"type":"string","example":"alice@acme.io"},"value":{"type":"number","format":"float","example":0.7}}},"PreferenceDialUpdateResponse":{"type":"object","required":["tenant_id","previous_value","new_value","effective_at","estimated_impact"],"properties":{"effective_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"estimated_impact":{"$ref":"#/components/schemas/EstimatedImpact"},"new_value":{"type":"number","format":"float","example":0.7},"previous_value":{"type":"number","format":"float","example":0.5},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"PreviewPolicyResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["vendor_cost_usd","customer_charge_usd","gross_margin_usd","gross_margin_pct"],"properties":{"customer_charge_usd":{},"gross_margin_pct":{},"gross_margin_usd":{},"vendor_cost_usd":{}}},"PricingEstimateRequest":{"type":"object","required":["messages"],"properties":{"messages":{},"model":{"type":"string","example":"bedrock/nova-pro/us-east-1","nullable":true},"tools":{"nullable":true}}},"PricingEstimateResponse":{"type":"object","required":["estimated_input_tokens","estimated_output_tokens","estimated_cost_usd","provider_cost_usd","customer_charge_usd","tier","model","selected_model","would_exceed_budget"],"properties":{"budget_remaining_usd":{"type":"number","format":"double","description":"Remaining monthly budget in USD. `null` means unbounded / no cap\nconfigured. `0.0` means caller is at the cap.","example":0.42,"nullable":true},"customer_charge_usd":{"type":"number","format":"double","example":0.42},"estimated_cost_usd":{"type":"number","format":"double","example":0.42},"estimated_input_tokens":{"type":"integer","format":"int32","minimum":0},"estimated_output_tokens":{"type":"integer","format":"int32","minimum":0},"model":{"type":"string","example":"bedrock/nova-pro/us-east-1"},"provider_cost_usd":{"type":"number","format":"double","example":0.42},"selected_model":{"type":"string"},"tier":{"type":"string","example":"pro"},"would_exceed_budget":{"type":"boolean","example":true}}},"ProbeProviderResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["provider_id","probe_url","healthy"],"properties":{"healthy":{},"probe_url":{},"provider_id":{}}},"ProductMetricsResponse":{"type":"object","required":["total_users","verified_users","unverified_users","signups_last_7d","signups_last_30d","users_by_plan","orgs_total","orgs_by_plan","paid_user_percentage","signups_per_day"],"properties":{"orgs_by_plan":{"type":"object","description":"Organization counts keyed by canonical plan tier.\nNote: a NULL `plan_tier` in the database is coerced into the `\"free\"`\nbucket, so this map cannot distinguish 'no plan set' from 'free plan'.","additionalProperties":{"type":"integer","format":"int64"}},"orgs_total":{"type":"integer","format":"int64","example":42},"paid_user_percentage":{"type":"number","format":"double"},"signups_last_30d":{"type":"integer","format":"int64"},"signups_last_7d":{"type":"integer","format":"int64"},"signups_per_day":{"type":"array","items":{"$ref":"#/components/schemas/SignupDay"}},"total_users":{"type":"integer","format":"int64"},"unverified_users":{"type":"integer","format":"int64"},"users_by_plan":{"type":"object","description":"User counts keyed by canonical plan tier.\nNote: a NULL `plan_tier` in the database is coerced into the `\"free\"`\nbucket, so this map cannot distinguish 'no plan set' from 'free plan'.","additionalProperties":{"type":"integer","format":"int64"}},"verified_users":{"type":"integer","format":"int64"}}},"Project":{"type":"object","required":["id","tenant_id","name","environment","is_active","created_at"],"properties":{"budget_limit_usd":{"type":"string","example":0.42,"nullable":true},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"environment":{"type":"string"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"is_active":{"type":"boolean","example":true},"name":{"type":"string","example":"Acme Corporation"},"tenant_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"ProjectApiKey":{"type":"object","required":["id","project_id","key_prefix","is_active","created_at"],"properties":{"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"is_active":{"type":"boolean","example":true},"key_prefix":{"type":"string"},"project_id":{"type":"string","format":"uuid","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479"}}},"ProjectUsage":{"type":"object","description":"GET /projects/{id}/usage - Get project-specific usage stats","required":["project_id","total_requests","total_cost"],"properties":{"budget_remaining":{"type":"string","example":"30.00","nullable":true},"project_id":{"type":"string","format":"uuid","example":"f47ac10b-58cc-4372-a567-0e02b2c3d479"},"total_cost":{"type":"string","example":"12.34"},"total_requests":{"type":"integer","format":"int64","example":15000}}},"PromptResponse":{"type":"object","required":["id","name","latest_version","updated_at"],"properties":{"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"latest_version":{"type":"string"},"name":{"type":"string","example":"Acme Corporation"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"}}},"ProtectedResourceMetadata":{"type":"object","description":"OAuth 2.0 Protected Resource Metadata, RFC 9728.","required":["resource","authorization_servers","scopes_supported","bearer_methods_supported","resource_documentation","resource_policy_uri"],"properties":{"authorization_servers":{"type":"array","items":{"type":"string"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"resource":{"type":"string"},"resource_documentation":{"type":"string"},"resource_policy_uri":{"type":"string"},"scopes_supported":{"type":"array","items":{"type":"string"}}}},"ProviderHealth":{"type":"object","required":["provider_name","model_name","tier","is_active"],"properties":{"avg_latency_ms":{"type":"number","format":"double","example":145,"nullable":true},"error_rate":{"type":"number","format":"double","example":0.95,"nullable":true},"is_active":{"type":"boolean","example":true},"model_name":{"type":"string","example":"acme"},"provider_name":{"type":"string","example":"acme"},"tier":{"type":"integer","format":"int32","example":2},"total_cost_24h":{"type":"string","nullable":true},"total_requests_24h":{"type":"integer","format":"int64","nullable":true}}},"ProviderResponse":{"type":"object","required":["id","provider","created_at"],"properties":{"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"provider":{"type":"string","example":"openai"}}},"PutEdgeGeoResponse":{"type":"object","description":"PUT /v1/admin/edge/geo\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"active"}}},"PutEdgeWafResponse":{"type":"object","description":"PUT /v1/admin/edge/waf\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"active"}}},"PutGatewayConfigResponse":{"type":"object","description":"PUT /v1/admin/gateway/config\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"active"}}},"PutMaskingConfigResponse":{"type":"object","description":"PUT /v1/context/masking-config/{tool_name}\nUpdates masking config.\nAuto-typed response envelope for `put_masking_config` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["error"],"properties":{"error":{}}},"PutProtocolResponse":{"type":"object","description":"PUT /v1/admin/protocols/{protocol_id}\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"active"}}},"RateLimitResponse":{"type":"object","required":["tenant_id","current_config","usage_current_period"],"properties":{"current_config":{"$ref":"#/components/schemas/RateLimitConfig"},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"usage_current_period":{}}},"ReadinessItem":{"type":"object","description":"One thing standing between the customer and a working API key, with the\naction that clears it.","required":["code","message","action"],"properties":{"action":{"type":"string","description":"What the customer should DO about it."},"code":{"type":"string","description":"Stable machine readable identifier, safe to branch on in a UI.","example":"no_models_enabled"},"message":{"type":"string","description":"What is true right now."}}},"ReadinessResponse":{"type":"object","description":"Readiness status response with dependency checks","required":["status","timestamp","dependencies"],"properties":{"dependencies":{"$ref":"#/components/schemas/DependencyStatus"},"latency_ms":{"type":"integer","format":"int64","example":145,"nullable":true,"minimum":0},"status":{"type":"string","example":"ready"},"timestamp":{"type":"string","example":"2026-05-17T18:30:00Z"}}},"RecentRequestsResponse":{"type":"object","required":["read_path","items","has_more"],"properties":{"has_more":{"type":"boolean","example":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/RecentRequestResponse"}},"next_cursor":{"type":"string","nullable":true},"read_path":{"type":"string","example":"/v1/chat/completions"}}},"RecordTestResultResponse":{"type":"object","description":"Response shape for the test-result ingest. Emitted as a typed struct so the\nOpenAPI schema matches the wire format exactly.\nCloses audit P2 be-admin_endpoints-11: `endpoint_id` is a `String`, not a\n`serde_json::Value` — the schema previously advertised the wrong type.","required":["ok","endpoint_id"],"properties":{"endpoint_id":{"type":"string","example":"GET /v1/chat/completions"},"ok":{"type":"boolean","example":true}}},"RecordingsResponse":{"type":"object","description":"Returns recordings.\nAuto-typed response envelope for `recordings` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"RecoveryCancelRequest":{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"The `cancel_token` from the \"recovery requested\" email. Distinct from the\ncompletion token so that forwarding the cancel link to somebody cannot\nhand them the ability to complete the recovery."}}},"RecoveryCompleteRequest":{"type":"object","required":["token","password"],"properties":{"password":{"type":"string","description":"The account password. Required: the emailed token alone must never be\nsufficient to strip an account's second factor."},"token":{"type":"string"}}},"RecoveryCompleteResponse":{"type":"object","required":["status","message"],"properties":{"message":{"type":"string"},"status":{"type":"string","example":"completed"}}},"RecoveryStartRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","example":"alice@acme.io"}}},"RecoveryStartResponse":{"type":"object","required":["status","message"],"properties":{"message":{"type":"string","description":"Human-readable next step, safe to render verbatim."},"status":{"type":"string","description":"Always `\"submitted\"`. Deliberately identical whether or not the address\nbelongs to an account: the response must not confirm that an email is\nregistered.","example":"submitted"}}},"RecoveryStatusResponse":{"type":"object","required":["state"],"properties":{"eligibleAt":{"type":"string","description":"When the cooling-off window ends (RFC 3339). Present for `waiting`/`ready`.","nullable":true},"emailHint":{"type":"string","description":"Masked address the notifications went to, so the user can confirm they\nare watching the right mailbox.","nullable":true},"expiresAt":{"type":"string","description":"When the link stops working (RFC 3339). Present for `waiting`/`ready`.","nullable":true},"state":{"type":"string","description":"`waiting` | `ready` | `expired` | `completed` | `cancelled`","example":"waiting"}}},"RefreshEmbeddingsResponse":{"type":"object","description":"POST /v1/tools/embeddings/refresh - Force refresh of embeddings\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","job_id"],"properties":{"job_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","example":"active"}}},"RegenerateCodesRequest":{"type":"object","required":["password"],"properties":{"password":{"type":"string"}}},"RegisterCompleteRequest":{"type":"object","required":["credential","name"],"properties":{"credential":{"$ref":"#/components/schemas/RegisterPublicKeyCredential"},"name":{"type":"string","description":"User-given name for this passkey (e.g. \"MacBook Pro Touch ID\").","example":"Acme Corporation"}}},"RegisterRequest":{"type":"object","required":["email","password"],"properties":{"display_name":{"type":"string","example":"Alice Chen","nullable":true},"email":{"type":"string","format":"email","example":"alice@acme.io"},"invite_token":{"type":"string","description":"Optional: when present, adds the user to the invited org instead of creating a new one.\nThe invite token is validated, and the user is auto-verified (no OTP required).","example":"xnt_3f2e1a90c4d5b8e2","nullable":true},"organization_name":{"type":"string","description":"Required unless invite_token is present (invited users join an existing org).","example":"acme","nullable":true},"password":{"type":"string"},"platform_invite_token":{"type":"string","description":"Optional: a Xantly control-plane (platform admin) invite token. When\npresent, the new account gets its own singleton org AND the invited\nplatform role, is auto-verified (the emailed invite link is the inbox\nproof — no redundant OTP), and is logged straight in. `organization_name`\nis not required in this mode.","example":"a1b2c3d4e5f6...","nullable":true}}},"RegisterResponse":{"type":"object","description":"Response from `POST /v1/auth/register`.\n\nPolymorphic: on first signup we send a verification OTP and return\n`{verification_required: true, email}` so the SPA can route to the\nOTP confirmation page; on subsequent (already-verified) signups we\nshort-circuit to a full session — captured under `session`.","properties":{"email":{"type":"string","description":"Echo of the email used for signup (handy for the OTP entry page).","example":"alice@acme.io","nullable":true},"session":{"allOf":[{"$ref":"#/components/schemas/BrowserSessionResponse"}],"nullable":true},"verificationRequired":{"type":"boolean","description":"True when the caller needs to confirm the email OTP before logging in.","example":true,"nullable":true}}},"RegisterResponse2":{"type":"object","description":"Register a new user\nAuto-typed response envelope for `register` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["status","email","message"],"properties":{"email":{},"message":{},"status":{}}},"RegisterToolRequest":{"type":"object","required":["tool_name","description","json_schema","risk_level"],"properties":{"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider."},"json_schema":{},"risk_level":{"$ref":"#/components/schemas/ToolRiskLevel"},"tool_name":{"type":"string","example":"acme"}}},"RegisterToolResponse":{"type":"object","required":["message","tool_name"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"tool_name":{"type":"string","example":"acme"}}},"RegisterWebhookRequest":{"type":"object","description":"Request to register a new memory webhook.","required":["url","events"],"properties":{"events":{"type":"array","items":{"type":"string"}},"url":{"type":"string","example":"https://api.xantly.com"}}},"RegisterWebhookResponse":{"type":"object","description":"Response after registering a webhook (includes the secret).","required":["id","url","events","secret","created_at","active"],"properties":{"active":{"type":"boolean","example":true},"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"events":{"type":"array","items":{"type":"string"}},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"secret":{"type":"string"},"url":{"type":"string","example":"https://api.xantly.com"}}},"RegistrySummary":{"type":"object","required":["total","active","deprecated","auth_protected","public","probe_safe","modules","owners","untested","with_callers_scanned","with_callers","orphaned","dashboard_orphaned"],"properties":{"active":{"type":"integer","format":"int64"},"auth_protected":{"type":"integer","format":"int64"},"dashboard_orphaned":{"type":"integer","format":"int64","description":"Orphans restricted to the control-plane surface X-Website is meant to\ndrive, the only ones worth reviewing.  Computed in Rust from `path` so\nno schema/view migration is needed. See `classify_surface`."},"deprecated":{"type":"integer","format":"int64","example":false},"modules":{"type":"integer","format":"int64"},"orphaned":{"type":"integer","format":"int64","description":"Endpoints with zero frontend callers.  NOT a deprecation-candidate\ncount. Most of them are the customer-facing API, which has no reason to\nappear in our own dashboard.  Use `dashboard_orphaned`."},"owners":{"type":"integer","format":"int64"},"probe_safe":{"type":"integer","format":"int64"},"public":{"type":"integer","format":"int64"},"total":{"type":"integer","format":"int64","example":42},"untested":{"type":"integer","format":"int64"},"with_callers":{"type":"integer","format":"int64","description":"Endpoints with at least one frontend caller."},"with_callers_scanned":{"type":"integer","format":"int64","description":"Endpoints whose frontend scanner has produced a non-null caller list."}}},"RegressionGateHistory":{"type":"object","required":["total_runs","passed","failed","recent"],"properties":{"failed":{"type":"integer","format":"int64","minimum":0},"passed":{"type":"integer","format":"int64","example":42,"minimum":0},"recent":{"type":"array","items":{"$ref":"#/components/schemas/GateRunSummary"}},"total_runs":{"type":"integer","format":"int64","minimum":0}}},"ReliabilityConfigUpdate":{"type":"object","required":["reliability_level","max_k_votes","formal_verification_enabled","per_request_budget_usd","self_healing_enabled"],"properties":{"formal_verification_enabled":{"type":"boolean","example":true},"max_k_votes":{"type":"integer","format":"int32","minimum":0},"per_request_budget_usd":{"type":"number","format":"double","example":0.42},"reliability_level":{"type":"string"},"self_healing_enabled":{"type":"boolean","example":true}}},"ReloadCacheResponse":{"type":"object","description":"POST /v1/admin/model-catalog/reload  — force refresh the gateway cache from DB\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","active_models"],"properties":{"active_models":{},"status":{"type":"string","example":"active"}}},"RepairJsonRequest":{"type":"object","required":["broken_json"],"properties":{"broken_json":{"type":"string"}}},"RepairJsonResponse":{"type":"object","required":["success","repaired_json","fixes_applied"],"properties":{"fixes_applied":{"type":"array","items":{"type":"string"}},"repaired_json":{"description":"Opaque, unvalidated JSON. On success this is the parsed input verbatim; on\nparse failure it is `{ \"raw\": <original string> }`. It is echoed back without\nschema validation, so downstream consumers MUST NOT assume any structure.\nInput size is bounded by `MAX_BROKEN_JSON_BYTES` in the handler."},"success":{"type":"boolean","description":"`true` when `broken_json` parsed as valid JSON, `false` on parse failure.\nThe endpoint returns HTTP 200 in both cases, so callers must branch on this\nflag rather than the status code.","example":true}}},"ReplayRunAccepted":{"type":"object","required":["run_id","status"],"properties":{"run_id":{"type":"string","format":"uuid"},"status":{"type":"string","description":"\"completed\" for synchronous dry runs, \"started\" for background runs."},"summary":{"allOf":[{"$ref":"#/components/schemas/ReplayRunSummary"}],"nullable":true}}},"ReplayRunRequest":{"type":"object","properties":{"budget_usd":{"type":"number","format":"double","description":"Optional budget override; clamped to the env budget (can lower it,\nnever raise it).","nullable":true},"dry_run":{"type":"boolean","description":"Plan only: enumerate cells, ROI-gate, list candidates. Zero provider\ncalls, runs synchronously."}}},"ReplayRunSummary":{"type":"object","description":"Outcome of one run, persisted to `replay_runs` and returned to the admin\nroute.","required":["run_id","trigger_source","dry_run","executed","cells_considered","cells_replayed","calls_executed","spend_usd","budget_usd","verdicts"],"properties":{"budget_usd":{"type":"number","format":"double"},"calls_executed":{"type":"integer","minimum":0},"cells_considered":{"type":"integer","minimum":0},"cells_replayed":{"type":"integer","minimum":0},"dry_run":{"type":"boolean"},"executed":{"type":"boolean"},"refusal":{"type":"string","description":"Why the run refused to execute (gates), when it did.","nullable":true},"run_id":{"type":"string","format":"uuid"},"spend_usd":{"type":"number","format":"double"},"trigger_source":{"type":"string"},"verdicts":{"type":"array","items":{"$ref":"#/components/schemas/ReplayVerdict"},"description":"Per (cell, candidate) verdicts: slug, samples, mean grade."}}},"ReplayStatusResponse":{"type":"object","required":["execute_enabled","budget_usd","corpus_rows_7d","corpus_cells_7d","recent_runs"],"properties":{"budget_usd":{"type":"number","format":"double"},"corpus_cells_7d":{"type":"integer","format":"int64","minimum":0},"corpus_rows_7d":{"type":"integer","format":"int64","minimum":0},"execute_enabled":{"type":"boolean"},"recent_runs":{"type":"array","items":{}}}},"ReplayVerdict":{"type":"object","required":["tenant_id","agent_fingerprint","task_family","incumbent_slug","candidate_slug","samples","mean_grade","incumbent_mean_grade"],"properties":{"agent_fingerprint":{"type":"string"},"candidate_slug":{"type":"string"},"incumbent_mean_grade":{"type":"number","format":"float"},"incumbent_slug":{"type":"string"},"mean_grade":{"type":"number","format":"float"},"samples":{"type":"integer","minimum":0},"task_family":{"type":"string"},"tenant_id":{"type":"string"}}},"RequestDiffResponse":{"type":"object","required":["request_a","request_b","differences"],"properties":{"differences":{"type":"array","items":{"$ref":"#/components/schemas/RequestDifference"}},"request_a":{},"request_b":{}}},"RequestDifference":{"type":"object","required":["field","value_a","value_b"],"properties":{"field":{"type":"string","description":"Dotted JSON path into the telemetry document."},"value_a":{},"value_b":{}}},"RequestHistory":{"type":"object","required":["id","timestamp","model","tier","lane","provider","latency_ms","cost_usd","status","healer_applied"],"properties":{"cost_usd":{"type":"number","format":"double"},"healer_applied":{"type":"boolean"},"id":{"type":"string"},"lane":{"type":"string"},"latency_ms":{"type":"integer","format":"int32"},"model":{"type":"string"},"provider":{"type":"string"},"status":{"type":"string"},"tier":{"type":"integer","format":"int32"},"timestamp":{"type":"string"}}},"RequestLogEntry":{"type":"object","description":"One request-log row as returned to the customer.\n\nUSD is a display value derived from the Postgres `numeric` `cost_usd` column\nand may lose precision (see `decimal_to_f64`).","required":["request_id","created_at","model","provider","prompt_tokens","completion_tokens","total_tokens","cost_usd","status","latency_ms","cache_hit"],"properties":{"cache_hit":{"type":"boolean","example":false},"charge_usd":{"type":"number","format":"double","example":0.0042,"nullable":true},"completion_tokens":{"type":"integer","format":"int64","example":800},"cost_usd":{"type":"number","format":"double","example":0.0042},"created_at":{"type":"string","example":"2026-06-01T12:00:00+00:00"},"fee_usd":{"type":"number","format":"double","example":0.0012,"nullable":true},"latency_ms":{"type":"integer","format":"int64","example":145},"model":{"type":"string","example":"bedrock/claude-sonnet-4-6/us-east-1"},"organization_id":{"type":"string","description":"Which organization the row belongs to. Shown only when the caller\nwidened to all organizations; `Option` because the column is nullable.","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"pricing_mode":{"type":"string","example":"list_indexed","nullable":true},"prompt_tokens":{"type":"integer","format":"int64","example":1200},"provider":{"type":"string","example":"anthropic"},"provider_cost_usd":{"type":"number","format":"double","description":"List-Indexed cost breakdown. Nullable: absent on non-priced rows and on\nrequests logged before these columns existed; the UI renders a dash then.","example":0.003,"nullable":true},"request_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","example":"success"},"total_tokens":{"type":"integer","format":"int64","example":2000},"verified_savings_usd":{"type":"number","format":"double","example":0.0008,"nullable":true}}},"RequestLogResponse":{"type":"object","description":"Paginated detailed request log.","required":["requests","has_more"],"properties":{"has_more":{"type":"boolean","example":true},"next_cursor":{"type":"string","description":"Opaque cursor for the next page; `null` on the last page.","nullable":true},"requests":{"type":"array","items":{"$ref":"#/components/schemas/RequestLogEntry"}}}},"RequestTraceResponse":{"type":"object","required":["request_id","timestamp","stages","metadata"],"properties":{"metadata":{"description":"Cost, token, model, provider rollup for the request."},"request_id":{"type":"string","description":"Echo of the request UUID being inspected.","example":"req_3f2e1a90c4d5b8e2"},"stages":{"description":"Full per-stage timeline (auth → routing → provider call → cache → etc)."},"timestamp":{"type":"string","description":"Wall-clock timestamp the request was received (RFC 3339).","example":"2026-05-17T18:30:00Z"},"trace_id":{"type":"string","description":"Trace + span ids when distributed tracing was enabled for this request.","example":"4bf92f3577b34da6a3ce929d0e0e4736","nullable":true}}},"ResendInviteResponse":{"type":"object","description":"POST /v1/organizations/invitations/:id/resend\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","id"],"properties":{"id":{},"status":{"type":"string","example":"resent"}}},"ResendVerificationRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","example":"alice@acme.io"}}},"ResendVerificationResponse":{"type":"object","description":"POST /v1/auth/resend-verification\n\nRate-limited (3 per 10 min per email). Regenerates the OTP and sends a\nfresh verification email. Always returns `{ \"status\": \"sent\" }` to avoid\nemail enumeration.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"active"}}},"ResetBarpWeightsResponse":{"type":"object","required":["tenant_id","message"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"ResetBreakerResponse":{"type":"object","description":"POST /v1/admin/sync/reset-breaker\n\nClears the failure streak by inserting a synthetic sentinel run so the\nnext `run_sync` call is not blocked. Requires admin + an explicit reset\nreason so the action is auditable.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","message"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"status":{"type":"string","example":"active"}}},"ResumePayload":{"type":"object","required":["input_data"],"properties":{"input_data":{}}},"RevokeRequest":{"type":"object","required":["token"],"properties":{"_token_type_hint":{"type":"string","nullable":true},"token":{"type":"string"}}},"RevokeResponse":{"type":"object","description":"Token revocation\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["success"],"properties":{"success":{"type":"boolean","example":true}}},"RotateApiKeyResponse":{"type":"object","description":"POST /v1/api-keys/{key_id}/rotate - Rotate API key\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["old_key","new_key"],"properties":{"new_key":{},"old_key":{}}},"RotateCredentialResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","status"],"properties":{"id":{},"status":{"type":"string","example":"active"}}},"RotateKeyRequest":{"type":"object","description":"Request body for `rotate_api_key`. Rotation copies the existing key's\nconfiguration, so there are no body fields to honour; the struct exists to\nreplace the previously-accepted arbitrary `serde_json::Value` with a closed\nschema. Unknown fields are still ignored (the original handler discarded the\nwhole body), so an empty or `{}` body keeps working; the real DoS mitigation\nis the router-level body-size cap. Closes audit P2 be-api_keys-16."},"RotateKeyResponse":{"type":"object","required":["provider","previous_key_index","new_key_index","rotated_at","rotated_credential_ids"],"properties":{"new_key_index":{"type":"integer","format":"int32"},"previous_key_index":{"type":"integer","format":"int32","description":"Closes audit P2 be-admin_mcp-6: this \"rotation\" resets the\n`is_billing_exhausted` ban on a provider's credentials — it is NOT a\npositional key-ring advance, so there is no meaningful \"from index N\nto index M\" transition to report. Both `previous_key_index` and\n`new_key_index` now carry the *count of credentials reset* (they are\nequal); the field names are retained only for wire-contract stability.\nThe authoritative result is `rotated_credential_ids`."},"provider":{"type":"string","example":"openai"},"rotated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"rotated_credential_ids":{"type":"array","items":{"type":"string","format":"uuid"},"example":"550e8400-e29b-41d4-a716-446655440000"}}},"RoutingDiversityResponse":{"type":"object","description":"Response for the routing diversity panel.","required":["generated_at","window_days","global","tenants"],"properties":{"generated_at":{"type":"integer","format":"int64","example":1747506600},"global":{"$ref":"#/components/schemas/crate.services.barp.diversity.DiversityReport"},"tenants":{"type":"array","items":{"$ref":"#/components/schemas/crate.services.barp.diversity.DiversityReport"},"description":"Per-tenant reports, largest window volume first. Empty when a\n`tenant_id` filter was passed (the `global` field carries it)."},"window_days":{"type":"integer","format":"int32","example":7,"minimum":0}}},"RoutingExperimentRequest":{"type":"object","properties":{"is_active":{"type":"boolean","example":true,"nullable":true},"min_confidence":{"type":"number","format":"double","nullable":true},"name":{"type":"string","example":"cheap-vs-fast-routing-v1","nullable":true},"targets":{"nullable":true},"variants":{"nullable":true}}},"RoutingExplainResponse":{"type":"object","required":["request_id","alternatives","feature_vector_summary","waterfall_path"],"properties":{"alternatives":{"type":"array","items":{"$ref":"#/components/schemas/RoutingAlternative"}},"chosen_model":{"type":"string","nullable":true},"chosen_provider":{"type":"string","nullable":true},"confidence":{"type":"number","format":"double","example":0.92,"nullable":true},"dial_value":{"type":"number","format":"double","nullable":true},"feature_vector_summary":{},"request_id":{"type":"string","example":"req_3f2e1a90c4d5b8e2"},"waterfall_path":{}}},"RoutingIntelligenceOverview":{"type":"object","required":["generated_at","window_days","totals","matrix","policy","shadow","drift","regression_gate","recent_decisions"],"properties":{"drift":{"$ref":"#/components/schemas/DriftFeed"},"generated_at":{"type":"integer","format":"int64","example":1747506600},"matrix":{"$ref":"#/components/schemas/CapabilityMatrixHealth"},"policy":{"$ref":"#/components/schemas/PolicyComplianceStats"},"recent_decisions":{"type":"array","items":{"$ref":"#/components/schemas/DecisionSummary"}},"regression_gate":{"$ref":"#/components/schemas/RegressionGateHistory"},"shadow":{"$ref":"#/components/schemas/ShadowStats"},"totals":{"$ref":"#/components/schemas/OverviewTotals"},"window_days":{"type":"integer","format":"int32","example":28,"minimum":0}}},"RuleDefinition":{"type":"object","required":["id","description","weight","stage"],"properties":{"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider."},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"stage":{"type":"string"},"weight":{"type":"number","format":"double"}}},"RunSyncAcceptedResponse":{"type":"object","description":"Success (202) body for `run_sync`: the projection outcome produced by the\ncatalog sync. Mirrors the handler's `Json(json!({ \"projection\": outcome }))`\nreturn; the runtime type stays `serde_json::Value`.\nCloses audit P2 be-admin_sync-11.","required":["projection"],"properties":{"projection":{}}},"RunSyncResponse":{"type":"object","description":"Error (503) body for `run_sync` when the sync circuit breaker is open.\nMirrors the handler's breaker-open `Json(json!({...}))` return exactly:\nevery field is concretely typed and the examples match the real runtime\nvalues (the threshold is an `i64` count, not a float).\nCloses audit P3 be-admin_sync-10.","required":["error","message","consecutive_failures","threshold"],"properties":{"consecutive_failures":{"type":"integer","format":"int64","example":3},"error":{"type":"string","example":"sync_circuit_breaker_open"},"message":{"type":"string","example":"Sync circuit breaker is open after 3 consecutive failures."},"threshold":{"type":"integer","format":"int64","example":3}}},"SavingsReport":{"type":"object","required":["month","actual_cost","baseline_cost","savings","savings_percentage"],"properties":{"actual_cost":{"type":"string"},"baseline_cost":{"type":"string"},"month":{"type":"string","format":"date"},"savings":{"type":"string"},"savings_percentage":{"type":"string"}}},"SchemaListResponse":{"type":"object","required":["schemas"],"properties":{"schemas":{"type":"array","items":{"$ref":"#/components/schemas/SchemaSummary"}}}},"SchemaResponse":{"type":"object","required":["id","name","version","schema","status","enforcement","auto_heal","hash","usage_count24h","created_at","updated_at"],"properties":{"auto_heal":{"type":"boolean","example":true},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"enforcement":{"type":"string"},"hash":{"type":"string","example":"sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"},"healing_hints":{"nullable":true},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"schema":{},"status":{"type":"string","example":"active"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"usage_count24h":{"type":"integer","format":"int64"},"version":{"type":"string","example":"1.0.0"}}},"SchemaStatsResponse":{"type":"object","required":["schema_id","period","validations","passed","failed","healed","pass_rate","common_errors"],"properties":{"common_errors":{"type":"array","items":{"$ref":"#/components/schemas/CommonError"}},"failed":{"type":"integer","format":"int64"},"healed":{"type":"integer","format":"int64"},"pass_rate":{"type":"number","format":"double","example":0.95},"passed":{"type":"integer","format":"int64","example":true},"period":{"type":"string"},"schema_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"validations":{"type":"integer","format":"int64"}}},"ScorecardSummary":{"type":"object","required":["avg_score","gold","silver","bronze","needs_work","missing_docs","missing_owner","missing_tests"],"properties":{"avg_score":{"type":"integer","format":"int32","example":85},"bronze":{"type":"integer","format":"int64"},"gold":{"type":"integer","format":"int64"},"missing_docs":{"type":"integer","format":"int64"},"missing_owner":{"type":"integer","format":"int64"},"missing_tests":{"type":"integer","format":"int64"},"needs_work":{"type":"integer","format":"int64"},"silver":{"type":"integer","format":"int64"}}},"SearchMemoryRequest":{"type":"object","required":["query"],"properties":{"filters":{"allOf":[{"$ref":"#/components/schemas/SearchFilters"}],"nullable":true},"graph_depth":{"type":"integer","minimum":0},"include_graph":{"type":"boolean","example":true},"limit":{"type":"integer","example":50,"minimum":0},"query":{"type":"string","minLength":1},"threshold":{"type":"number","format":"float","example":0.85}}},"SearchMemoryResponse":{"type":"object","required":["results","total_found","search_latency_ms"],"properties":{"graph_context":{"allOf":[{"$ref":"#/components/schemas/GraphContext"}],"nullable":true},"results":{"type":"array","items":{"$ref":"#/components/schemas/MemorySearchResult"}},"search_latency_ms":{"type":"integer","format":"int64","example":145,"minimum":0},"total_found":{"type":"integer","format":"int64","minimum":0}}},"SecretRotationRequest":{"type":"object","required":["grace_period_hours"],"properties":{"grace_period_hours":{"type":"integer","format":"int32"}}},"SecretRotationResponse":{"type":"object","required":["old_secret_expires_at","new_secret"],"properties":{"new_secret":{"type":"string","description":"Newly-minted secret — caller must store this securely; never re-derivable."},"old_secret_expires_at":{"type":"string","description":"ISO-8601 timestamp when the *previous* secret stops being accepted.","example":"2026-05-17T18:30:00Z"}}},"SeedSuffixRequest":{"type":"object","required":["patterns"],"properties":{"patterns":{"type":"array","items":{"type":"string"}}}},"SeedSuffixResponse":{"type":"object","required":["seeded_count","status"],"properties":{"seeded_count":{"type":"integer","example":42,"minimum":0},"status":{"type":"string","example":"patterns_seeded"}}},"SessionOrganization":{"type":"object","description":"The organization half of the session contract.","required":["id","name","slug","needsName","planTier"],"properties":{"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"needsName":{"type":"boolean","description":"True when nobody has ever chosen this organization's name, so `name` is\nthe placeholder. While it is true the write surfaces (inference, voice,\nAPI-key creation, invitations) return 403 `organization_name_required`\nand the only way forward is the rename. Read from\n`organizations.name_confirmed_at`, never from the name text.","example":false},"planTier":{"type":"string","example":"free"},"slug":{"type":"string","example":"acme-corporation-550e8400"}}},"SessionPlatform":{"type":"object","description":"The control-plane half of the session contract.","required":["isAdmin","eligible"],"properties":{"eligible":{"type":"boolean","description":"The caller's address is on the platform-admin list. Eligible without\n`is_admin` is the \"you must finish enrolling\" state.","example":false},"isAdmin":{"type":"boolean","description":"The caller currently HAS platform-admin access (eligible, and every\ncondition on it satisfied).","example":false},"role":{"type":"string","description":"The platform role, present only when `is_admin`.","example":"admin","nullable":true}}},"SessionResponse":{"type":"object","required":["id","device","ip_address","location","last_active","is_current"],"properties":{"device":{"type":"string"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"ip_address":{"type":"string","example":"203.0.113.42"},"is_current":{"type":"boolean","example":true},"last_active":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"location":{"type":"string","description":"Human-readable geolocation derived from `ip_address`. No GeoIP provider\nis wired yet, so this is currently emitted as an empty string rather than\nfabricated placeholder text. Treat as best-effort/optional on the FE until\na GeoIP lookup is added; the field is retained to avoid a breaking schema\nchange for existing consumers.","deprecated":true}}},"SetAllocationRequest":{"type":"object","properties":{"byok_allocation_pct":{"type":"integer","format":"int32","description":"Percentage of requests routed to the tenant's BYOK key (0–100).","example":95,"nullable":true},"monthly_spend_limit_usd":{"type":"number","format":"double","description":"Optional monthly spend cap in USD for BYOK keys.\n`null` clears any existing cap.","example":0.42,"nullable":true}}},"SetPasswordRequest":{"type":"object","required":["new_password"],"properties":{"current_password":{"type":"string","description":"Current password (required if user already has a real password)","nullable":true},"new_password":{"type":"string","maxLength":128,"minLength":8}}},"SettingsResponse":{"type":"object","required":["smart_routing_enabled","semantic_caching_enabled","semantic_cache_mode","semantic_assist_threshold","semantic_verbatim_threshold","cache_ttl_seconds","cache_conversation_cutoff","output_contract_tier"],"properties":{"cache_conversation_cutoff":{"type":"integer","format":"int32","example":4},"cache_ttl_seconds":{"type":"integer","format":"int32","example":300},"default_intelligence_mode":{"type":"string","description":"Intelligence layer preset: \"proxy\", \"cache\", or \"full\". Null = system default.","nullable":true},"inferred_contract_action":{"type":"string","description":"Posture for an inferred (prose-stated) output contract (#518):\n\"off\", \"observe\", \"normalize\", \"repair\" or \"enforce\". Null means the\norg has expressed no preference and the system default applies.","nullable":true},"output_contract_tier":{"type":"string","description":"Output-guarantee tier: \"observe\" or \"enforce\" (#391)."},"regen_model":{"type":"string","description":"Economy regeneration model override for semantic-assist. Null = use the\ncaller's requested model.","nullable":true},"semantic_assist_threshold":{"type":"number","format":"double","example":0.8},"semantic_cache_mode":{"type":"string","description":"Semantic-tier serving mode: \"off\", \"assist\", or \"verbatim\"."},"semantic_caching_enabled":{"type":"boolean","example":true},"semantic_verbatim_threshold":{"type":"number","format":"double","example":0.95},"smart_routing_enabled":{"type":"boolean","example":true}}},"ShadowStats":{"type":"object","required":["total_comparisons","winner_primary","winner_shadow","winner_tie","per_model_pass_rate","recent"],"properties":{"per_model_pass_rate":{"type":"array","items":{"$ref":"#/components/schemas/ModelPassRate"}},"recent":{"type":"array","items":{"$ref":"#/components/schemas/ShadowRow"}},"total_comparisons":{"type":"integer","format":"int64","minimum":0},"winner_primary":{"type":"integer","format":"int64","minimum":0},"winner_shadow":{"type":"integer","format":"int64","minimum":0},"winner_tie":{"type":"integer","format":"int64","minimum":0}}},"ShareWorkflowResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["template_id"],"properties":{"template_id":{}}},"SimpleSuccessResponse":{"type":"object","description":"Response from `POST /v1/auth/set-password` and similar simple actions.","required":["success"],"properties":{"success":{"type":"boolean","example":true}}},"SimulateChainResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["plan"],"properties":{"plan":{}}},"SimulatePlanRequest":{"type":"object","required":["objective"],"properties":{"available_tools":{"type":"array","items":{"type":"string"},"nullable":true},"objective":{"type":"string","example":"summarize last quarter's sales calls"}}},"SloOverrideRequest":{"type":"object","description":"Body for `PUT /v1/admin/endpoints/{id}/slo` — overrides the default\n99.5% / 28-day SLO target for a single endpoint.","required":["target_pct","window_days"],"properties":{"notes":{"type":"string","description":"Optional free-text note shown on the detail page.","nullable":true},"target_pct":{"type":"number","format":"double","description":"Availability target as a fraction (0.0 - 1.0).  Validated server-side\nto be in (0.5, 1.0); values outside that range are rejected so\ncallers don't accidentally set a 0% or > 100% goal.","example":0.995},"window_days":{"type":"integer","format":"int32","description":"Rolling window length in days.  Bounded to [1, 90].","example":28}}},"SloRequest":{"type":"object","required":["name","target","window","type"],"properties":{"name":{"type":"string","example":"Acme Corporation"},"target":{"type":"number","format":"double"},"type":{"type":"string"},"window":{"type":"string"}}},"SloResponse":{"type":"object","required":["id","organization_id","name","target","window","type","created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"organization_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"target":{"type":"number","format":"double","description":"Target as a fraction (e.g. 0.995 for 99.5%)."},"type":{"type":"string","description":"SLO kind: `availability` | `latency` | `freshness` | `correctness`."},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"window":{"type":"string","description":"Window descriptor (e.g. `\"28d\"`)."}}},"SloStatus":{"type":"object","required":["target_pct","window_days","total_requests","total_errors","observed_pct","remaining_budget_pct","burn_rate_1h","burn_rate_6h","status"],"properties":{"burn_rate_1h":{"type":"number","format":"double","description":"1-hour burn rate (multiple of the long-window error rate).","example":0.32},"burn_rate_6h":{"type":"number","format":"double","description":"6-hour burn rate.","example":0.18},"observed_pct":{"type":"number","format":"double","description":"Observed availability as a fraction.","example":0.998},"remaining_budget_pct":{"type":"number","format":"double","description":"Remaining error budget as a fraction (negative = budget exhausted).","example":0.62},"status":{"type":"string","description":"Traffic-light: `ok` | `warn` | `critical`.","example":"ok"},"target_pct":{"type":"number","format":"double","description":"SLO target as a fraction (0.0 - 1.0).  Default 0.995 (99.5%).","example":0.995},"total_errors":{"type":"integer","format":"int64","description":"Failed (5xx) requests in the window.","example":12},"total_requests":{"type":"integer","format":"int64","description":"Total requests in the window.","example":15000},"window_days":{"type":"integer","format":"int32","description":"Window length in days (default 28).","example":28}}},"SocialLoginRedirectResponse":{"type":"object","description":"Response from `GET/POST /v1/auth/social/{provider}/authorize`.","required":["provider","authorizeUrl","state"],"properties":{"authorizeUrl":{"type":"string","description":"URL the SPA should redirect the browser to.","example":"https://api.xantly.com"},"provider":{"type":"string","description":"Provider name: `google` | `github`.","example":"openai"},"state":{"type":"string","description":"Opaque state value to verify on callback (CSRF)."}}},"SocialLoginStartRequest":{"type":"object","required":["dpop_jwk","code_verifier"],"properties":{"code_verifier":{"type":"string"},"dpop_jwk":{"type":"string"},"invite_token":{"type":"string","description":"A member invitation token, when the user arrived from an invite link and\nchose \"Continue with Google\" instead of setting a password.\n\nWithout this the social path always provisioned a NEW organization, so\nan invited user who used the social button silently ended up alone in\ntheir own org instead of joining the one that invited them, and the\ninvitation stayed pending.","nullable":true}}},"SocialLoginStartResponse":{"type":"object","required":["authorize_url"],"properties":{"authorize_url":{"type":"string","example":"https://api.xantly.com"}}},"SpeculationConfigUpdate":{"type":"object","properties":{"max_draft_tokens":{"type":"integer","format":"int32","nullable":true,"minimum":0},"min_confidence":{"type":"number","format":"float","nullable":true},"mode":{"type":"string","nullable":true}}},"SpeculationStats":{"type":"object","required":["acceptance_rate","success_rate","total_attempts","total_speculated_tokens","total_accepted_tokens","ttft_improvement_ms","histograms","draft_breaker_open","suffix_breaker_open"],"properties":{"acceptance_rate":{"type":"number","format":"double","example":0.95},"draft_breaker_open":{"type":"boolean","example":true},"histograms":{"$ref":"#/components/schemas/Histograms"},"success_rate":{"type":"number","format":"double","example":0.995},"suffix_breaker_open":{"type":"boolean","example":true},"total_accepted_tokens":{"type":"integer","format":"int64","minimum":0},"total_attempts":{"type":"integer","format":"int64","minimum":0},"total_speculated_tokens":{"type":"integer","format":"int64","minimum":0},"ttft_improvement_ms":{"type":"number","format":"double","example":145}}},"StoreMemoryRequest":{"type":"object","required":["content","type"],"properties":{"content":{"type":"string","maxLength":10000,"minLength":1},"entities":{"type":"array","items":{"$ref":"#/components/schemas/EntityInput"},"nullable":true},"metadata":{"allOf":[{"$ref":"#/components/schemas/MemoryMetadata"}],"nullable":true},"relationships":{"type":"array","items":{"$ref":"#/components/schemas/RelationshipInput"},"nullable":true},"ttl_days":{"type":"integer","format":"int32","nullable":true,"minimum":0},"type":{"$ref":"#/components/schemas/MemoryType"}}},"StoreMemoryResponse":{"type":"object","required":["memory_id","embedding_id","entities_created","relationships_created"],"properties":{"embedding_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"entities_created":{"type":"integer","minimum":0},"memory_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"relationships_created":{"type":"integer","minimum":0}}},"StripeHealthResponse":{"type":"object","description":"GET /v1/admin/billing/stripe-health\nControl-plane admin only. Pings Stripe with the configured API key and\nreports which env vars are set. Surfaces the exact error on failure so\nmisconfiguration is obvious.","required":["ok","api_key_configured","webhook_secret_configured","pro_price_configured","scale_price_configured","voice_metered_price_configured","voice_meter_event_configured","products_reachable","webhook_endpoint_hint"],"properties":{"api_key_configured":{"type":"boolean","example":true},"error":{"type":"string","nullable":true},"mode":{"type":"string","nullable":true},"ok":{"type":"boolean","example":true},"pro_price_configured":{"type":"boolean","example":true},"products_reachable":{"type":"boolean","example":true},"scale_price_configured":{"type":"boolean","example":true},"voice_meter_event_configured":{"type":"boolean","example":true},"voice_metered_price_configured":{"type":"boolean","example":true},"webhook_endpoint_hint":{"type":"string"},"webhook_secret_configured":{"type":"boolean","example":true}}},"SubmitFeedbackResponse":{"type":"object","description":"Submit routing feedback\nAuto-typed response envelope for `submit_feedback` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["status"],"properties":{"status":{}}},"SudoRequest":{"type":"object","properties":{"mfa_code":{"type":"string","description":"TOTP code (if MFA is enabled)","nullable":true},"password":{"type":"string","description":"Password for re-authentication (mutually exclusive with mfa_code for social-only users)","nullable":true}}},"SudoStatusResponse":{"type":"object","description":"Check the current sudo/elevation status of the session.\nReturns whether the session is elevated and how long until it expires.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["elevated","aal","remaining_seconds","mfa_enabled","is_social_user","required_factor"],"properties":{"aal":{},"elevated":{},"is_social_user":{},"mfa_enabled":{},"remaining_seconds":{},"required_factor":{"description":"What `POST /v1/auth/sudo` will actually demand from this account, from\nthe same resolver the elevation endpoint uses. One of `\"password\"`,\n`\"totp\"`, `\"passkey\"`, `\"session\"` (social account, the live session is\nthe proof) or `\"unavailable\"` (the factor lookup failed; retry).\n\nAdded because `mfa_enabled` was never enough to render the dialog: it is\nfalse for an account whose second factor is being asked for anyway\n(#472) and true for a passkey account that must not be shown a code\nfield at all. A client that guesses gets a form the gateway will refuse."}}},"SuffixPatternResponse":{"type":"object","required":["pattern","frequency","acceptance_rate"],"properties":{"acceptance_rate":{"type":"number","format":"float","example":0.95},"frequency":{"type":"integer","format":"int32","minimum":0},"pattern":{"type":"string"}}},"SwitchOrgRequest":{"type":"object","required":["organization_id"],"properties":{"organization_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"SyncReport":{"type":"object","description":"Outcome of a sync pass.","required":["total_in_manifest","newly_added","newly_deprecated","touched","started_at","finished_at","newly_added_ids","newly_deprecated_ids"],"properties":{"finished_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"newly_added":{"type":"integer","minimum":0},"newly_added_ids":{"type":"array","items":{"type":"string"},"description":"Endpoint ids inserted on this sync pass — surfaced so callers (CI,\nadmin UI) can post a GitHub Issue / PR comment listing them."},"newly_deprecated":{"type":"integer","minimum":0},"newly_deprecated_ids":{"type":"array","items":{"type":"string"},"description":"Endpoint ids auto-deprecated on this sync pass (vanished from\nmanifest)."},"started_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"total_in_manifest":{"type":"integer","minimum":0},"touched":{"type":"integer","minimum":0}}},"SyncStatusResponse":{"type":"object","description":"Sync status.\nAuto-typed response envelope for `sync_status` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["projection","sync_guard","latest_run"],"properties":{"latest_run":{},"projection":{},"sync_guard":{}}},"SynthesizeRequest":{"type":"object","required":["text"],"properties":{"model":{"type":"string","description":"TTS model slug override, e.g. \"deepgram/aura-2\".\nNOT a chat catalog slug: Bedrock has no TTS equivalent, so the voice\nsurface is a separate decision from platform admission (see\ndocs/PLATFORM_ADMISSION.md).","example":"deepgram/aura-2","nullable":true},"output_format":{"type":"string","nullable":true},"provider":{"type":"string","example":"openai","nullable":true},"text":{"type":"string"},"voice":{"type":"string","nullable":true}}},"TeamMemberResponse":{"type":"object","required":["id","email","displayName","role","status","joinedAt"],"properties":{"displayName":{"type":"string","example":"Alice Chen"},"email":{"type":"string","example":"alice@acme.io"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"joinedAt":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"role":{"type":"string","description":"Resolved from organization_memberships.role (falls back to users.role)"},"status":{"type":"string","example":"active"}}},"TelemetryConfig":{"type":"object","required":["enabled","sampling_ratio"],"properties":{"enabled":{"type":"boolean","example":true},"sampling_ratio":{"type":"number","format":"double"}}},"TelemetryQueryBody":{"type":"object","properties":{"filters":{"type":"object","description":"Equality filters, `field -> value`, exactly as the Admin Portal sends\nthem. Field names come from the closed whitelist above.","additionalProperties":{}},"limit":{"type":"integer","format":"int64","example":100,"nullable":true},"sql":{"type":"string","description":"Ignored. The frontend may send it; there is no raw-SQL path and there\nwill not be one.","nullable":true}}},"TelemetryQueryResponse":{"type":"object","required":["columns","rows","execution_time_ms","row_count"],"properties":{"columns":{"type":"array","items":{"type":"string"}},"execution_time_ms":{"type":"integer","format":"int64","minimum":0},"row_count":{"type":"integer","minimum":0},"rows":{"type":"array","items":{}}}},"TenantBarpStatus":{"type":"object","required":["tenant_id","update_count","convergence_metric","exploration_ratio","total_reward_sum","last_weight_delta_norm","last_updated","model_count"],"properties":{"convergence_metric":{"type":"number","format":"float"},"exploration_ratio":{"type":"number","format":"float"},"last_updated":{"type":"string","example":"2026-05-17T18:30:00Z"},"last_weight_delta_norm":{"type":"number","format":"float"},"model_count":{"type":"integer","example":42,"minimum":0},"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"total_reward_sum":{"type":"number","format":"double"},"update_count":{"type":"integer","format":"int64","example":42,"minimum":0}}},"TenantUsageStats":{"type":"object","required":["tenant_id","total_cost_usd","total_requests","total_tokens"],"properties":{"tenant_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"total_cost_usd":{"type":"number","format":"double","example":12.45},"total_requests":{"type":"integer","format":"int64","example":15000,"minimum":0},"total_tokens":{"type":"integer","format":"int64","minimum":0}}},"TestBudgetAlertRequest":{"type":"object","properties":{"budget_type":{"type":"string","nullable":true},"limit_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"used_usd":{"type":"number","format":"double","example":0.42,"nullable":true}}},"TestBudgetAlertResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","organization_id","budget_type","used_usd","limit_usd","webhook_configured"],"properties":{"budget_type":{},"limit_usd":{},"organization_id":{},"status":{"type":"string","example":"active"},"used_usd":{},"webhook_configured":{}}},"TestCredentialResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","healthy","verified","status"],"properties":{"healthy":{"description":"True when a secret/env/kms reference is configured. This is a\nconfiguration check only — no upstream provider call is made."},"id":{},"status":{"description":"\"unknown\" (configured, unverified) or \"down\" (no secret configured)."},"verified":{"description":"Always false: this endpoint does not verify the key upstream."}}},"TestHealingRequest":{"type":"object","required":["input"],"properties":{"input":{"type":"string"},"stages_to_run":{"type":"array","items":{"type":"string"},"nullable":true},"verbose":{"type":"boolean","example":true}}},"TestHealingResponse":{"type":"object","required":["input","output","valid","stages_applied","total_duration_ms"],"properties":{"input":{"type":"string"},"output":{"type":"string"},"stages_applied":{"type":"array","items":{"$ref":"#/components/schemas/StageResult"}},"total_duration_ms":{"type":"number","format":"double","example":145},"valid":{"type":"boolean","example":true}}},"TestResultPayload":{"type":"object","required":["test_kind","test_file","passed"],"properties":{"commit_sha":{"type":"string","nullable":true},"coverage_pct":{"type":"number","format":"float","example":0.95,"nullable":true},"duration_ms":{"type":"integer","format":"int32","example":145,"nullable":true},"failure_message":{"type":"string","nullable":true},"passed":{"type":"boolean","example":true},"test_file":{"type":"string"},"test_kind":{"type":"string"}}},"TestTransformResponse":{"type":"object","required":["input","output","duration_ms"],"properties":{"duration_ms":{"type":"number","format":"double","example":145},"input":{},"output":{}}},"TestWebhookResponse":{"type":"object","description":"Result of firing a sample event at a webhook endpoint via the test button.","required":["delivered","message"],"properties":{"delivered":{"type":"boolean","description":"True when the endpoint accepted the delivery with a 2xx response.","example":true},"message":{"type":"string","description":"Human-readable outcome (connection error text on failure).","example":"delivered"},"status_code":{"type":"integer","format":"int32","description":"HTTP status the endpoint returned, if a response was received at all.","example":200,"nullable":true,"minimum":0}}},"TierDistribution":{"type":"object","required":["tier","request_count","total_cost"],"properties":{"avg_latency_ms":{"type":"number","format":"double","example":145,"nullable":true},"request_count":{"type":"integer","format":"int64","example":15000},"success_rate":{"type":"number","format":"double","example":0.995,"nullable":true},"tier":{"type":"integer","format":"int32","example":1},"total_cost":{"type":"string"}}},"TimeseriesPoint":{"type":"object","required":["timestamp"],"properties":{"group":{"type":"string","nullable":true},"timestamp":{"type":"string"},"value":{"type":"number","format":"double","nullable":true}}},"TimeseriesResponse":{"type":"object","required":["metric","resolution","points"],"properties":{"metric":{"type":"string"},"points":{"type":"array","items":{"$ref":"#/components/schemas/TimeseriesPoint"}},"resolution":{"type":"string"}}},"ToggleFlagResponse":{"type":"object","description":"Returns toggle flag.\nAuto-typed response envelope for `toggle_flag` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["flag","enabled","updated_at"],"properties":{"enabled":{},"flag":{},"updated_at":{}}},"ToggleOverageResponse":{"type":"object","description":"PATCH /v1/billing/overage — Toggle overage for Pro plan.\n\nRequires Stripe payment method on file when enabling.\nAny org member with billing scope can toggle.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["overage_enabled","overage_hard_cap_usd"],"properties":{"overage_enabled":{},"overage_hard_cap_usd":{}}},"TokenExchangeRequest":{"type":"object","required":["grant_type"],"properties":{"_code":{"type":"string","nullable":true},"_code_verifier":{"type":"string","nullable":true},"_redirect_uri":{"type":"string","nullable":true},"client_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"client_secret":{"type":"string","nullable":true},"grant_type":{"type":"string"},"refresh_token":{"type":"string","example":"xnt_3f2e1a90c4d5b8e2","nullable":true}}},"TokenExchangeResponse":{"type":"object","required":["access_token","token_type","expires_in"],"properties":{"access_token":{"type":"string","example":"xnt_3f2e1a90c4d5b8e2"},"expires_in":{"type":"integer","format":"int64"},"refresh_token":{"type":"string","example":"xnt_3f2e1a90c4d5b8e2","nullable":true},"scope":{"type":"string","nullable":true},"token_type":{"type":"string"}}},"TokenizeResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["tokens","token_ids"],"properties":{"token_ids":{},"tokens":{"type":"integer","format":"int64"}}},"ToolCallRequest":{"type":"object","required":["server_url","tool_name","arguments"],"properties":{"arguments":{},"server_url":{"type":"string","example":"https://api.xantly.com"},"tool_name":{"type":"string","example":"acme"}}},"ToolCallResponse":{"type":"object","required":["success","latency_ms"],"properties":{"error":{"type":"string","nullable":true},"latency_ms":{"type":"integer","format":"int64","example":145,"minimum":0},"result":{"nullable":true},"success":{"type":"boolean","example":true}}},"ToolDetail":{"type":"object","required":["id","bridge_id","name","parameters","returns","security","created_at","updated_at"],"properties":{"bridge_id":{"type":"string","example":"br_3f2e1a90"},"category":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"examples":{"nullable":true},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"parameters":{},"returns":{},"security":{},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"}}},"ToolRegistration":{"type":"object","required":["name","parameters","returns","security"],"properties":{"category":{"type":"string","nullable":true},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"examples":{"type":"array","items":{"$ref":"#/components/schemas/ToolExample"},"nullable":true},"name":{"type":"string","example":"Acme Corporation"},"parameters":{},"returns":{},"security":{"$ref":"#/components/schemas/ToolSecurity"}}},"ToolSearchQuery":{"type":"object","required":["q"],"properties":{"limit":{"type":"integer","description":"Maximum number of items to return.\nDefaults to `5`.","example":50,"nullable":true,"minimum":0},"q":{"type":"string","description":"Free-text search query."}}},"ToolSearchResult":{"type":"object","required":["tools","query","reranked","latency_ms"],"properties":{"latency_ms":{"type":"integer","format":"int64","example":145,"minimum":0},"query":{"type":"string"},"reranked":{"type":"boolean","example":true},"tools":{"type":"array","items":{"$ref":"#/components/schemas/McpTool"}}}},"ToolStatsResponse":{"type":"object","required":["tool_id","invocations_total","invocations_24h","success_rate_pct","avg_duration_ms","p95_duration_ms"],"properties":{"avg_duration_ms":{"type":"number","format":"double","example":145},"invocations_24h":{"type":"integer","format":"int64"},"invocations_total":{"type":"integer","format":"int64","example":42},"p95_duration_ms":{"type":"number","format":"double","example":145},"success_rate_pct":{"type":"number","format":"double","example":99.5},"tool_id":{"type":"string","example":"tool_3f2e1a90"}}},"ToolTestRequest":{"type":"object","required":["arguments","dry_run"],"properties":{"arguments":{},"dry_run":{"type":"boolean","example":true},"timeout_seconds":{"type":"integer","format":"int32","example":60,"nullable":true}}},"ToolTestResponse":{"type":"object","required":["success","result","latency_ms","logs"],"properties":{"latency_ms":{"type":"integer","format":"int32","example":145},"logs":{"type":"array","items":{"type":"string"}},"result":{},"success":{"type":"boolean","example":true}}},"ToolTestResult":{"type":"object","required":["success","result","duration_ms","logs"],"properties":{"duration_ms":{"type":"integer","format":"int32","example":145},"logs":{"type":"array","items":{"type":"string"}},"result":{},"success":{"type":"boolean","example":true}}},"TopTenant":{"type":"object","required":["tenant_id","request_count","total_tokens","total_cost"],"properties":{"avg_latency_ms":{"type":"number","format":"double","example":145,"nullable":true},"last_request_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z","nullable":true},"request_count":{"type":"integer","format":"int64","example":15000},"tenant_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"total_cost":{"type":"string"},"total_tokens":{"type":"integer","format":"int64"}}},"TopUpRequest":{"type":"object","required":["amount_usd"],"properties":{"amount_usd":{"type":"integer","format":"int32","description":"USD amount — any whole dollar between MINIMUM_TOPUP_USD (5) and\nMAXIMUM_TOPUP_USD (10000). The 3% platform fee is added on top of this\namount at charge time; the full amount lands as credits.","example":20.0,"minimum":0}}},"TopUpResponse":{"type":"object","description":"Response when customer has a saved payment method — client can confirm immediately.","required":["status","amount_usd"],"properties":{"amount_usd":{"type":"integer","format":"int32","example":20.0,"minimum":0},"client_secret":{"type":"string","nullable":true},"status":{"type":"string","example":"active"},"url":{"type":"string","example":"https://api.xantly.com","nullable":true}}},"Trace":{"type":"object","required":["id","rootSpanName","startTime","duration","status","spans"],"properties":{"duration":{"type":"integer","format":"int64"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"rootSpanName":{"type":"string","example":"acme"},"spans":{"type":"array","items":{"$ref":"#/components/schemas/TraceSpan"}},"startTime":{"type":"integer","format":"int64"},"status":{"type":"string","example":"active"}}},"TraceDetailResponse":{"type":"object","required":["id","rootSpanName","startTime","duration","status","spans"],"properties":{"duration":{"type":"integer","format":"int64"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"rootSpanName":{"type":"string","example":"acme"},"spans":{"type":"array","items":{}},"startTime":{"type":"integer","format":"int64"},"status":{"type":"string","example":"active"}}},"TraceSpansResponse":{"type":"object","required":["trace_id","spans"],"properties":{"spans":{"type":"array","items":{"$ref":"#/components/schemas/TraceSpan"}},"trace_id":{"type":"string","example":"4bf92f3577b34da6a3ce929d0e0e4736"}}},"TraceSummary":{"type":"object","required":["id","rootSpanName","startTime","duration","status","spans"],"properties":{"duration":{"type":"integer","format":"int64"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"isChain":{"type":"boolean","example":false,"nullable":true},"rootSpanName":{"type":"string","example":"acme"},"spans":{"type":"array","items":{}},"startTime":{"type":"integer","format":"int64"},"status":{"type":"string","example":"active"}}},"TrajectoryRow":{"type":"object","description":"One planning trajectory row as stored in ClickHouse `planning_trajectories`.","required":["tenant_id","user_request","planner_output_json","execution_trace_json","final_outcome","coherence_score","timestamp"],"properties":{"coherence_score":{"type":"number","format":"float"},"execution_trace_json":{"type":"string"},"final_outcome":{"type":"string"},"planner_output_json":{"type":"string"},"tenant_id":{"type":"string"},"timestamp":{"type":"integer","format":"int64","minimum":0},"user_request":{"type":"string"}}},"TranscribeResponse":{"type":"object","required":["text","provider","language","cost_usd"],"properties":{"cost_usd":{"type":"number","format":"double","example":0.0042},"language":{"type":"string"},"provider":{"type":"string","example":"openai"},"text":{"type":"string"}}},"TransformListResponse":{"type":"object","required":["transforms"],"properties":{"next_cursor":{"type":"string","nullable":true},"transforms":{"type":"array","items":{"$ref":"#/components/schemas/TransformSummary"}}}},"TriggerDiscoveryResponse":{"type":"object","description":"200 OK response from `POST /v1/connections/{provider}/discover`.","required":["status","message"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"status":{"type":"string","example":"active"}}},"TriggerPriceSyncResponse":{"type":"object","description":"POST /v1/admin/price-sync/trigger\n\nTriggers an immediate vendor price sync from the OpenRouter + LiteLLM pricing feeds.\nRuns asynchronously — the endpoint returns immediately with `sync_triggered`.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","message"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"status":{"type":"string","example":"sync_triggered"}}},"TriggerReconciliationResponse2":{"type":"object","description":"Trigger reconciliation.\nAuto-typed response envelope for `trigger_reconciliation` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["status","run_id","run_date","total_orgs_checked","discrepancies_found","total_margin_usd"],"properties":{"discrepancies_found":{},"run_date":{},"run_id":{},"status":{},"total_margin_usd":{},"total_orgs_checked":{}}},"TrustListResponse":{"type":"object","description":"GET /v1/auth/trust/list — list the current user's browser trust tokens\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["tokens"],"properties":{"tokens":{}}},"TrustRevokeRequest":{"type":"object","required":["token_id"],"properties":{"token_id":{"type":"string","description":"Revoke a specific token by ID, or pass \"all\" to revoke all.","example":"550e8400-e29b-41d4-a716-446655440000"}}},"TrustRevokeResponse":{"type":"object","description":"POST /v1/auth/trust/revoke — revoke one or all browser trust tokens\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"active"}}},"UpdateAgentRequest":{"type":"object","description":"Partial-update body for `PATCH /v1/agents/{id}`. Replaces the previously\nfree-form `serde_json::Value` so `name`/`status` are schema-validated\nbefore they reach the DB. Closes audit P1 be-agents-11.","properties":{"name":{"type":"string","example":"Acme Corporation","nullable":true,"maxLength":100,"minLength":1},"status":{"type":"string","example":"active","nullable":true}}},"UpdateApiKeyResponse":{"type":"object","description":"PATCH /v1/api-keys/{key_id} - Partial update of an API key.\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["data"],"properties":{"data":{}}},"UpdateBYOKRequest":{"type":"object","properties":{"api_key":{"type":"string","nullable":true},"credentials":{"nullable":true},"is_active":{"type":"boolean","example":true,"nullable":true},"priority":{"type":"integer","format":"int32","nullable":true}}},"UpdateBillingLimitsRequest":{"type":"object","properties":{"budget_alert_thresholds":{"type":"array","items":{"type":"number","format":"double"},"nullable":true},"hard_block_on_cap":{"type":"boolean","example":true,"nullable":true},"monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"voice_enabled":{"type":"boolean","example":true,"nullable":true},"voice_monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true}}},"UpdateCacheConfigRequest":{"type":"object","properties":{"exclude_patterns":{"type":"array","items":{"type":"string"},"nullable":true},"max_entries":{"type":"integer","format":"int64","nullable":true,"minimum":0},"similarity_threshold":{"type":"number","format":"float","nullable":true},"ttl_seconds":{"type":"integer","format":"int64","example":60,"nullable":true,"minimum":0}}},"UpdateCloudCreditsFeeRequest":{"type":"object","required":["fee_bps"],"properties":{"fee_bps":{"type":"integer","format":"int32","description":"The fee to charge this organization on its cloud-credits traffic, in\nbasis points of measured provider cost. `300` = the standard 3%,\n`0` = a free pilot. Required; must be between 0 and 10000.","example":300},"reason":{"type":"string","description":"Optional free-text note recorded in the audit log, e.g. why this org was\nput on a pilot. Not shown to the customer.","example":"design-partner pilot through Q4","nullable":true}}},"UpdateCloudCreditsFeeResponse":{"type":"object","description":"Response for `PATCH /v1/admin/organizations/{org_id}/cloud-credits-fee`.","required":["status","organization_id","fee_bps","connections_updated","is_pilot"],"properties":{"connections_updated":{"type":"integer","format":"int64","description":"How many cloud-credits connections this write actually moved. Reported\nrather than assumed: an org with both a Bedrock and a Vertex connection\nhas two, and a caller must not read \"updated\" as \"one\".","example":1},"fee_bps":{"type":"integer","format":"int32","example":300},"is_pilot":{"type":"boolean","description":"True when the org now bills nothing on top of its own cloud spend."},"organization_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","example":"updated"}}},"UpdateConfigResponse":{"type":"object","description":"POST /v1/speculation/config - Update speculation configuration\nResponse shape for documentation purposes. Live config updates are not yet\nwired (the handler returns 501), so this schema documents the intended\nsuccess body for when SPECULATION_SERVICE gains a live-update path.","required":["status","active_config"],"properties":{"active_config":{},"status":{"type":"string","example":"updated"}}},"UpdateConstrainedConfigRequest":{"type":"object","properties":{"default_mode":{"type":"string","nullable":true},"enabled":{"type":"boolean","example":true,"nullable":true},"grammar_cache_size":{"type":"integer","format":"int32","nullable":true}}},"UpdateDegradationResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["level"],"properties":{"level":{}}},"UpdateDialRequest":{"type":"object","required":["value"],"properties":{"reason":{"type":"string","example":"customer requested","nullable":true},"value":{"type":"number","format":"double","example":0.7}}},"UpdateEntityRequest":{"type":"object","properties":{"aliases":{"type":"array","items":{"type":"string"},"nullable":true},"properties":{"nullable":true}}},"UpdateExperimentResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","status"],"properties":{"id":{},"status":{"type":"string","example":"updated"}}},"UpdateFormalSpecResponse":{"type":"object","required":["spec_id","message","updated_at"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"spec_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"}}},"UpdateGovernanceConfigRequest":{"type":"object","properties":{"gate2_enabled":{"type":"boolean","example":true,"nullable":true},"gate_2_threshold":{"type":"number","format":"float","nullable":true},"gate_3_enabled":{"type":"boolean","example":true,"nullable":true}}},"UpdateGovernanceConfigResponse":{"type":"object","required":["message","config"],"properties":{"config":{"description":"Echoes the merged config after the update so the caller sees the\neffective state without a second round-trip."},"message":{"type":"string","example":"Operation accepted; results will be available shortly."}}},"UpdateHealerConfigRequest":{"type":"object","properties":{"fallback_behavior":{"type":"string","nullable":true},"llm_retry":{"nullable":true},"stages":{"type":"array","items":{"$ref":"#/components/schemas/HealerStage"},"nullable":true}}},"UpdateHedgingConfigResponse":{"type":"object","description":"POST /v1/hedging/config\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","enabled"],"properties":{"enabled":{},"status":{"type":"string","example":"active"}}},"UpdateMemoryRequest":{"type":"object","properties":{"content":{"type":"string","nullable":true},"metadata":{"nullable":true},"recompute_embedding":{"type":"boolean","example":true}}},"UpdateModelConfigRequest":{"type":"object","required":["updates"],"properties":{"updates":{"type":"array","items":{"$ref":"#/components/schemas/ModelToggleUpdate"}}}},"UpdateModelRequest":{"type":"object","properties":{"api_format":{"type":"string","description":"Wire-protocol format: \"openai\" | \"anthropic\" | \"gemini\" | \"custom\"","nullable":true},"api_key":{"type":"string","nullable":true},"api_key_env":{"type":"string","nullable":true},"base_url":{"type":"string","example":"https://api.xantly.com","nullable":true},"cost_per_1k_input":{"type":"number","format":"double","nullable":true},"cost_per_1k_output":{"type":"number","format":"double","nullable":true},"display_name":{"type":"string","example":"Alice Chen","nullable":true},"is_active":{"type":"boolean","example":true,"nullable":true},"tier":{"type":"string","example":"T2","nullable":true},"upstream_model":{"type":"string","nullable":true}}},"UpdateOrgLimitsRequest":{"type":"object","properties":{"override_budget_cap_usd":{"type":"number","format":"double","description":"Tri-state: omit to leave unchanged, send a number to set the override,\nor send `null` to clear the override (fall back to the plan default).","example":0.42,"nullable":true},"override_included_budget_usd":{"type":"number","format":"double","description":"Tri-state: omit to leave unchanged, send a number to set the override,\nor send `null` to clear the override (fall back to the plan default).","example":0.42,"nullable":true},"override_margin_pct":{"type":"number","format":"double","description":"Tri-state: omit to leave unchanged, send a number to set the override,\nor send `null` to clear the override (fall back to the plan default).","example":0.95,"nullable":true},"override_rpm_limit":{"type":"integer","format":"int32","description":"Tri-state: omit to leave unchanged, send a number to set the override,\nor send `null` to clear the override (fall back to the plan default).","nullable":true},"override_tpm_efficient":{"type":"integer","format":"int32","description":"Tri-state: omit to leave unchanged, send a number to set the override,\nor send `null` to clear the override (fall back to the plan default).","nullable":true},"override_tpm_premium":{"type":"integer","format":"int32","description":"Tri-state: omit to leave unchanged, send a number to set the override,\nor send `null` to clear the override (fall back to the plan default).","nullable":true},"override_tpm_standard":{"type":"integer","format":"int32","description":"Tri-state: omit to leave unchanged, send a number to set the override,\nor send `null` to clear the override (fall back to the plan default).","nullable":true}}},"UpdateOrgLimitsResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status","organization_id"],"properties":{"organization_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","example":"active"}}},"UpdateOrganizationRequest":{"type":"object","properties":{"name":{"type":"string","example":"Acme Corporation","nullable":true}}},"UpdateOutputConfigRequest":{"type":"object","properties":{"crane_enabled":{"type":"boolean","example":true,"nullable":true},"cross_model_verify_enabled":{"type":"boolean","example":true,"nullable":true},"output_strategy":{"type":"string","nullable":true},"pii_categories":{"type":"array","items":{"$ref":"#/components/schemas/KnownPiiCategory"},"nullable":true}}},"UpdatePlanningConfigRequest":{"type":"object","properties":{"max_planning_latency_ms":{"type":"integer","format":"int32","example":145,"nullable":true,"minimum":0},"planner_model_override":{"type":"string","nullable":true},"planning_mode":{"type":"string","nullable":true},"trajectory_collection_enabled":{"type":"boolean","example":true,"nullable":true}}},"UpdatePolicyResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","status"],"properties":{"id":{},"status":{"type":"string","example":"active"}}},"UpdateProgressRequest":{"type":"object","required":["step","completed"],"properties":{"completed":{"type":"boolean","example":true},"step":{"$ref":"#/components/schemas/OnboardingStep"}}},"UpdateProjectRequest":{"type":"object","description":"PATCH /projects/{id} - Update project","properties":{"budget_limit_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"is_active":{"type":"boolean","example":true,"nullable":true},"name":{"type":"string","example":"Acme Corporation","nullable":true}}},"UpdatePromotionResponse":{"type":"object","description":"PATCH /admin/billing/promotions/:id — Update promo\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["updated","id"],"properties":{"id":{},"updated":{"type":"boolean","example":true}}},"UpdateProviderRequest":{"type":"object","description":"Body for `PATCH /v1/admin/providers/{id}` — toggles a provider's `is_active`\nflag (soft-delete / deactivate / re-activate). Closes audit P3\nbe-admin_providers-11.","required":["is_active"],"properties":{"is_active":{"type":"boolean","example":false}}},"UpdateProviderResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["id","name","is_active"],"properties":{"id":{},"is_active":{},"name":{}}},"UpdateRateLimitRequest":{"type":"object","properties":{"barp_write_rpm_limit":{"type":"integer","format":"int32","nullable":true},"formal_rpm_limit":{"type":"integer","format":"int32","nullable":true},"governance_write_rpm_limit":{"type":"integer","format":"int32","nullable":true},"inference_rpm_limit":{"type":"integer","format":"int32","nullable":true},"maker_rpm_limit":{"type":"integer","format":"int32","nullable":true},"voice_rpm_limit":{"type":"integer","format":"int32","nullable":true}}},"UpdateRestrictionsRequest":{"type":"object","description":"Request body for `update_restrictions`. Replaces the previously-accepted\narbitrary `serde_json::Value` (a DoS vector for huge nested payloads) with a\ntyped, validated schema. Closes audit P2 be-api_keys-16 and the\nupdate-restrictions arm of be-api_keys-19 (range/NaN/Inf validation).\nUnknown fields stay ignored to match the original handler; the router-level\nbody-size cap bounds the deserialization cost.\n\nTri-state semantics are preserved from the original handler:\n- allowlist/JSON fields (`Option<Value>`): absent = leave unchanged, `null`\n= store JSON null, value = store value;\n- numeric limit fields (`Option<Option<i32>>`): absent = unchanged, `null`\n= clear the column, integer = set;\n- string/budget fields (`Option<String>` / `Option<f64>` / `Option<f32>`):\nabsent or `null` = unchanged, value = set.","properties":{"allowed_ips":{"nullable":true},"allowed_models":{"nullable":true},"allowed_referrers":{"nullable":true},"allowed_tiers":{"nullable":true},"budget_action":{"type":"string","default":null,"nullable":true},"budget_alert_pct":{"type":"number","format":"float","default":null,"example":0.95,"nullable":true},"daily_budget_usd":{"type":"number","format":"double","default":null,"example":0.42,"nullable":true},"environment":{"type":"string","default":null,"nullable":true},"max_tier":{"type":"integer","format":"int32","default":null,"nullable":true},"monthly_budget_usd":{"type":"number","format":"double","default":null,"example":0.42,"nullable":true},"rate_limit_per_minute":{"type":"integer","format":"int32","default":null,"nullable":true},"tags":{"nullable":true},"tokens_per_day":{"type":"integer","format":"int32","default":null,"nullable":true},"tokens_per_minute":{"type":"integer","format":"int32","default":null,"nullable":true}}},"UpdateRestrictionsResponse":{"type":"object","description":"PUT /v1/api-keys/{key_id}/restrictions - Update restrictions (stub - requires schema changes)\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["allowed_ips","allowed_referrers","rate_limit_per_minute","tokens_per_minute","tokens_per_day","allowed_models","allowed_tiers","max_tier","environment","tags","monthly_budget_usd","daily_budget_usd","budget_action","budget_alert_pct"],"properties":{"allowed_ips":{},"allowed_models":{},"allowed_referrers":{},"allowed_tiers":{},"budget_action":{},"budget_alert_pct":{},"daily_budget_usd":{},"environment":{},"max_tier":{},"monthly_budget_usd":{},"rate_limit_per_minute":{},"tags":{},"tokens_per_day":{},"tokens_per_minute":{}}},"UpdateRiskLevelRequest":{"type":"object","required":["risk_level"],"properties":{"reason":{"type":"string","example":"customer requested","nullable":true},"risk_level":{"$ref":"#/components/schemas/ToolRiskLevel"}}},"UpdateRiskLevelResponse":{"type":"object","required":["message","tool_name","risk_level"],"properties":{"message":{"type":"string","example":"Operation accepted; results will be available shortly."},"risk_level":{"type":"string"},"tool_name":{"type":"string","example":"acme"}}},"UpdateRoleRequest":{"type":"object","required":["role"],"properties":{"role":{"type":"string"}}},"UpdateRuleRequest":{"type":"object","properties":{"action":{"nullable":true},"condition":{"nullable":true},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"is_active":{"type":"boolean","example":true,"nullable":true},"name":{"type":"string","example":"Acme Corporation","nullable":true},"priority":{"type":"integer","format":"int32","nullable":true}}},"UpdateScopesRequest":{"type":"object","description":"Request body for `update_scopes`. Replaces the previously-accepted arbitrary\n`serde_json::Value` with a typed schema; only `scopes` is honoured (a missing\nfield clears the list, preserving the prior default-to-`[]` behaviour).\nUnknown fields stay ignored to match the original handler; the body-size cap\nis the DoS mitigation. Closes audit P2 be-api_keys-16.","properties":{"scopes":{"nullable":true}}},"UpdateScopesResponse":{"type":"object","description":"PUT /v1/api-keys/{key_id}/scopes - Update scopes (stub - requires schema changes)\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["scopes"],"properties":{"scopes":{}}},"UpdateSettingsRequest":{"type":"object","properties":{"cache_conversation_cutoff":{"type":"integer","format":"int32","description":"Max conversation length (messages) eligible for the semantic tier.","example":4,"nullable":true},"cache_ttl_seconds":{"type":"integer","format":"int32","description":"Exact-tier (Redis) cache write TTL in seconds.","example":300,"nullable":true},"default_intelligence_mode":{"allOf":[{"$ref":"#/components/schemas/IntelligenceMode"}],"nullable":true},"inferred_contract_action":{"allOf":[{"$ref":"#/components/schemas/InferredContractActionSetting"}],"nullable":true},"output_contract_tier":{"allOf":[{"$ref":"#/components/schemas/OutputContractTierSetting"}],"nullable":true},"regen_model":{"type":"string","description":"Economy regeneration model override for semantic-assist. Empty string\nclears the override.","nullable":true},"semantic_assist_threshold":{"type":"number","format":"double","description":"Cosine similarity floor for semantic-assist grounding candidates.","example":0.8,"nullable":true},"semantic_cache_mode":{"allOf":[{"$ref":"#/components/schemas/SemanticCacheModeSetting"}],"nullable":true},"semantic_caching_enabled":{"type":"boolean","example":true,"nullable":true},"semantic_verbatim_threshold":{"type":"number","format":"double","description":"Cosine similarity floor for verbatim semantic replay (hard floor 0.90).","example":0.95,"nullable":true},"smart_routing_enabled":{"type":"boolean","example":true,"nullable":true}}},"UpdateToolResponse":{"type":"object","description":"Auto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["status"],"properties":{"status":{"type":"string","example":"active"}}},"UpdateTransformRequest":{"type":"object","properties":{"applies_to":{"type":"string","nullable":true},"enabled":{"type":"boolean","example":true,"nullable":true},"expression":{"type":"string","nullable":true},"name":{"type":"string","example":"Acme Corporation","nullable":true},"order":{"type":"integer","format":"int32","nullable":true}}},"UpdateVoiceCredentialRequest":{"type":"object","properties":{"is_active":{"type":"boolean","example":true,"nullable":true},"label":{"type":"string","nullable":true},"priority":{"type":"integer","format":"int32","nullable":true}}},"UpdateVoiceCredentialResponse":{"type":"object","description":"Response body for `PATCH /v1/voice/credentials/{id}`.","required":["credential"],"properties":{"credential":{"$ref":"#/components/schemas/VoiceCredentialResponse"}}},"UpdateVoiceSettingsRequest":{"type":"object","properties":{"voice_default_provider":{"type":"string","nullable":true},"voice_default_voice_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"voice_delegation_budget_ms":{"type":"integer","format":"int32","example":145,"nullable":true},"voice_delegation_model":{"type":"string","nullable":true},"voice_enabled":{"type":"boolean","example":true,"nullable":true},"voice_fast_lane_model":{"type":"string","nullable":true},"voice_monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"voice_rpm_limit":{"type":"integer","format":"int32","nullable":true},"voice_session_limit":{"type":"integer","format":"int32","nullable":true}}},"UploadAvatarResponse":{"type":"object","description":"POST /v1/users/me/avatar - Upload avatar\nAuto-generated response shape for documentation purposes.\nReflects the keys emitted by the handler's `Json(json!({...}))`\nreturn; the runtime type stays `serde_json::Value`.","required":["message"],"properties":{"avatar_url":{"type":"string","example":"https://cdn.xantly.com/avatars/abc.png","nullable":true},"message":{"type":"string","example":"Operation accepted; results will be available shortly."}}},"UpsertBudgetCapRequest":{"type":"object","required":["budget_type","limit_usd"],"properties":{"alert_threshold":{"type":"number","format":"float","nullable":true},"budget_type":{"type":"string"},"is_active":{"type":"boolean","example":true,"nullable":true},"limit_usd":{"type":"number","format":"double","example":0.42}}},"UsageSummary":{"type":"object","required":["date","total_requests","total_input_tokens","total_output_tokens","total_cost","unique_tenants"],"properties":{"avg_latency_ms":{"type":"number","format":"double","example":145,"nullable":true},"date":{"type":"string","format":"date"},"success_rate":{"type":"number","format":"double","example":0.995,"nullable":true},"total_cost":{"type":"string"},"total_input_tokens":{"type":"integer","format":"int64"},"total_output_tokens":{"type":"integer","format":"int64"},"total_requests":{"type":"integer","format":"int64","example":15000},"unique_tenants":{"type":"integer","format":"int64"}}},"UserActivityResponse":{"type":"object","required":["users"],"properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/UserActivityRow"}}}},"UserInfoResponse":{"type":"object","required":["sub","email","email_verified","name","org_id","workspace_ids"],"properties":{"email":{"type":"string","example":"alice@acme.io"},"email_verified":{"type":"boolean","example":true},"name":{"type":"string","example":"Acme Corporation"},"org_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"picture":{"type":"string","nullable":true},"sub":{"type":"string"},"workspace_ids":{"type":"array","items":{"type":"string"}}}},"UserProfile":{"type":"object","required":["id","email","organizationId","organizationName","createdAt"],"properties":{"avatarUrl":{"type":"string","example":"https://cdn.xantly.com/avatars/abc.png","nullable":true},"bio":{"type":"string","nullable":true},"createdAt":{"type":"string","example":"2026-05-17T18:30:00Z"},"email":{"type":"string","example":"alice@acme.io"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"jobTitle":{"type":"string","nullable":true},"name":{"type":"string","example":"Alice Chen","nullable":true},"organizationId":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"organizationName":{"type":"string","example":"acme"},"phoneNumber":{"type":"string","nullable":true},"preferences":{"nullable":true}}},"ValidateDataRequest":{"type":"object","required":["data"],"properties":{"data":{},"options":{"allOf":[{"$ref":"#/components/schemas/ValidationOptions"}],"nullable":true}}},"ValidateSpecRequest":{"type":"object","required":["spec","sample_input","sample_output"],"properties":{"sample_input":{},"sample_output":{},"spec":{}}},"ValidateSpecResponse":{"type":"object","required":["valid","issues","duration_ms"],"properties":{"duration_ms":{"type":"integer","format":"int64","example":145},"issues":{"type":"array","items":{"$ref":"#/components/schemas/SpecValidationIssue"}},"valid":{"type":"boolean","example":true}}},"ValidationResponse":{"type":"object","required":["valid","errors"],"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}},"healed":{"type":"boolean","example":true},"healed_data":{"nullable":true},"healing_applied":{"type":"array","items":{"$ref":"#/components/schemas/HealingAction"},"nullable":true},"valid":{"type":"boolean","example":true}}},"VerifyEmailRequest":{"type":"object","required":["email","code"],"properties":{"code":{"type":"string"},"email":{"type":"string","example":"alice@acme.io"}}},"VoiceCredentialResponse":{"type":"object","required":["id","provider","providerType","isActive","priority","createdAt","updatedAt"],"properties":{"createdAt":{"type":"string","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"isActive":{"type":"boolean","example":true},"label":{"type":"string","nullable":true},"priority":{"type":"integer","format":"int32"},"provider":{"type":"string","example":"openai"},"providerType":{"type":"string"},"updatedAt":{"type":"string","example":"2026-05-17T18:30:00Z"}}},"VoiceProfileResponse":{"type":"object","required":["id","provider","voice_id","created_at"],"properties":{"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"profile_name":{"type":"string","example":"acme","nullable":true},"provider":{"type":"string","example":"openai"},"s3_key":{"type":"string","nullable":true},"voice_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"}}},"VoiceSessionResponse":{"type":"object","required":["session_id","context"],"properties":{"active_chain_id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000","nullable":true},"context":{"$ref":"#/components/schemas/VoiceSessionContext"},"session_id":{"type":"string","format":"uuid","example":"sess_3f2e1a90"}}},"VoiceSettingsResponse":{"type":"object","required":["voice_enabled","voice_default_provider","voice_default_voice_id","voice_fast_lane_model","voice_delegation_budget_ms","voice_session_limit","voice_rpm_limit"],"properties":{"voice_default_provider":{"type":"string"},"voice_default_voice_id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"voice_delegation_budget_ms":{"type":"integer","format":"int32","example":145},"voice_delegation_model":{"type":"string","nullable":true},"voice_enabled":{"type":"boolean","example":true},"voice_fast_lane_model":{"type":"string"},"voice_monthly_budget_usd":{"type":"number","format":"double","example":0.42,"nullable":true},"voice_rpm_limit":{"type":"integer","format":"int32"},"voice_session_limit":{"type":"integer","format":"int32"}}},"VoiceTurnRequest":{"type":"object","required":["input"],"properties":{"audio_format":{"type":"string","nullable":true},"delegation_budget_ms":{"type":"integer","format":"int32","example":145,"nullable":true,"minimum":0},"input":{"$ref":"#/components/schemas/VoiceInputPayload"},"language":{"type":"string","nullable":true},"latency_budget_ms":{"type":"integer","format":"int32","example":145,"nullable":true,"minimum":0},"session_id":{"type":"string","format":"uuid","example":"sess_3f2e1a90","nullable":true},"voice_profile":{"type":"string","nullable":true}}},"VoiceTurnResponse2":{"type":"object","description":"Returns voice turn.\nAuto-typed response envelope for `voice_turn` (see handler body for the\nexact runtime field semantics; all values are wire-level JSON).","required":["data"],"properties":{"data":{}}},"WebhookResponse":{"type":"object","required":["id","url","events","is_active","created_at"],"properties":{"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"events":{"type":"array","items":{"type":"string"}},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"is_active":{"type":"boolean","example":true},"url":{"type":"string","example":"https://api.xantly.com"}}},"WebhookSummary":{"type":"object","description":"Summary view for listing webhooks (secret hidden).","required":["id","url","events","created_at","active"],"properties":{"active":{"type":"boolean","example":true},"created_at":{"type":"string","example":"2026-05-17T18:30:00Z"},"events":{"type":"array","items":{"type":"string"}},"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"url":{"type":"string","example":"https://api.xantly.com"}}},"WorkflowDetail":{"type":"object","required":["id","name","version","status","config","triggers","graph","created_at","updated_at"],"properties":{"config":{},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"description":{"type":"string","example":"Aggregates the last 28 days of inference requests by provider.","nullable":true},"graph":{"$ref":"#/components/schemas/WorkflowGraphDetail"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"name":{"type":"string","example":"Acme Corporation"},"status":{"type":"string","example":"active"},"triggers":{},"updated_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"version":{"type":"string","example":"1.0.0"}}},"WorkflowExecutionDetail":{"type":"object","required":["id","workflow_id","status","input","nodes_completed","nodes_total"],"properties":{"completed_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z","nullable":true},"current_node":{"type":"string","nullable":true},"duration_seconds":{"type":"integer","format":"int64","description":"Wall-clock duration (seconds) from `started_at` to `completed_at`; null while in-flight.","example":8,"nullable":true},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"input":{},"nodes_completed":{"type":"integer","format":"int64"},"nodes_total":{"type":"integer","format":"int64","example":42},"output":{"nullable":true},"started_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z","nullable":true},"status":{"type":"string","description":"Lifecycle status: `pending` | `running` | `paused` | `succeeded` | `failed` | `cancelled`.","example":"active"},"total_cost_usd":{"type":"string","example":12.45,"nullable":true},"workflow_id":{"type":"string","example":"wf_3f2e1a90c4d5b8e2"}}},"WorkflowExecutionsListResponse":{"type":"object","required":["executions"],"properties":{"executions":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowExecutionSummary"}}}},"WorkflowListResponse":{"type":"object","required":["workflows","pagination"],"properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"workflows":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowSummary"}}}},"WorkflowMetricsResponse":{"type":"object","required":["workflow_id","executions_total","executions_succeeded","executions_failed","success_rate_pct","avg_duration_seconds","p50_duration_seconds","p95_duration_seconds","p99_duration_seconds","total_cost_usd","avg_cost_per_run_usd"],"properties":{"avg_cost_per_run_usd":{"type":"number","format":"double","example":0.42},"avg_duration_seconds":{"type":"number","format":"double","example":60},"executions_failed":{"type":"integer","format":"int64"},"executions_succeeded":{"type":"integer","format":"int64"},"executions_total":{"type":"integer","format":"int64","example":42},"p50_duration_seconds":{"type":"number","format":"double","example":60},"p95_duration_seconds":{"type":"number","format":"double","example":60},"p99_duration_seconds":{"type":"number","format":"double","example":60},"success_rate_pct":{"type":"number","format":"double","example":99.5},"total_cost_usd":{"type":"number","format":"double","example":12.45},"workflow_id":{"type":"string","example":"wf_3f2e1a90c4d5b8e2"}}},"WorkflowPublishedResponse":{"type":"object","required":["workflow_id","status","version"],"properties":{"status":{"type":"string","example":"active"},"version":{"type":"string","example":"1.0.0"},"workflow_id":{"type":"string","example":"wf_3f2e1a90c4d5b8e2"}}},"WorkflowResumedResponse":{"type":"object","required":["workflow_id","status"],"properties":{"status":{"type":"string","example":"active"},"workflow_id":{"type":"string","example":"wf_3f2e1a90c4d5b8e2"}}},"WorkflowSuspendedResponse":{"type":"object","required":["workflow_id","status"],"properties":{"status":{"type":"string","example":"active"},"workflow_id":{"type":"string","example":"wf_3f2e1a90c4d5b8e2"}}},"WorkflowValidationResponse":{"type":"object","required":["valid","errors","warnings","estimated_cost_per_run_usd","estimated_duration_seconds"],"properties":{"errors":{"type":"array","items":{"type":"string"}},"estimated_cost_per_run_usd":{"type":"number","format":"double","example":0.15},"estimated_duration_seconds":{"type":"integer","format":"int64","example":45},"valid":{"type":"boolean","example":true},"warnings":{"type":"array","items":{"type":"string"}}}},"WorkflowVersionDetail":{"type":"object","required":["id","workflow_id","version","status","config","created_at"],"properties":{"config":{},"created_at":{"type":"string","format":"date-time","example":"2026-05-17T18:30:00Z"},"id":{"type":"string","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","example":"active"},"version":{"type":"string","example":"1.0.0"},"workflow_id":{"type":"string","example":"wf_3f2e1a90c4d5b8e2"}}},"WorkflowVersionsListResponse":{"type":"object","required":["versions"],"properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowVersionDetail"}}}}},"securitySchemes":{"bearer_auth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer JWT issued by `POST /v1/auth/login` or an API key issued via `/v1/api-keys`."}}},"tags":[{"name":"xantly","description":"Xantly Engine API"},{"name":"Routing","description":"Routing surface."},{"name":"admin","description":"Admin surface."},{"name":"admin-analytics","description":"Admin Analytics surface."},{"name":"admin-barp","description":"Admin Barp surface."},{"name":"admin-billing","description":"Admin Billing surface."},{"name":"admin-budgets","description":"Admin Budgets surface."},{"name":"admin-cache","description":"Admin Cache surface."},{"name":"admin-credentials","description":"Admin Credentials surface."},{"name":"admin-endpoints","description":"Admin Endpoints surface."},{"name":"admin-functionality-health","description":"Admin Functionality Health surface."},{"name":"admin-internal-docs","description":"Admin Internal Docs surface."},{"name":"admin-margins","description":"Admin Margins surface."},{"name":"admin-mc-advanced","description":"Admin Mc Advanced surface."},{"name":"admin-mc-dashboards","description":"Admin Mc Dashboards surface."},{"name":"admin-mc-routing-intelligence","description":"Admin Mc Routing Intelligence surface."},{"name":"admin-mc-tokens","description":"Admin Mc Tokens surface."},{"name":"admin-mc-validate","description":"Admin Mc Validate surface."},{"name":"admin-mcp","description":"Admin Mcp surface."},{"name":"admin-mission-control","description":"Admin Mission Control surface."},{"name":"admin-model-catalog","description":"Admin Model Catalog surface."},{"name":"admin-model-registry","description":"Admin Model Registry surface."},{"name":"admin-models","description":"Admin Models surface."},{"name":"admin-org-limits","description":"Admin Org Limits surface."},{"name":"admin-platform","description":"Admin Platform surface."},{"name":"admin-posthog","description":"Admin Posthog surface."},{"name":"admin-price-sync","description":"Admin Price Sync surface."},{"name":"admin-product-analytics","description":"Admin Product Analytics surface."},{"name":"admin-providers","description":"Admin Providers surface."},{"name":"admin-routing-experiments","description":"Admin Routing Experiments surface."},{"name":"admin-rules","description":"Admin Rules surface."},{"name":"admin-sync","description":"Admin Sync surface."},{"name":"agents","description":"Agents surface."},{"name":"analytics","description":"Analytics surface."},{"name":"analytics-memory","description":"Analytics Memory surface."},{"name":"api-keys","description":"Api Keys surface."},{"name":"audit","description":"Audit surface."},{"name":"auth","description":"Auth surface."},{"name":"avatar","description":"Avatar surface."},{"name":"barp","description":"Barp surface."},{"name":"billing","description":"Billing surface."},{"name":"brain","description":"Brain surface."},{"name":"bridge","description":"Bridge surface."},{"name":"byok-providers","description":"Byok Providers surface."},{"name":"cache","description":"Cache surface."},{"name":"chains","description":"Chains surface."},{"name":"cloud-connections","description":"Cloud Connections surface."},{"name":"compression","description":"Compression surface."},{"name":"constrained","description":"Constrained surface."},{"name":"context-masking","description":"Context Masking surface."},{"name":"crane","description":"Crane surface."},{"name":"customer-dashboard","description":"Customer Dashboard surface."},{"name":"emails","description":"Emails surface."},{"name":"feedback","description":"Feedback surface."},{"name":"gateway","description":"Gateway surface."},{"name":"governance","description":"Governance surface."},{"name":"graph","description":"Graph surface."},{"name":"healer","description":"Healer surface."},{"name":"health","description":"Health surface."},{"name":"hedging","description":"Hedging surface."},{"name":"invitations","description":"Invitations surface."},{"name":"logs","description":"Logs surface."},{"name":"mcp","description":"Mcp surface."},{"name":"mcp-memory","description":"Mcp Memory surface."},{"name":"memory","description":"Memory surface."},{"name":"memory-webhooks","description":"Memory Webhooks surface."},{"name":"metrics","description":"Metrics surface."},{"name":"mfa","description":"Mfa surface."},{"name":"models","description":"Models surface."},{"name":"multi-project","description":"Multi Project surface."},{"name":"notifications","description":"Notifications surface."},{"name":"observability","description":"Observability surface."},{"name":"onboarding-api","description":"Onboarding Api surface."},{"name":"organizations","description":"Organizations surface."},{"name":"output","description":"Output surface."},{"name":"passkey","description":"Passkey surface."},{"name":"planning","description":"Planning surface."},{"name":"policies","description":"Policies surface."},{"name":"prompts","description":"Prompts surface."},{"name":"providers","description":"Providers surface."},{"name":"quotas","description":"Quotas surface."},{"name":"reliability","description":"Reliability surface."},{"name":"routing","description":"Routing surface."},{"name":"schema","description":"Schema surface."},{"name":"sessions","description":"Sessions surface."},{"name":"settings","description":"Settings surface."},{"name":"speculation","description":"Speculation surface."},{"name":"sso-admin","description":"Tenant SSO administration surface."},{"name":"team","description":"Team surface."},{"name":"telemetry","description":"Telemetry surface."},{"name":"transform","description":"Transform surface."},{"name":"users","description":"Users surface."},{"name":"utils","description":"Utils surface."},{"name":"voice","description":"Voice surface."},{"name":"voice-api","description":"Voice Api surface."},{"name":"voice-credentials","description":"Voice Credentials surface."},{"name":"webhooks","description":"Webhooks surface."},{"name":"workflow","description":"Workflow surface."}]}