{"openapi":"3.1.0","info":{"title":"TokenGate","description":"Comprehensive quota management as a service.","version":"0.1.0"},"paths":{"/healthz":{"get":{"tags":["ops"],"summary":"Liveness probe","description":"Liveness: the process is up and serving. Never touches a backend.","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Healthz Healthz Get"}}}}}}},"/ping":{"get":{"tags":["ops"],"summary":"Liveness probe (alias of /healthz)","description":"Liveness: the process is up and serving. Never touches a backend.","operationId":"healthz_ping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Healthz Ping Get"}}}}}}},"/readyz":{"get":{"tags":["ops"],"summary":"Readiness probe (503 when a backend is down)","description":"Readiness: both backends answered. 503 when either is unavailable.","operationId":"readyz_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/tenants":{"get":{"tags":["tenants"],"summary":"List Tenants","operationId":"list_tenants_v1_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TenantOut"},"type":"array","title":"Response List Tenants V1 Tenants Get"}}}}}},"post":{"tags":["tenants"],"summary":"Create Tenant","operationId":"create_tenant_v1_tenants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}":{"get":{"tags":["tenants"],"summary":"Get Tenant","operationId":"get_tenant_v1_tenants__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tenants"],"summary":"Patch Tenant","operationId":"patch_tenant_v1_tenants__tenant_id__patch","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Suspend Tenant","description":"Soft delete: tenant is suspended, data retained (append-only history).","operationId":"suspend_tenant_v1_tenants__tenant_id__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/bootstrap-authz":{"post":{"tags":["tenants"],"summary":"Retry Bootstrap","description":"Re-run the (resumable, idempotent) RBAC bootstrap saga for a tenant\nwhose initial bootstrap failed.","operationId":"retry_bootstrap_v1_tenants__tenant_id__bootstrap_authz_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenant":{"get":{"tags":["tenants"],"summary":"Own Tenant","operationId":"own_tenant_v1_tenant_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOut"}}}}}}},"/v1/api-keys":{"get":{"tags":["api-keys"],"summary":"List Keys","operationId":"list_keys_v1_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyOut"},"type":"array","title":"Response List Keys V1 Api Keys Get"}}}}}},"post":{"tags":["api-keys"],"summary":"Mint Key","operationId":"mint_key_v1_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyMinted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/{key_row_id}":{"delete":{"tags":["api-keys"],"summary":"Revoke Key","operationId":"revoke_key_v1_api_keys__key_row_id__delete","parameters":[{"name":"key_row_id","in":"path","required":true,"schema":{"type":"string","title":"Key Row Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/api-keys/{key_row_id}/rotate":{"post":{"tags":["api-keys"],"summary":"Rotate Key","operationId":"rotate_key_v1_api_keys__key_row_id__rotate_post","parameters":[{"name":"key_row_id","in":"path","required":true,"schema":{"type":"string","title":"Key Row Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyMinted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/resources":{"get":{"tags":["resources"],"summary":"List Resources","operationId":"list_resources_v1_resources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ResourceOut"},"type":"array","title":"Response List Resources V1 Resources Get"}}}}}},"post":{"tags":["resources"],"summary":"Create Resource","operationId":"create_resource_v1_resources_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/resources/{resource_id}":{"get":{"tags":["resources"],"summary":"Get Resource","operationId":"get_resource_v1_resources__resource_id__get","parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["resources"],"summary":"Patch Resource","operationId":"patch_resource_v1_resources__resource_id__patch","parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourcePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["resources"],"summary":"Delete Resource","operationId":"delete_resource_v1_resources__resource_id__delete","parameters":[{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/policies":{"get":{"tags":["policies"],"summary":"List Policies","operationId":"list_policies_v1_policies_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PolicyOut"},"type":"array","title":"Response List Policies V1 Policies Get"}}}}}},"post":{"tags":["policies"],"summary":"Create Policy","operationId":"create_policy_v1_policies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/policies/{policy_id}":{"get":{"tags":["policies"],"summary":"Get Policy","operationId":"get_policy_v1_policies__policy_id__get","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["policies"],"summary":"Patch Policy","operationId":"patch_policy_v1_policies__policy_id__patch","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["policies"],"summary":"Delete Policy","operationId":"delete_policy_v1_policies__policy_id__delete","parameters":[{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/plans":{"get":{"tags":["plans"],"summary":"List Plans","operationId":"list_plans_v1_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PlanOut"},"type":"array","title":"Response List Plans V1 Plans Get"}}}}}},"post":{"tags":["plans"],"summary":"Create Plan","operationId":"create_plan_v1_plans_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/plans/{plan_id}":{"get":{"tags":["plans"],"summary":"Get Plan","operationId":"get_plan_v1_plans__plan_id__get","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["plans"],"summary":"Patch Plan","operationId":"patch_plan_v1_plans__plan_id__patch","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["plans"],"summary":"Delete Plan","operationId":"delete_plan_v1_plans__plan_id__delete","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/plans/{plan_id}/policies":{"put":{"tags":["plans"],"summary":"Set Plan Policies","operationId":"set_plan_policies_v1_plans__plan_id__policies_put","parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","title":"Plan Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPoliciesPut"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subjects/{subject}/assignment":{"put":{"tags":["assignments"],"summary":"Put Assignment","operationId":"put_assignment_v1_subjects__subject__assignment_put","parameters":[{"name":"subject","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentPut"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["assignments"],"summary":"Get Assignment","operationId":"get_assignment_v1_subjects__subject__assignment_get","parameters":[{"name":"subject","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["assignments"],"summary":"Delete Assignment","operationId":"delete_assignment_v1_subjects__subject__assignment_delete","parameters":[{"name":"subject","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subjects/{subject}/overrides":{"put":{"tags":["assignments"],"summary":"Put Overrides","operationId":"put_overrides_v1_subjects__subject__overrides_put","parameters":[{"name":"subject","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverridesPut"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OverrideOut"},"title":"Response Put Overrides V1 Subjects  Subject  Overrides Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["assignments"],"summary":"Get Overrides","operationId":"get_overrides_v1_subjects__subject__overrides_get","parameters":[{"name":"subject","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OverrideOut"},"title":"Response Get Overrides V1 Subjects  Subject  Overrides Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subjects/{subject}/usage":{"get":{"tags":["usage"],"summary":"Subject Usage","operationId":"subject_usage_v1_subjects__subject__usage_get","parameters":[{"name":"subject","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubjectUsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/subjects/{subject}/entitlements":{"get":{"tags":["usage"],"summary":"Entitlements","operationId":"entitlements_v1_subjects__subject__entitlements_get","parameters":[{"name":"subject","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/consume":{"post":{"tags":["consume"],"summary":"Consume","operationId":"consume_v1_consume_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/check":{"post":{"tags":["consume"],"summary":"Check","operationId":"check_v1_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/refund":{"post":{"tags":["consume"],"summary":"Refund","operationId":"refund_v1_refund_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reserve":{"post":{"tags":["reservations"],"summary":"Reserve","operationId":"reserve_v1_reserve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReserveRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReserveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reservations/{reservation_id}":{"get":{"tags":["reservations"],"summary":"Get Reservation","operationId":"get_reservation_v1_reservations__reservation_id__get","parameters":[{"name":"reservation_id","in":"path","required":true,"schema":{"type":"string","title":"Reservation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReservationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reservations/{reservation_id}/commit":{"post":{"tags":["reservations"],"summary":"Commit Reservation","operationId":"commit_reservation_v1_reservations__reservation_id__commit_post","parameters":[{"name":"reservation_id","in":"path","required":true,"schema":{"type":"string","title":"Reservation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reservations/{reservation_id}/release":{"post":{"tags":["reservations"],"summary":"Release Reservation","operationId":"release_reservation_v1_reservations__reservation_id__release_post","parameters":[{"name":"reservation_id","in":"path","required":true,"schema":{"type":"string","title":"Reservation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ops/jobs/{job_name}":{"post":{"tags":["ops"],"summary":"Run Ops Job","operationId":"run_ops_job_v1_ops_jobs__job_name__post","parameters":[{"name":"job_name","in":"path","required":true,"schema":{"type":"string","title":"Job Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/alert-rules":{"get":{"tags":["alerts"],"summary":"List Rules","operationId":"list_rules_v1_alert_rules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AlertRuleOut"},"type":"array","title":"Response List Rules V1 Alert Rules Get"}}}}}},"post":{"tags":["alerts"],"summary":"Create Rule","operationId":"create_rule_v1_alert_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/alert-rules/{rule_id}":{"get":{"tags":["alerts"],"summary":"Get Rule","operationId":"get_rule_v1_alert_rules__rule_id__get","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["alerts"],"summary":"Patch Rule","operationId":"patch_rule_v1_alert_rules__rule_id__patch","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRulePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["alerts"],"summary":"Delete Rule","operationId":"delete_rule_v1_alert_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/alert-events":{"get":{"tags":["alerts"],"summary":"List Events","operationId":"list_events_v1_alert_events_get","parameters":[{"name":"subject","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertEventOut"},"title":"Response List Events V1 Alert Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook-endpoints":{"get":{"tags":["webhooks"],"summary":"List Endpoints","operationId":"list_endpoints_v1_webhook_endpoints_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WebhookEndpointOut"},"type":"array","title":"Response List Endpoints V1 Webhook Endpoints Get"}}}}}},"post":{"tags":["webhooks"],"summary":"Create Endpoint","operationId":"create_endpoint_v1_webhook_endpoints_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook-endpoints/{endpoint_id}":{"get":{"tags":["webhooks"],"summary":"Get Endpoint","operationId":"get_endpoint_v1_webhook_endpoints__endpoint_id__get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["webhooks"],"summary":"Patch Endpoint","operationId":"patch_endpoint_v1_webhook_endpoints__endpoint_id__patch","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["webhooks"],"summary":"Delete Endpoint","operationId":"delete_endpoint_v1_webhook_endpoints__endpoint_id__delete","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook-endpoints/{endpoint_id}/test":{"post":{"tags":["webhooks"],"summary":"Test Endpoint","operationId":"test_endpoint_v1_webhook_endpoints__endpoint_id__test_post","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhook-deliveries":{"get":{"tags":["webhooks"],"summary":"List Deliveries","operationId":"list_deliveries_v1_webhook_deliveries_get","parameters":[{"name":"endpoint_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryOut"},"title":"Response List Deliveries V1 Webhook Deliveries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage/summary":{"get":{"tags":["reporting"],"summary":"Usage Summary","operationId":"usage_summary_v1_usage_summary_get","parameters":[{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day"],"type":"string","default":"day","title":"Granularity"}},{"name":"resource","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource"}},{"name":"subject","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SummaryRow"},"title":"Response Usage Summary V1 Usage Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ledger":{"get":{"tags":["reporting"],"summary":"Ledger","operationId":"ledger_v1_ledger_get","parameters":[{"name":"subject","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"}},{"name":"resource","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ActualItem":{"properties":{"resource":{"type":"string","maxLength":200,"minLength":1,"title":"Resource"},"amount":{"type":"integer","maximum":9007199254740991.0,"minimum":0.0,"title":"Amount"}},"additionalProperties":false,"type":"object","required":["resource","amount"],"title":"ActualItem"},"AdjustmentOut":{"properties":{"resource":{"type":"string","title":"Resource"},"held":{"type":"integer","title":"Held"},"actual":{"type":"integer","title":"Actual"},"delta":{"type":"integer","title":"Delta"},"overage":{"type":"integer","title":"Overage"}},"additionalProperties":false,"type":"object","required":["resource","held","actual","delta","overage"],"title":"AdjustmentOut"},"AlertChannels":{"properties":{"webhooks":{"items":{"type":"string"},"type":"array","title":"Webhooks","default":[]},"emails":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Emails"}},"additionalProperties":false,"type":"object","title":"AlertChannels"},"AlertEventOut":{"properties":{"id":{"type":"string","title":"Id"},"rule_id":{"type":"string","title":"Rule Id"},"subject":{"type":"string","title":"Subject"},"policy_id":{"type":"string","title":"Policy Id"},"window_id":{"type":"string","title":"Window Id"},"threshold_pct":{"type":"integer","title":"Threshold Pct"},"usage_pct":{"type":"number","title":"Usage Pct"},"suppressed":{"type":"boolean","title":"Suppressed"},"triggered_at":{"type":"string","format":"date-time","title":"Triggered At"}},"additionalProperties":false,"type":"object","required":["id","rule_id","subject","policy_id","window_id","threshold_pct","usage_pct","suppressed","triggered_at"],"title":"AlertEventOut"},"AlertRuleCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"policy_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Id"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"subject_filter":{"anyOf":[{"type":"string","maxLength":256,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$"},{"type":"null"}],"title":"Subject Filter"},"threshold_pct":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Threshold Pct"},"channels":{"$ref":"#/components/schemas/AlertChannels"},"cooldown_seconds":{"type":"integer","maximum":604800.0,"minimum":0.0,"title":"Cooldown Seconds","default":0},"enabled":{"type":"boolean","title":"Enabled","default":true}},"additionalProperties":false,"type":"object","required":["name","threshold_pct","channels"],"title":"AlertRuleCreate"},"AlertRuleOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"policy_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Id"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"subject_filter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Filter"},"threshold_pct":{"type":"integer","title":"Threshold Pct"},"channels":{"$ref":"#/components/schemas/AlertChannels"},"cooldown_seconds":{"type":"integer","title":"Cooldown Seconds"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["id","name","policy_id","resource_id","subject_filter","threshold_pct","channels","cooldown_seconds","enabled","created_at"],"title":"AlertRuleOut"},"AlertRulePatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"threshold_pct":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Threshold Pct"},"channels":{"anyOf":[{"$ref":"#/components/schemas/AlertChannels"},{"type":"null"}]},"cooldown_seconds":{"anyOf":[{"type":"integer","maximum":604800.0,"minimum":0.0},{"type":"null"}],"title":"Cooldown Seconds"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"additionalProperties":false,"type":"object","title":"AlertRulePatch"},"ApiKeyCreate":{"properties":{"name":{"type":"string","title":"Name","default":""},"scopes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Scopes"},"actor":{"type":"string","maxLength":200,"minLength":1,"title":"Actor"}},"additionalProperties":false,"type":"object","required":["scopes","actor"],"title":"ApiKeyCreate"},"ApiKeyMinted":{"properties":{"id":{"type":"string","title":"Id"},"key_id":{"type":"string","title":"Key Id"},"name":{"type":"string","title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"actor":{"type":"string","title":"Actor"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"key":{"type":"string","title":"Key"}},"additionalProperties":false,"type":"object","required":["id","key_id","name","scopes","actor","status","created_at","last_used_at","key"],"title":"ApiKeyMinted","description":"Returned exactly once at mint/rotate time; `key` is never retrievable again."},"ApiKeyOut":{"properties":{"id":{"type":"string","title":"Id"},"key_id":{"type":"string","title":"Key Id"},"name":{"type":"string","title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"actor":{"type":"string","title":"Actor"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"additionalProperties":false,"type":"object","required":["id","key_id","name","scopes","actor","status","created_at","last_used_at"],"title":"ApiKeyOut"},"AssignmentOut":{"properties":{"subject":{"type":"string","title":"Subject"},"plan_id":{"type":"string","title":"Plan Id"},"plan_name":{"type":"string","title":"Plan Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["subject","plan_id","plan_name","created_at"],"title":"AssignmentOut"},"AssignmentPut":{"properties":{"plan_id":{"type":"string","title":"Plan Id"}},"additionalProperties":false,"type":"object","required":["plan_id"],"title":"AssignmentPut"},"CheckRequest":{"properties":{"subject":{"type":"string","maxLength":256,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"},"items":{"items":{"$ref":"#/components/schemas/ConsumeItem"},"type":"array","maxItems":50,"minItems":1,"title":"Items"}},"additionalProperties":false,"type":"object","required":["subject","items"],"title":"CheckRequest"},"CheckResponse":{"properties":{"allowed":{"type":"boolean","title":"Allowed"},"degraded":{"type":"boolean","title":"Degraded"},"results":{"items":{"$ref":"#/components/schemas/PolicyUsageOut"},"type":"array","title":"Results"},"blocking":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Blocking"}},"additionalProperties":false,"type":"object","required":["allowed","degraded","results","blocking"],"title":"CheckResponse"},"CommitRequest":{"properties":{"actuals":{"items":{"$ref":"#/components/schemas/ActualItem"},"type":"array","maxItems":50,"title":"Actuals"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","title":"CommitRequest"},"CommitResponse":{"properties":{"reservation_id":{"type":"string","title":"Reservation Id"},"status":{"type":"string","title":"Status"},"event_id":{"type":"string","title":"Event Id"},"degraded":{"type":"boolean","title":"Degraded"},"adjustments":{"items":{"$ref":"#/components/schemas/AdjustmentOut"},"type":"array","title":"Adjustments"}},"additionalProperties":false,"type":"object","required":["reservation_id","status","event_id","degraded","adjustments"],"title":"CommitResponse"},"ConsumeItem":{"properties":{"resource":{"type":"string","maxLength":200,"minLength":1,"title":"Resource"},"amount":{"type":"integer","maximum":9007199254740991.0,"exclusiveMinimum":0.0,"title":"Amount"}},"additionalProperties":false,"type":"object","required":["resource","amount"],"title":"ConsumeItem"},"ConsumeRequest":{"properties":{"subject":{"type":"string","maxLength":256,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"},"items":{"items":{"$ref":"#/components/schemas/ConsumeItem"},"type":"array","maxItems":50,"minItems":1,"title":"Items"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Idempotency Key"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","default":{}}},"additionalProperties":false,"type":"object","required":["subject","items"],"title":"ConsumeRequest"},"ConsumeResponse":{"properties":{"allowed":{"type":"boolean","title":"Allowed"},"event_id":{"type":"string","title":"Event Id"},"degraded":{"type":"boolean","title":"Degraded"},"results":{"items":{"$ref":"#/components/schemas/PolicyUsageOut"},"type":"array","title":"Results"}},"additionalProperties":false,"type":"object","required":["allowed","event_id","degraded","results"],"title":"ConsumeResponse"},"DeliveryOut":{"properties":{"id":{"type":"string","title":"Id"},"endpoint_id":{"type":"string","title":"Endpoint Id"},"alert_event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Event Id"},"event_type":{"type":"string","title":"Event Type"},"attempt_count":{"type":"integer","title":"Attempt Count"},"status":{"type":"string","title":"Status"},"last_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Status Code"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"next_attempt_at":{"type":"string","format":"date-time","title":"Next Attempt At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["id","endpoint_id","alert_event_id","event_type","attempt_count","status","last_status_code","last_error","next_attempt_at","created_at"],"title":"DeliveryOut"},"EffectivePolicyOut":{"properties":{"policy_id":{"type":"string","title":"Policy Id"},"name":{"type":"string","title":"Name"},"resource":{"type":"string","title":"Resource"},"kind":{"type":"string","title":"Kind"},"limit_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit Amount"},"window_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window Kind"},"window_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window Unit"},"window_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window Size"},"tz":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"},"bucket_capacity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bucket Capacity"},"refill_rate_per_sec":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Refill Rate Per Sec"},"enforcement_mode":{"type":"string","title":"Enforcement Mode"},"on_exceed":{"type":"string","title":"On Exceed"},"on_backend_error":{"type":"string","title":"On Backend Error"},"source":{"type":"string","title":"Source"},"window":{"anyOf":[{"$ref":"#/components/schemas/WindowOut"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["policy_id","name","resource","kind","limit_amount","window_kind","window_unit","window_size","tz","bucket_capacity","refill_rate_per_sec","enforcement_mode","on_exceed","on_backend_error","source","window"],"title":"EffectivePolicyOut"},"EntitlementsOut":{"properties":{"subject":{"type":"string","title":"Subject"},"policies":{"items":{"$ref":"#/components/schemas/EffectivePolicyOut"},"type":"array","title":"Policies"}},"additionalProperties":false,"type":"object","required":["subject","policies"],"title":"EntitlementsOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobReport":{"properties":{"job":{"type":"string","title":"Job"},"ok":{"type":"boolean","title":"Ok"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"finished_at":{"type":"string","format":"date-time","title":"Finished At"}},"additionalProperties":true,"type":"object","required":["job","ok","started_at","finished_at"],"title":"JobReport"},"LedgerEntry":{"properties":{"id":{"type":"string","title":"Id"},"event_id":{"type":"string","title":"Event Id"},"subject":{"type":"string","title":"Subject"},"resource":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource"},"amount":{"type":"integer","title":"Amount"},"entry_type":{"type":"string","title":"Entry Type"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"},"reservation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reservation Id"},"strict_deferred":{"type":"boolean","title":"Strict Deferred"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"}},"additionalProperties":false,"type":"object","required":["id","event_id","subject","resource","amount","entry_type","idempotency_key","reservation_id","strict_deferred","occurred_at"],"title":"LedgerEntry"},"LedgerPage":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/LedgerEntry"},"type":"array","title":"Entries"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"additionalProperties":false,"type":"object","required":["entries","next_cursor"],"title":"LedgerPage"},"OverrideItem":{"properties":{"policy_id":{"type":"string","title":"Policy Id"},"limit_amount":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Limit Amount"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"additionalProperties":false,"type":"object","required":["policy_id"],"title":"OverrideItem"},"OverrideOut":{"properties":{"policy_id":{"type":"string","title":"Policy Id"},"limit_amount_override":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit Amount Override"},"enabled":{"type":"boolean","title":"Enabled"}},"additionalProperties":false,"type":"object","required":["policy_id","limit_amount_override","enabled"],"title":"OverrideOut"},"OverridesPut":{"properties":{"overrides":{"items":{"$ref":"#/components/schemas/OverrideItem"},"type":"array","title":"Overrides"}},"additionalProperties":false,"type":"object","required":["overrides"],"title":"OverridesPut"},"PlanCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"description":{"type":"string","title":"Description","default":""},"policy_ids":{"items":{"type":"string"},"type":"array","title":"Policy Ids","default":[]}},"additionalProperties":false,"type":"object","required":["name"],"title":"PlanCreate"},"PlanOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"policy_ids":{"items":{"type":"string"},"type":"array","title":"Policy Ids"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["id","name","description","policy_ids","created_at"],"title":"PlanOut"},"PlanPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","title":"PlanPatch"},"PlanPoliciesPut":{"properties":{"policy_ids":{"items":{"type":"string"},"type":"array","title":"Policy Ids"}},"additionalProperties":false,"type":"object","required":["policy_ids"],"title":"PlanPoliciesPut"},"PolicyCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"resource_id":{"type":"string","title":"Resource Id"},"kind":{"type":"string","enum":["quota","rate_limit"],"title":"Kind"},"limit_amount":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Limit Amount"},"window_kind":{"anyOf":[{"type":"string","enum":["fixed","rolling","lifetime"]},{"type":"null"}],"title":"Window Kind"},"window_unit":{"anyOf":[{"type":"string","enum":["minute","hour","day","week","month"]},{"type":"null"}],"title":"Window Unit"},"window_size":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Window Size"},"tz":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"},"bucket_capacity":{"anyOf":[{"type":"integer","maximum":9007199254740991.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Bucket Capacity"},"refill_rate_per_sec":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Refill Rate Per Sec"},"enforcement_mode":{"type":"string","enum":["strict","fast"],"title":"Enforcement Mode","default":"fast"},"on_exceed":{"type":"string","enum":["block","allow_overage"],"title":"On Exceed","default":"block"},"on_backend_error":{"anyOf":[{"type":"string","enum":["deny","allow"]},{"type":"null"}],"title":"On Backend Error"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"additionalProperties":false,"type":"object","required":["name","resource_id","kind"],"title":"PolicyCreate"},"PolicyOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"resource_id":{"type":"string","title":"Resource Id"},"kind":{"type":"string","title":"Kind"},"limit_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit Amount"},"window_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window Kind"},"window_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window Unit"},"window_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window Size"},"tz":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"},"bucket_capacity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bucket Capacity"},"refill_rate_per_sec":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Refill Rate Per Sec"},"enforcement_mode":{"type":"string","title":"Enforcement Mode"},"on_exceed":{"type":"string","title":"On Exceed"},"on_backend_error":{"type":"string","title":"On Backend Error"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["id","name","resource_id","kind","limit_amount","window_kind","window_unit","window_size","tz","bucket_capacity","refill_rate_per_sec","enforcement_mode","on_exceed","on_backend_error","enabled","created_at"],"title":"PolicyOut"},"PolicyPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"limit_amount":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Limit Amount"},"bucket_capacity":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Bucket Capacity"},"refill_rate_per_sec":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Refill Rate Per Sec"},"on_exceed":{"anyOf":[{"type":"string","enum":["block","allow_overage"]},{"type":"null"}],"title":"On Exceed"},"on_backend_error":{"anyOf":[{"type":"string","enum":["deny","allow"]},{"type":"null"}],"title":"On Backend Error"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"additionalProperties":false,"type":"object","title":"PolicyPatch","description":"Window shape, kind, and enforcement mode are immutable after creation\n(they define counter identity); create a new policy instead."},"PolicyUsageOut":{"properties":{"resource":{"type":"string","title":"Resource"},"policy_id":{"type":"string","title":"Policy Id"},"policy_name":{"type":"string","title":"Policy Name"},"kind":{"type":"string","title":"Kind"},"mode":{"type":"string","title":"Mode"},"allowed":{"type":"boolean","title":"Allowed"},"limit":{"type":"integer","title":"Limit"},"used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Used"},"remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Remaining"},"overage":{"type":"boolean","title":"Overage"},"window":{"anyOf":[{"$ref":"#/components/schemas/WindowOut"},{"type":"null"}]}},"additionalProperties":false,"type":"object","required":["resource","policy_id","policy_name","kind","mode","allowed","limit","used","remaining","overage","window"],"title":"PolicyUsageOut"},"RefundRequest":{"properties":{"subject":{"type":"string","maxLength":256,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"},"items":{"items":{"$ref":"#/components/schemas/ConsumeItem"},"type":"array","maxItems":50,"minItems":1,"title":"Items"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Idempotency Key"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","default":{}},"reason":{"type":"string","title":"Reason","default":""}},"additionalProperties":false,"type":"object","required":["subject","items"],"title":"RefundRequest"},"RefundResponse":{"properties":{"event_id":{"type":"string","title":"Event Id"},"degraded":{"type":"boolean","title":"Degraded"},"results":{"items":{"$ref":"#/components/schemas/PolicyUsageOut"},"type":"array","title":"Results"}},"additionalProperties":false,"type":"object","required":["event_id","degraded","results"],"title":"RefundResponse"},"ReleaseRequest":{"properties":{"idempotency_key":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","title":"ReleaseRequest"},"ReleaseResponse":{"properties":{"reservation_id":{"type":"string","title":"Reservation Id"},"status":{"type":"string","title":"Status"},"degraded":{"type":"boolean","title":"Degraded"},"returned":{"items":{"$ref":"#/components/schemas/ReturnedOut"},"type":"array","title":"Returned"}},"additionalProperties":false,"type":"object","required":["reservation_id","status","degraded","returned"],"title":"ReleaseResponse"},"ReservationItemOut":{"properties":{"resource":{"type":"string","title":"Resource"},"amount_held":{"type":"integer","title":"Amount Held"},"amount_actual":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Actual"}},"additionalProperties":false,"type":"object","required":["resource","amount_held","amount_actual"],"title":"ReservationItemOut"},"ReservationOut":{"properties":{"reservation_id":{"type":"string","title":"Reservation Id"},"subject":{"type":"string","title":"Subject"},"status":{"type":"string","title":"Status"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"finalized_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finalized At"},"items":{"items":{"$ref":"#/components/schemas/ReservationItemOut"},"type":"array","title":"Items"}},"additionalProperties":false,"type":"object","required":["reservation_id","subject","status","expires_at","created_at","finalized_at","items"],"title":"ReservationOut"},"ReserveRequest":{"properties":{"subject":{"type":"string","maxLength":256,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f{}]+$","title":"Subject"},"items":{"items":{"$ref":"#/components/schemas/ConsumeItem"},"type":"array","maxItems":50,"minItems":1,"title":"Items"},"idempotency_key":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Idempotency Key"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","default":{}},"ttl_seconds":{"type":"integer","maximum":3600.0,"minimum":1.0,"title":"Ttl Seconds","default":120}},"additionalProperties":false,"type":"object","required":["subject","items"],"title":"ReserveRequest"},"ReserveResponse":{"properties":{"reservation_id":{"type":"string","title":"Reservation Id"},"status":{"type":"string","title":"Status"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"degraded":{"type":"boolean","title":"Degraded"},"results":{"items":{"$ref":"#/components/schemas/PolicyUsageOut"},"type":"array","title":"Results"}},"additionalProperties":false,"type":"object","required":["reservation_id","status","expires_at","degraded","results"],"title":"ReserveResponse"},"ResourceCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"unit":{"type":"string","title":"Unit","default":""},"description":{"type":"string","title":"Description","default":""}},"additionalProperties":false,"type":"object","required":["name"],"title":"ResourceCreate"},"ResourceOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"unit":{"type":"string","title":"Unit"},"description":{"type":"string","title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["id","name","unit","description","created_at"],"title":"ResourceOut"},"ResourcePatch":{"properties":{"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","title":"ResourcePatch"},"ReturnedOut":{"properties":{"resource":{"type":"string","title":"Resource"},"amount":{"type":"integer","title":"Amount"}},"additionalProperties":false,"type":"object","required":["resource","amount"],"title":"ReturnedOut"},"SubjectUsageOut":{"properties":{"subject":{"type":"string","title":"Subject"},"policies":{"items":{"$ref":"#/components/schemas/PolicyUsageOut"},"type":"array","title":"Policies"}},"additionalProperties":false,"type":"object","required":["subject","policies"],"title":"SubjectUsageOut"},"SummaryRow":{"properties":{"resource":{"type":"string","title":"Resource"},"subject":{"type":"string","title":"Subject"},"granularity":{"type":"string","title":"Granularity"},"bucket_start":{"type":"string","format":"date-time","title":"Bucket Start"},"amount_sum":{"type":"integer","title":"Amount Sum"},"event_count":{"type":"integer","title":"Event Count"}},"additionalProperties":false,"type":"object","required":["resource","subject","granularity","bucket_start","amount_sum","event_count"],"title":"SummaryRow"},"TenantCreate":{"properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$","title":"Slug"},"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"tz":{"type":"string","title":"Tz","default":"UTC"},"owner_actor":{"type":"string","maxLength":200,"minLength":1,"title":"Owner Actor"}},"additionalProperties":false,"type":"object","required":["slug","name","owner_actor"],"title":"TenantCreate"},"TenantCreated":{"properties":{"tenant":{"$ref":"#/components/schemas/TenantOut"},"admin_key":{"$ref":"#/components/schemas/ApiKeyMinted"}},"additionalProperties":false,"type":"object","required":["tenant","admin_key"],"title":"TenantCreated"},"TenantOut":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"tz":{"type":"string","title":"Tz"},"status":{"type":"string","title":"Status"},"owner_actor":{"type":"string","title":"Owner Actor"},"authz_bootstrapped":{"type":"boolean","title":"Authz Bootstrapped"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["id","slug","name","tz","status","owner_actor","authz_bootstrapped","created_at"],"title":"TenantOut"},"TenantPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"tz":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tz"},"status":{"anyOf":[{"type":"string","enum":["active","suspended"]},{"type":"null"}],"title":"Status"}},"additionalProperties":false,"type":"object","title":"TenantPatch"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookEndpointCreate":{"properties":{"url":{"type":"string","maxLength":2000,"pattern":"^https?://","title":"Url"},"description":{"type":"string","title":"Description","default":""}},"additionalProperties":false,"type":"object","required":["url"],"title":"WebhookEndpointCreate"},"WebhookEndpointCreated":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"description":{"type":"string","title":"Description"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"secret":{"type":"string","title":"Secret"}},"additionalProperties":false,"type":"object","required":["id","url","description","status","created_at","secret"],"title":"WebhookEndpointCreated","description":"`secret` is shown exactly once; rotate by delete+create."},"WebhookEndpointOut":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"description":{"type":"string","title":"Description"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"additionalProperties":false,"type":"object","required":["id","url","description","status","created_at"],"title":"WebhookEndpointOut"},"WebhookEndpointPatch":{"properties":{"url":{"anyOf":[{"type":"string","maxLength":2000,"pattern":"^https?://"},{"type":"null"}],"title":"Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"type":"string","enum":["active","disabled"]},{"type":"null"}],"title":"Status"}},"additionalProperties":false,"type":"object","title":"WebhookEndpointPatch"},"WebhookTestResult":{"properties":{"delivered":{"type":"boolean","title":"Delivered"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"additionalProperties":false,"type":"object","required":["delivered","status_code","error"],"title":"WebhookTestResult"},"WindowOut":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"},"reset_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reset At"}},"additionalProperties":false,"type":"object","required":["id","start","end","reset_at"],"title":"WindowOut"}}}}