{
  "components": {
    "headers": {
      "Cache-Control": {
        "description": "Always no-store.",
        "schema": {
          "type": "string"
        }
      },
      "ETag": {
        "description": "Quoted version of the returned resource, when it has one; send it in If-Match.",
        "schema": {
          "type": "string"
        }
      },
      "X-Request-ID": {
        "description": "Request correlation ID (also in the body).",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Invalid request or configuration.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "BodyTimeout": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Timed out reading the request body.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "BodyTooLarge": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Request body exceeds 1 MiB.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "Busy": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Management concurrency limit reached (management_busy), or the tenant's policy publish limit (publish_rate_limited, with Retry-After). Use POST /controls/_batch to apply many edits as one revision.",
        "headers": {
          "Retry-After": {
            "description": "Seconds until a publish fits the tenant's limit (publish_rate_limited only).",
            "schema": {
              "type": "integer"
            }
          },
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "Conflict": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Name, dependency, state or idempotency conflict, or a list changed during pagination.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Missing scope, or management suspended for the tenant.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "Gone": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "revision_pruned: the revision was deleted by revision retention (only the newest revisions and the active one are kept).",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "NotFound": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Resource not found, or management not available on this deployment.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "PreconditionRequired": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "If-Match is required.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Missing or invalid credential.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "Unavailable": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Configuration storage unavailable, central service required, or an operation is pending (retry or recover it).",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "Unprocessable": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Policy validation failed, or an immutable or unresolvable budget field.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      },
      "VersionConflict": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "If-Match does not match the current version; read again.",
        "headers": {
          "X-Request-ID": {
            "$ref": "#/components/headers/X-Request-ID"
          }
        }
      }
    },
    "schemas": {
      "AccessRule": {
        "additionalProperties": true,
        "description": "Deny rules win. Referencing a group never changes its membership.",
        "properties": {
          "allow_all": {
            "default": false,
            "type": "boolean"
          },
          "allow_emails": {
            "items": {
              "format": "email",
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "allow_smart_groups": {
            "items": {
              "description": "Existing smart-group name.",
              "minLength": 1,
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "deny_emails": {
            "items": {
              "format": "email",
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "deny_smart_groups": {
            "items": {
              "description": "Existing smart-group name.",
              "minLength": 1,
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          }
        },
        "type": "object"
      },
      "AdminHooks": {
        "properties": {
          "hooks": {
            "items": {
              "description": "The GET /controls/hooks item view (secrets masked as ********), without etag and source.",
              "type": "object"
            },
            "type": "array"
          },
          "revision": {
            "description": "Active policy revision; null while the policy engine is off for the tenant (hooks is then empty).",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "revision",
          "hooks"
        ],
        "type": "object"
      },
      "AlertRule": {
        "additionalProperties": true,
        "properties": {
          "cooldown_minutes": {
            "default": 10,
            "minimum": 1,
            "type": "integer"
          },
          "enabled": {
            "default": false,
            "type": "boolean"
          },
          "failure_rate_threshold": {
            "default": 10,
            "description": "Percentage.",
            "maximum": 100,
            "minimum": 0,
            "type": "number"
          },
          "minimum_requests": {
            "default": 20,
            "minimum": 0,
            "type": "integer"
          },
          "notify_on_recovery": {
            "default": true,
            "type": "boolean"
          },
          "window_minutes": {
            "default": 15,
            "maximum": 1440,
            "minimum": 5,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Alerting": {
        "additionalProperties": true,
        "description": "Replaces the whole alerting configuration; include every webhook URL when updating (reads never return them). null clears alerting.",
        "properties": {
          "app_level": {
            "$ref": "#/components/schemas/AlertRule"
          },
          "channels": {
            "additionalProperties": true,
            "properties": {
              "emails": {
                "items": {
                  "format": "email",
                  "type": "string"
                },
                "type": "array",
                "uniqueItems": true
              },
              "webhooks": {
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "id": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "type": {
                      "default": "generic",
                      "enum": [
                        "slack",
                        "generic"
                      ],
                      "type": "string"
                    },
                    "url": {
                      "description": "HTTPS webhook URL, required for every submitted webhook.",
                      "format": "uri",
                      "type": "string",
                      "writeOnly": true
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "provider_level": {
            "$ref": "#/components/schemas/AlertRule"
          }
        },
        "type": "object"
      },
      "AppCreate": {
        "additionalProperties": false,
        "properties": {
          "access": {
            "additionalProperties": false,
            "properties": {
              "allowed_source_ips": {
                "oneOf": [
                  {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "ips": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "allowed_user_domains": {
                "items": {
                  "type": "string"
                },
                "maxItems": 1000,
                "type": "array"
              },
              "allowed_user_emails": {
                "items": {
                  "type": "string"
                },
                "maxItems": 1000,
                "type": "array"
              },
              "enforce_conversation_id": {
                "type": "boolean"
              },
              "enforce_identity": {
                "type": "boolean"
              },
              "identity_header_mode": {
                "type": "boolean"
              },
              "identity_token_headers": {
                "items": {
                  "type": "string"
                },
                "maxItems": 1000,
                "type": "array"
              },
              "identity_token_oid_fallback": {
                "type": "boolean"
              },
              "jwt_auth": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/JwtAuth"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "type": "object"
          },
          "alerting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Alerting"
              },
              {
                "type": "null"
              }
            ]
          },
          "detection": {
            "additionalProperties": false,
            "properties": {
              "attachment_scanning": {
                "$ref": "#/components/schemas/AttachmentScanning"
              },
              "category_actions": {
                "additionalProperties": {
                  "description": "Adversarial detections have no redactable spans; actions they cannot apply are rejected.",
                  "enum": [
                    "monitor",
                    "partial-redact",
                    "tokenize",
                    "redact",
                    "block"
                  ],
                  "type": "string"
                },
                "description": "Category ID to action.",
                "type": "object"
              },
              "category_scopes": {
                "additionalProperties": {
                  "enum": [
                    "request",
                    "response",
                    "both"
                  ],
                  "type": "string"
                },
                "type": "object"
              },
              "category_sensitivities": {
                "additionalProperties": {
                  "items": {
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              },
              "custom_definitions": {
                "description": "Replaces the whole selection; [] clears it. Never deletes definitions.",
                "items": {
                  "$ref": "#/components/schemas/CustomSelection"
                },
                "maxItems": 1000,
                "type": "array"
              },
              "data_risk_action": {
                "enum": [
                  "block",
                  "redact",
                  "partial-redact",
                  "tokenize",
                  "monitor"
                ],
                "type": "string"
              },
              "edm_pattern_sensitivities": {
                "additionalProperties": {
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ],
                  "type": "string"
                },
                "type": "object"
              },
              "enabled_categories": {
                "additionalProperties": {
                  "type": "boolean"
                },
                "description": "Catalog category or subcategory IDs mapped to enabled state. Unknown IDs are rejected.",
                "type": "object"
              },
              "guardian_agent": {
                "$ref": "#/components/schemas/Guardian"
              },
              "hallucination_check_action": {
                "enum": [
                  "block",
                  "monitor"
                ],
                "type": "string"
              },
              "hallucination_check_risk_level": {
                "type": "string"
              },
              "hallucination_check_score_threshold": {
                "maximum": 1,
                "minimum": 0,
                "type": "number"
              },
              "is_hallucination_check_enabled": {
                "type": "boolean"
              },
              "sub_category_actions": {
                "additionalProperties": {
                  "additionalProperties": {
                    "description": "Adversarial detections have no redactable spans; actions they cannot apply are rejected.",
                    "enum": [
                      "monitor",
                      "partial-redact",
                      "tokenize",
                      "redact",
                      "block"
                    ],
                    "type": "string"
                  },
                  "type": "object"
                },
                "description": "Category ID to subcategory name to action.",
                "type": "object"
              },
              "sub_category_sensitivities": {
                "additionalProperties": {
                  "additionalProperties": {
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ],
                    "type": "string"
                  },
                  "type": "object"
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "enabled": {
            "type": "boolean"
          },
          "initial_key": {
            "additionalProperties": false,
            "properties": {
              "expires_at": {
                "description": "Future RFC 3339 time with a timezone; null never expires.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "name": {
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              }
            },
            "type": "object"
          },
          "limits": {
            "additionalProperties": false,
            "properties": {
              "concurrency_per_minute": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "model_rate_limits": {
                "items": {
                  "$ref": "#/components/schemas/ModelLimit"
                },
                "type": "array"
              },
              "rate_limit": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RateLimit"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rate_limit_per_minute": {
                "minimum": 0,
                "type": "integer"
              },
              "timeout": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "token_limits": {
                "$ref": "#/components/schemas/TokenLimits"
              }
            },
            "type": "object"
          },
          "mode": {
            "default": "gateway",
            "enum": [
              "gateway",
              "sdk",
              "copilot_studio"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "prompts": {
            "additionalProperties": false,
            "properties": {
              "require_system_from_store": {
                "type": "boolean"
              },
              "universal_system_prompt": {
                "additionalProperties": false,
                "description": "Prepended to the system prompt of every request when enabled; partial objects merge onto the stored value.",
                "properties": {
                  "content": {
                    "maxLength": 100000,
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "provider_labels": {
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "routing": {
            "additionalProperties": false,
            "properties": {
              "custom_routing": {
                "items": {
                  "$ref": "#/components/schemas/ContextRoute"
                },
                "type": "array"
              },
              "routing_groups": {
                "items": {
                  "$ref": "#/components/schemas/RoutingGroup"
                },
                "type": "array"
              },
              "routing_thresholds": {
                "additionalProperties": false,
                "description": "Word-count boundaries of context routes: 0 <= low_max_words <= medium_max_words.",
                "properties": {
                  "low_max_words": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "medium_max_words": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "low_max_words",
                  "medium_max_words"
                ],
                "type": "object"
              },
              "token_based_routing_groups": {
                "items": {
                  "$ref": "#/components/schemas/RoutingGroup"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "self_service": {
            "additionalProperties": false,
            "properties": {
              "enable_self_service": {
                "type": "boolean"
              },
              "self_service": {
                "additionalProperties": true,
                "description": "Self-service configuration, including access-control roles. A save replaces the whole object (send every field you keep), except owners (kept when omitted) and origin (read-only). Omit to keep; null is not accepted.",
                "properties": {
                  "access_control": {
                    "anyOf": [
                      {
                        "additionalProperties": true,
                        "properties": {
                          "self_service_viewer": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "settings_update_direct": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "settings_update_requester": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "show_api_key": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "show_logs_for_all_users": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "version": {
                            "const": 1,
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "max_api_key_ttl_days": {
                    "description": "Longest lifetime, in days, of a personal API key of this app. When set, every new key needs an expiry within it. null or omitted: no limit.",
                    "maximum": 3650,
                    "minimum": 1,
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "origin": {
                    "description": "Present only on apps a person created from a blueprint in self-service. Set by the server; read-only (never changed by a save).",
                    "properties": {
                      "blueprint_app": {
                        "description": "The app it was copied from.",
                        "type": "string"
                      },
                      "blueprint_config_version": {
                        "description": "The blueprint's configuration version at the copy.",
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "created_at": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "created_by": {
                        "description": "Email of the person who created it.",
                        "type": "string"
                      },
                      "kind": {
                        "enum": [
                          "blueprint"
                        ],
                        "type": "string"
                      }
                    },
                    "readOnly": true,
                    "type": "object"
                  },
                  "owners": {
                    "description": "Emails of the app's owners: they review its budget and access requests (and own it when a person created it from a blueprint). A list replaces them; omitted or empty, the stored owners are kept. To remove every owner use PUT /apps/{app_name}/self-service-owners with [].",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 20,
                    "type": "array"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "smart_group_policies": {
            "items": {
              "$ref": "#/components/schemas/GroupPolicy"
            },
            "type": "array"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "transformations": {
            "additionalProperties": false,
            "properties": {
              "response_cache": {
                "$ref": "#/components/schemas/ResponseCache"
              },
              "token_saving": {
                "$ref": "#/components/schemas/TokenSaving"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "AppCreated": {
        "additionalProperties": true,
        "properties": {
          "app": {
            "$ref": "#/components/schemas/AppView"
          },
          "key": {
            "$ref": "#/components/schemas/GatewayKey"
          },
          "operation_id": {
            "type": "string"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "type": "array"
          }
        },
        "required": [
          "app",
          "warnings",
          "key"
        ],
        "type": "object"
      },
      "AppList": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AppView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "AppPatch": {
        "additionalProperties": false,
        "properties": {
          "access": {
            "additionalProperties": false,
            "properties": {
              "allowed_source_ips": {
                "oneOf": [
                  {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "ips": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "allowed_user_domains": {
                "items": {
                  "type": "string"
                },
                "maxItems": 1000,
                "type": "array"
              },
              "allowed_user_emails": {
                "items": {
                  "type": "string"
                },
                "maxItems": 1000,
                "type": "array"
              },
              "enforce_conversation_id": {
                "type": "boolean"
              },
              "enforce_identity": {
                "type": "boolean"
              },
              "identity_header_mode": {
                "type": "boolean"
              },
              "identity_token_headers": {
                "items": {
                  "type": "string"
                },
                "maxItems": 1000,
                "type": "array"
              },
              "identity_token_oid_fallback": {
                "type": "boolean"
              },
              "jwt_auth": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/JwtAuth"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "type": "object"
          },
          "alerting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Alerting"
              },
              {
                "type": "null"
              }
            ]
          },
          "detection": {
            "additionalProperties": false,
            "properties": {
              "attachment_scanning": {
                "$ref": "#/components/schemas/AttachmentScanning"
              },
              "category_actions": {
                "additionalProperties": {
                  "description": "Adversarial detections have no redactable spans; actions they cannot apply are rejected.",
                  "enum": [
                    "monitor",
                    "partial-redact",
                    "tokenize",
                    "redact",
                    "block"
                  ],
                  "type": "string"
                },
                "description": "Category ID to action.",
                "type": "object"
              },
              "category_scopes": {
                "additionalProperties": {
                  "enum": [
                    "request",
                    "response",
                    "both"
                  ],
                  "type": "string"
                },
                "type": "object"
              },
              "category_sensitivities": {
                "additionalProperties": {
                  "items": {
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              },
              "custom_definitions": {
                "description": "Replaces the whole selection; [] clears it. Never deletes definitions.",
                "items": {
                  "$ref": "#/components/schemas/CustomSelection"
                },
                "maxItems": 1000,
                "type": "array"
              },
              "data_risk_action": {
                "enum": [
                  "block",
                  "redact",
                  "partial-redact",
                  "tokenize",
                  "monitor"
                ],
                "type": "string"
              },
              "edm_pattern_sensitivities": {
                "additionalProperties": {
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ],
                  "type": "string"
                },
                "type": "object"
              },
              "enabled_categories": {
                "additionalProperties": {
                  "type": "boolean"
                },
                "description": "Catalog category or subcategory IDs mapped to enabled state. Unknown IDs are rejected.",
                "type": "object"
              },
              "guardian_agent": {
                "$ref": "#/components/schemas/Guardian"
              },
              "hallucination_check_action": {
                "enum": [
                  "block",
                  "monitor"
                ],
                "type": "string"
              },
              "hallucination_check_risk_level": {
                "type": "string"
              },
              "hallucination_check_score_threshold": {
                "maximum": 1,
                "minimum": 0,
                "type": "number"
              },
              "is_hallucination_check_enabled": {
                "type": "boolean"
              },
              "sub_category_actions": {
                "additionalProperties": {
                  "additionalProperties": {
                    "description": "Adversarial detections have no redactable spans; actions they cannot apply are rejected.",
                    "enum": [
                      "monitor",
                      "partial-redact",
                      "tokenize",
                      "redact",
                      "block"
                    ],
                    "type": "string"
                  },
                  "type": "object"
                },
                "description": "Category ID to subcategory name to action.",
                "type": "object"
              },
              "sub_category_sensitivities": {
                "additionalProperties": {
                  "additionalProperties": {
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ],
                    "type": "string"
                  },
                  "type": "object"
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "enabled": {
            "type": "boolean"
          },
          "limits": {
            "additionalProperties": false,
            "properties": {
              "concurrency_per_minute": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "model_rate_limits": {
                "items": {
                  "$ref": "#/components/schemas/ModelLimit"
                },
                "type": "array"
              },
              "rate_limit": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RateLimit"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rate_limit_per_minute": {
                "minimum": 0,
                "type": "integer"
              },
              "timeout": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "token_limits": {
                "$ref": "#/components/schemas/TokenLimits"
              }
            },
            "type": "object"
          },
          "prompts": {
            "additionalProperties": false,
            "properties": {
              "require_system_from_store": {
                "type": "boolean"
              },
              "universal_system_prompt": {
                "additionalProperties": false,
                "description": "Prepended to the system prompt of every request when enabled; partial objects merge onto the stored value.",
                "properties": {
                  "content": {
                    "maxLength": 100000,
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "provider_labels": {
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "routing": {
            "additionalProperties": false,
            "properties": {
              "custom_routing": {
                "items": {
                  "$ref": "#/components/schemas/ContextRoute"
                },
                "type": "array"
              },
              "routing_groups": {
                "items": {
                  "$ref": "#/components/schemas/RoutingGroup"
                },
                "type": "array"
              },
              "routing_thresholds": {
                "additionalProperties": false,
                "description": "Word-count boundaries of context routes: 0 <= low_max_words <= medium_max_words.",
                "properties": {
                  "low_max_words": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "medium_max_words": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "low_max_words",
                  "medium_max_words"
                ],
                "type": "object"
              },
              "token_based_routing_groups": {
                "items": {
                  "$ref": "#/components/schemas/RoutingGroup"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "self_service": {
            "additionalProperties": false,
            "properties": {
              "enable_self_service": {
                "type": "boolean"
              },
              "self_service": {
                "additionalProperties": true,
                "description": "Self-service configuration, including access-control roles. A save replaces the whole object (send every field you keep), except owners (kept when omitted) and origin (read-only). Omit to keep; null is not accepted.",
                "properties": {
                  "access_control": {
                    "anyOf": [
                      {
                        "additionalProperties": true,
                        "properties": {
                          "self_service_viewer": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "settings_update_direct": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "settings_update_requester": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "show_api_key": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "show_logs_for_all_users": {
                            "$ref": "#/components/schemas/AccessRule"
                          },
                          "version": {
                            "const": 1,
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "max_api_key_ttl_days": {
                    "description": "Longest lifetime, in days, of a personal API key of this app. When set, every new key needs an expiry within it. null or omitted: no limit.",
                    "maximum": 3650,
                    "minimum": 1,
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "origin": {
                    "description": "Present only on apps a person created from a blueprint in self-service. Set by the server; read-only (never changed by a save).",
                    "properties": {
                      "blueprint_app": {
                        "description": "The app it was copied from.",
                        "type": "string"
                      },
                      "blueprint_config_version": {
                        "description": "The blueprint's configuration version at the copy.",
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "created_at": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "created_by": {
                        "description": "Email of the person who created it.",
                        "type": "string"
                      },
                      "kind": {
                        "enum": [
                          "blueprint"
                        ],
                        "type": "string"
                      }
                    },
                    "readOnly": true,
                    "type": "object"
                  },
                  "owners": {
                    "description": "Emails of the app's owners: they review its budget and access requests (and own it when a person created it from a blueprint). A list replaces them; omitted or empty, the stored owners are kept. To remove every owner use PUT /apps/{app_name}/self-service-owners with [].",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 20,
                    "type": "array"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "smart_group_policies": {
            "items": {
              "$ref": "#/components/schemas/GroupPolicy"
            },
            "type": "array"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "transformations": {
            "additionalProperties": false,
            "properties": {
              "response_cache": {
                "$ref": "#/components/schemas/ResponseCache"
              },
              "token_saving": {
                "$ref": "#/components/schemas/TokenSaving"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "AppResponse": {
        "additionalProperties": true,
        "properties": {
          "app": {
            "$ref": "#/components/schemas/AppView"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "type": "array"
          }
        },
        "required": [
          "app",
          "warnings"
        ],
        "type": "object"
      },
      "AppView": {
        "additionalProperties": true,
        "properties": {
          "access": {
            "description": "Stored settings of this section; secret values are omitted.",
            "type": "object"
          },
          "alerting": {
            "type": "object"
          },
          "detection": {
            "description": "Stored settings of this section; secret values are omitted.",
            "type": "object"
          },
          "enabled": {
            "type": "boolean"
          },
          "limits": {
            "description": "Stored settings of this section; secret values are omitted.",
            "type": "object"
          },
          "mode": {
            "enum": [
              "gateway",
              "sdk",
              "copilot_studio"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "origin": {
            "description": "Present only on apps a person created from a blueprint in self-service. Set by the server; read-only (never changed by a save).",
            "properties": {
              "blueprint_app": {
                "description": "The app it was copied from.",
                "type": "string"
              },
              "blueprint_config_version": {
                "description": "The blueprint's configuration version at the copy.",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_by": {
                "description": "Email of the person who created it.",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "blueprint"
                ],
                "type": "string"
              }
            },
            "readOnly": true,
            "type": "object"
          },
          "policy_authority": {
            "$ref": "#/components/schemas/PolicyAuthority"
          },
          "prompts": {
            "description": "Stored settings of this section; secret values are omitted.",
            "type": "object"
          },
          "provider_labels": {
            "description": "Attached shared providers; the first is primary.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "provider_mode": {
            "description": "inline apps keep legacy per-app credentials until converted.",
            "enum": [
              "shared",
              "inline"
            ],
            "type": "string"
          },
          "routing": {
            "description": "Stored settings of this section; secret values are omitted.",
            "type": "object"
          },
          "self_service": {
            "description": "Stored settings of this section; secret values are omitted.",
            "type": "object"
          },
          "smart_group_policies": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "transformations": {
            "description": "Stored settings of this section; secret values are omitted.",
            "type": "object"
          },
          "version": {
            "description": "Opaque resource version. Send its quoted value in If-Match.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "mode",
          "enabled",
          "version"
        ],
        "type": "object"
      },
      "Attachment": {
        "additionalProperties": false,
        "properties": {
          "primary": {
            "default": false,
            "description": "Move the provider first (primary).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "AttachmentList": {
        "additionalProperties": true,
        "properties": {
          "provider_labels": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "description": "Opaque resource version. Send its quoted value in If-Match.",
            "type": "string"
          }
        },
        "required": [
          "provider_labels",
          "version"
        ],
        "type": "object"
      },
      "AttachmentScanning": {
        "additionalProperties": false,
        "description": "Request attachment scanning (images, PDFs, office documents): limits, text extraction and actions. Off by default. Partial updates merge. Under QuilrQL the policy decides enabled; attachments.* effects override the other fields (type_actions per kind).",
        "properties": {
          "enabled": {
            "default": false,
            "type": "boolean"
          },
          "image_classification": {
            "default": true,
            "type": "boolean"
          },
          "max_file_bytes": {
            "default": 20971520,
            "maximum": 536870912,
            "minimum": 1,
            "type": "integer"
          },
          "max_files": {
            "default": 20,
            "maximum": 1000,
            "minimum": 1,
            "type": "integer"
          },
          "max_request_bytes": {
            "default": 52428800,
            "maximum": 2147483648,
            "minimum": 1,
            "type": "integer"
          },
          "ocr": {
            "default": "no_text_layer",
            "enum": [
              "off",
              "no_text_layer",
              "always"
            ]
          },
          "ocr_scripts": {
            "default": [],
            "items": {
              "enum": [
                "latin",
                "cjk",
                "korean",
                "cyrillic",
                "arabic",
                "devanagari",
                "tamil",
                "telugu",
                "thai",
                "greek"
              ]
            },
            "type": "array"
          },
          "on_limit_violation": {
            "default": "block",
            "enum": [
              "monitor",
              "strip",
              "block"
            ]
          },
          "on_macros": {
            "default": "monitor",
            "enum": [
              "monitor",
              "strip",
              "block"
            ]
          },
          "on_unscannable": {
            "default": "monitor",
            "description": "What happens to an attachment the file itself makes unscannable: encrypted, unparseable, a remote URL or a provider file ID. Scan failures (timeouts, scanner errors, text past the scan limit) always fail open and never use this action.",
            "enum": [
              "monitor",
              "strip",
              "block"
            ]
          },
          "pdf_max_pages": {
            "default": 200,
            "maximum": 10000,
            "minimum": 1,
            "type": "integer"
          },
          "redact_documents_as_text": {
            "default": false,
            "type": "boolean"
          },
          "text_extraction": {
            "default": true,
            "type": "boolean"
          },
          "type_actions": {
            "additionalProperties": false,
            "default": {},
            "description": "Per detected kind: allow, strip or block. Kinds not listed are allowed; updates merge per kind and {} resets every kind to allow.",
            "properties": {
              "archive": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "audio": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "document": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "image": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "other": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "pdf": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "presentation": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "spreadsheet": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "text": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              },
              "video": {
                "enum": [
                  "allow",
                  "strip",
                  "block"
                ]
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "AuditEvent": {
        "additionalProperties": true,
        "properties": {
          "actor": {
            "description": "Management key ID or tenant administrator.",
            "type": "string"
          },
          "actor_name": {
            "description": "The management key's name; null for other actors or a deleted key.",
            "type": [
              "string",
              "null"
            ]
          },
          "changes": {
            "type": "object"
          },
          "created_at": {
            "description": "Unix epoch seconds, potentially fractional.",
            "type": "number"
          },
          "event_id": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "resource": {
            "type": "string"
          },
          "result": {
            "description": "committed, or the error code of a rejected write.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AuditPage": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/AuditEvent"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "BudgetAdjustments": {
        "additionalProperties": false,
        "properties": {
          "auto_approve": {
            "additionalProperties": false,
            "description": "Reserved for request-a-change approvals; inactive. Use auto_raise for automatic raises.",
            "properties": {
              "max_count": {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "per": {
                "enum": [
                  "day",
                  "week",
                  "month"
                ]
              },
              "smart_groups": {
                "items": {
                  "type": "string"
                },
                "maxItems": 32,
                "type": "array"
              },
              "up_to_pct": {
                "maximum": 1000,
                "minimum": 1,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "auto_raise": {
            "additionalProperties": false,
            "description": "Automatic raises (calendar budgets only): a grant with source auto that ends at the reset (or after max_duration, if sooner), never above ceiling. Turning it off stops new raises; raises already made stay until they end or are revoked. Automatic raises supersede only earlier automatic ones, so an admin's grant applies again at the reset; a subject whose limit an admin lowered is never raised.",
            "properties": {
              "add_pct": {
                "description": "Each raise adds this percent of the base limit",
                "maximum": 1000,
                "minimum": 1,
                "type": "integer"
              },
              "at_pct": {
                "description": "Raise once usage reaches this percent of the limit; omitted: when the limit is reached (the refused request is admitted after the raise)",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "enabled": {
                "description": "Nothing happens unless true",
                "type": "boolean"
              },
              "max_count": {
                "default": 1,
                "description": "Raises per subject per window",
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              "smart_groups": {
                "description": "Only requests from people in these Smart groups trigger a raise (omitted or empty: anyone the budget counts). On a shared bucket (an app or group pool) the raise applies to the whole bucket.",
                "items": {
                  "type": "string"
                },
                "maxItems": 32,
                "type": "array"
              }
            },
            "required": [
              "enabled",
              "add_pct"
            ],
            "type": "object"
          },
          "ceiling": {
            "description": "Highest grant limit (USD for spend); >= limit",
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "max_duration": {
            "description": "1h..366d (default 366d), or \"unlimited\" to allow grants with no end date",
            "pattern": "^(\\d+[hd]|unlimited)$",
            "type": "string"
          },
          "overflow": {
            "additionalProperties": false,
            "properties": {
              "add_pct": {
                "maximum": 1000,
                "minimum": 1,
                "type": "integer"
              }
            },
            "required": [
              "add_pct"
            ],
            "type": "object"
          },
          "requestable": {
            "default": false,
            "description": "Reserved: no request-a-change flow exists yet; saving it changes nothing",
            "type": "boolean"
          }
        },
        "required": [
          "ceiling"
        ],
        "type": "object"
      },
      "BudgetAlertDestinations": {
        "additionalProperties": false,
        "properties": {
          "destinations": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "enabled": {
                  "default": true,
                  "type": "boolean"
                },
                "id": {
                  "pattern": "^[A-Za-z0-9_.-]{1,64}$",
                  "type": "string"
                },
                "kind": {
                  "enum": [
                    "webhook"
                  ]
                },
                "target": {
                  "description": "https URL; omit, null or the redacted read value to keep the stored target",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "kind"
              ],
              "type": "object"
            },
            "maxItems": 20,
            "type": "array"
          }
        },
        "required": [
          "destinations"
        ],
        "type": "object"
      },
      "BudgetAlertDestinationsView": {
        "properties": {
          "destinations": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "etag": {
            "description": "Optional If-Match of PUT (412 version_conflict when changed)",
            "type": "string"
          }
        },
        "required": [
          "destinations",
          "etag"
        ],
        "type": "object"
      },
      "BudgetAlertsPage": {
        "additionalProperties": true,
        "properties": {
          "available": {
            "description": "false while alert history is not yet available.",
            "type": "boolean"
          },
          "items": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "fired_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "quota": {
                  "additionalProperties": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "metric": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "BudgetBatch": {
        "additionalProperties": false,
        "properties": {
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "ops": {
            "items": {
              "properties": {
                "body": {
                  "description": "The op's payload, as in /controls/_batch: the patch changes, new budget, rate, exemption or unpriced_models value. Older per-op keys (changes, budget, rate, exemption, value) are still accepted.",
                  "type": [
                    "object",
                    "string",
                    "null"
                  ]
                },
                "budget": {
                  "$ref": "#/components/schemas/BudgetCreate"
                },
                "changes": {
                  "$ref": "#/components/schemas/BudgetPatch"
                },
                "exemption": {
                  "$ref": "#/components/schemas/BudgetExemption"
                },
                "exemption_id": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "if_match": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "op": {
                  "enum": [
                    "patch",
                    "create",
                    "delete",
                    "put_rate",
                    "delete_rate",
                    "set_unpriced_models",
                    "create_exemption",
                    "delete_exemption"
                  ]
                },
                "provider": {
                  "type": "string"
                },
                "provider_label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "rate": {
                  "additionalProperties": false,
                  "description": "One model rate (provider/model come from the path). Rates are USD per 1M tokens (*_usd_per_1m), tool fees USD per 1k calls / hour / session, multipliers > 0; each a number or a decimal string (\"0.15\"). At least one rate, fee, multiplier, tiers or cache_write_default_ttl.",
                  "properties": {
                    "audio_input_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "audio_output_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "cache_read_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "cache_write_1h_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "cache_write_5m_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "cache_write_default_ttl": {
                      "enum": [
                        "5m",
                        "1h",
                        "unpriced"
                      ]
                    },
                    "cache_write_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "code_execution_usd_per_hour": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "container_usd_per_session": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "file_search_usd_per_1k": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "grounding_usd_per_1k": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "image_input_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "image_output_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "input_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "message": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "model": {
                      "description": "Optional; must equal the path value",
                      "type": "string"
                    },
                    "output_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "provider": {
                      "description": "Optional; must equal the path value",
                      "type": "string"
                    },
                    "provider_label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reasoning_usd_per_1m": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "regional_multipliers": {
                      "additionalProperties": false,
                      "properties": {
                        "data_residency": {
                          "oneOf": [
                            {
                              "exclusiveMinimum": 0,
                              "type": "number"
                            },
                            {
                              "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                              "type": "string"
                            }
                          ]
                        },
                        "geo": {
                          "oneOf": [
                            {
                              "exclusiveMinimum": 0,
                              "type": "number"
                            },
                            {
                              "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                              "type": "string"
                            }
                          ]
                        },
                        "regional": {
                          "oneOf": [
                            {
                              "exclusiveMinimum": 0,
                              "type": "number"
                            },
                            {
                              "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                              "type": "string"
                            }
                          ]
                        },
                        "us_only": {
                          "oneOf": [
                            {
                              "exclusiveMinimum": 0,
                              "type": "number"
                            },
                            {
                              "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                              "type": "string"
                            }
                          ]
                        }
                      },
                      "type": "object"
                    },
                    "service_tier_multipliers": {
                      "additionalProperties": false,
                      "properties": {
                        "fast": {
                          "oneOf": [
                            {
                              "exclusiveMinimum": 0,
                              "type": "number"
                            },
                            {
                              "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                              "type": "string"
                            }
                          ]
                        },
                        "flex": {
                          "oneOf": [
                            {
                              "exclusiveMinimum": 0,
                              "type": "number"
                            },
                            {
                              "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                              "type": "string"
                            }
                          ]
                        },
                        "priority": {
                          "oneOf": [
                            {
                              "exclusiveMinimum": 0,
                              "type": "number"
                            },
                            {
                              "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                              "type": "string"
                            }
                          ]
                        }
                      },
                      "type": "object"
                    },
                    "tiers": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "above_input_tokens": {
                            "maximum": 9007199254740991,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "audio_input_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "audio_output_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "cache_read_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "cache_write_1h_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "cache_write_5m_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "cache_write_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "image_input_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "image_output_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "input_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "output_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          },
                          "reasoning_usd_per_1m": {
                            "oneOf": [
                              {
                                "minimum": 0,
                                "type": "number"
                              },
                              {
                                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                                "type": "string"
                              }
                            ]
                          }
                        },
                        "required": [
                          "above_input_tokens"
                        ],
                        "type": "object"
                      },
                      "maxItems": 8,
                      "minItems": 1,
                      "type": "array"
                    },
                    "web_fetch_usd_per_1k": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    },
                    "web_search_usd_per_1k": {
                      "oneOf": [
                        {
                          "minimum": 0,
                          "type": "number"
                        },
                        {
                          "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                          "type": "string"
                        }
                      ]
                    }
                  },
                  "type": "object"
                },
                "value": {
                  "enum": [
                    "zero",
                    "block",
                    null
                  ],
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "op"
              ],
              "type": "object"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "ops"
        ],
        "type": "object"
      },
      "BudgetBurnRateItem": {
        "properties": {
          "bucket": {
            "type": "string"
          },
          "effective_limit": {
            "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "forecast": {
            "$ref": "#/components/schemas/BudgetForecast"
          },
          "grant": {
            "oneOf": [
              {
                "properties": {
                  "auto_raise": {
                    "description": "Set on automatic raises: {step, of, window}",
                    "type": "object"
                  },
                  "expires_at": {
                    "description": "null: no end date",
                    "format": "date-time",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "extra": {
                    "description": "Set on an extra grant: limit = base + extra",
                    "oneOf": [
                      {
                        "description": "spend: decimal USD",
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  },
                  "id": {
                    "type": "string"
                  },
                  "limit": {
                    "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                    "oneOf": [
                      {
                        "description": "spend: decimal USD",
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  },
                  "members_of": {
                    "description": "Set when the limit comes from a Smart group grant to this group",
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "pct": {
            "type": "number"
          },
          "state": {
            "enum": [
              "ok",
              "alerting",
              "granted",
              "overflow",
              "blocked"
            ]
          },
          "subject": {
            "type": "object"
          },
          "used": {
            "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          }
        },
        "required": [
          "bucket",
          "used",
          "effective_limit",
          "forecast"
        ],
        "type": "object"
      },
      "BudgetBurnRatePage": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "type": "string"
          },
          "budget": {
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BudgetBurnRateItem"
            },
            "type": "array"
          },
          "lookback": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "period": {
            "type": "string"
          },
          "period_not_supported": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "series": {
            "description": "Hourly usage over the lookback, when exactly one subject matches; the first hour is partial when the lookback starts inside it",
            "items": {
              "properties": {
                "hour": {
                  "format": "date-time",
                  "type": "string"
                },
                "used": {
                  "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                  "oneOf": [
                    {
                      "description": "spend: decimal USD",
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    }
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "series_truncated": {
            "type": "boolean"
          },
          "snapshot": {
            "description": "Usage snapshot the page was cut from (= as_of; informational). Cursors are keyset (last row's sort key) and stay valid across snapshots; rows whose values changed between pages may move.",
            "type": "string"
          },
          "stale": {
            "type": "boolean"
          },
          "total": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          },
          "window": {
            "properties": {
              "reset_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "start": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": "object"
          }
        },
        "required": [
          "items",
          "snapshot"
        ],
        "type": "object"
      },
      "BudgetCreate": {
        "additionalProperties": false,
        "properties": {
          "adjustments": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BudgetAdjustments"
              },
              {
                "type": "null"
              }
            ]
          },
          "alerts": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "at_pct": {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "at_pct"
              ],
              "type": "object"
            },
            "maxItems": 5,
            "type": [
              "array",
              "null"
            ]
          },
          "applies_to": {
            "additionalProperties": false,
            "properties": {
              "apps": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "family": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
            "type": "string"
          },
          "kind": {
            "enum": [
              "budget",
              "rate",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "maxLength": 120,
            "type": [
              "string",
              "null"
            ]
          },
          "limit": {
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "metric": {
            "type": "string"
          },
          "missing_id": {
            "description": "Only for budgets counted per conversation, agent or agent_run. skip (default): a request without that id is not counted. refuse: it is answered 400 quota_id_required, listing the accepted id sources. Explicit ids (x-conversation-id, x-quilr-agent-id, x-quilr-agent-run-id, body metadata) win; otherwise the ids well-known clients send count (Claude Code session and subagent, Codex, OpenCode, Copilot Studio, Responses conversation, ...). A coding tool session can last many hours.",
            "enum": [
              "skip",
              "refuse",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "enum": [
              "enforce",
              "alert",
              "paused",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "one_time": {
            "description": "Required true on a new lifetime budget (window {\"kind\": \"lifetime\"}): confirms an allowance that never resets (else 422 lifetime_requires_one_time). Valid only with a lifetime window (422 invalid_quota_one_time). Returned only when true.",
            "type": "boolean"
          },
          "per": {
            "description": "group_by fields, or aliases (user, app = application.name = application.group_key, smart_group, model, conversation, agent, agent_run, ...); responses return field names.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "window": {
            "type": "object"
          }
        },
        "required": [
          "metric",
          "limit",
          "window"
        ],
        "type": "object"
      },
      "BudgetDelete": {
        "additionalProperties": false,
        "properties": {
          "message": {
            "description": "Recorded with the policy revision.",
            "maxLength": 500,
            "type": "string"
          }
        },
        "type": "object"
      },
      "BudgetEditResult": {
        "properties": {
          "budget": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BudgetRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "budgets": {
            "items": {
              "$ref": "#/components/schemas/BudgetRecord"
            },
            "type": "array"
          },
          "changed": {
            "type": "boolean"
          },
          "created_budget_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "deleted_budget_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "diagnostics": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "diff": {
            "type": "string"
          },
          "dry_run": {
            "type": "boolean"
          },
          "etag": {
            "description": "Policy etag \"r<revision>\" (a budget's etag on budget writes)",
            "type": "string"
          },
          "exemption": {
            "type": [
              "object",
              "null"
            ]
          },
          "grants_revoked": {
            "description": "Grant ids revoked by this write: the live grants of a deleted budget, or old grants left on a budget id created again. Omitted when none.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "impact": {
            "type": [
              "object",
              "null"
            ]
          },
          "ops": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "previous_revision": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "set": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BudgetSetView"
              },
              {
                "type": "null"
              }
            ]
          },
          "warnings": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "would_publish": {
            "type": "boolean"
          }
        },
        "required": [
          "revision",
          "changed"
        ],
        "type": "object"
      },
      "BudgetEvent": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "after": {
            "type": [
              "object",
              "null"
            ]
          },
          "before": {
            "description": "budget.<op>: revision plus the changed fields under budgets / exemptions / pricing (null = absent); {truncated: true} when large",
            "type": [
              "object",
              "null"
            ]
          },
          "bucket": {
            "type": [
              "string",
              "null"
            ]
          },
          "budget_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "event_id": {
            "type": "string"
          },
          "grant_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "subject": {
            "type": [
              "object",
              "null"
            ]
          },
          "type": {
            "description": "grant.* or budget.<op> (API policy edits)",
            "type": "string"
          }
        },
        "required": [
          "event_id",
          "type",
          "occurred_at"
        ],
        "type": "object"
      },
      "BudgetEventsPage": {
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BudgetEvent"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as after= for the next page / poll",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "has_more"
        ],
        "type": "object"
      },
      "BudgetExemption": {
        "additionalProperties": false,
        "properties": {
          "applies_to": {
            "additionalProperties": false,
            "properties": {
              "apps": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "expires_at": {
            "description": "Any RFC 3339 instant; stored as rule.expires_at in UTC second precision (YYYY-MM-DDTHH:MM:SSZ), fractional seconds rounded up.",
            "format": "date-time",
            "type": "string"
          },
          "families": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "kinds": {
            "items": {
              "enum": [
                "budget",
                "rate"
              ]
            },
            "type": "array"
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "quotas": {
            "oneOf": [
              {
                "const": "all"
              },
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              }
            ]
          },
          "reason": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "quotas",
          "reason"
        ],
        "type": "object"
      },
      "BudgetExemptionList": {
        "properties": {
          "etag": {
            "description": "Optional If-Match (\"r<revision>\") of exemption POST/DELETE",
            "type": "string"
          },
          "items": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "BudgetForecast": {
        "properties": {
          "exhausted": {
            "description": "Already at or over the effective limit",
            "type": "boolean"
          },
          "exhausts_at": {
            "description": "When the limit is reached at this rate; null if not before the reset",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "lookback_hours": {
            "description": "Hours the rate was measured over",
            "type": "number"
          },
          "projected_pct": {
            "description": "projected_total as a percent of the effective limit",
            "type": [
              "number",
              "null"
            ]
          },
          "projected_total": {
            "description": "used + rate_per_hour x hours until reset_at",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "rate_per_hour": {
            "description": "Spend as decimal USD; requests/tokens as a number (may be fractional)",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          }
        },
        "required": [
          "rate_per_hour",
          "projected_total",
          "exhausted",
          "exhausts_at"
        ],
        "type": "object"
      },
      "BudgetForecastPage": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "type": "string"
          },
          "items": {
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/BudgetBurnRateItem"
                },
                {
                  "properties": {
                    "budget": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "metric": {
                          "type": "string"
                        },
                        "mode": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            "type": "array"
          },
          "lookback": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "not_forecast": {
            "description": "Budgets with rolling or lifetime windows, which are not forecast",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "period": {
            "type": "string"
          },
          "period_not_supported": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "snapshot": {
            "description": "Usage snapshot the page was cut from (= as_of; informational). Cursors are keyset (last row's sort key) and stay valid across snapshots; rows whose values changed between pages may move.",
            "type": "string"
          },
          "stale": {
            "type": "boolean"
          },
          "total": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          },
          "within": {
            "type": "string"
          }
        },
        "required": [
          "items",
          "snapshot"
        ],
        "type": "object"
      },
      "BudgetGet": {
        "properties": {
          "budget": {
            "$ref": "#/components/schemas/BudgetRecord"
          },
          "etag": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "BudgetGrant": {
        "additionalProperties": false,
        "oneOf": [
          {
            "required": [
              "limit"
            ]
          },
          {
            "required": [
              "extra"
            ]
          }
        ],
        "properties": {
          "expires_at": {
            "description": "null or omitted: no end date (only when adjustments.max_duration is \"unlimited\")",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "extra": {
            "description": "Added to the budget's base limit; the grant's limit follows the base (base + extra, also after a later base change), capped by adjustments.ceiling. Give exactly one of limit or extra.",
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "limit": {
            "description": "Absolute limit. Give exactly one of limit or extra.",
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "type": "string"
          },
          "starts_at": {
            "description": "Default now. A later start lists the grant as scheduled until then.",
            "format": "date-time",
            "type": "string"
          },
          "subject": {
            "description": "One bucket of the budget: {\"user\": email}, {\"app\": name}, {\"smart_group\": g}, {\"model\": m}, raw {\"<group_by field>\": value}, or {\"bucket\": \"<canonical>\"}; every group_by field must be supplied (422 subject_unresolved / subject_not_in_budget). {\"members_of\": \"<Smart group>\"} is a Smart group grant: every current member of the group gets it (members joining or leaving follow automatically; a member's own grant wins, and a member of several granted groups gets the best-ranked group's). Only on budgets counted per person by email (per: [\"user.email\"]), else 422 group_grant_not_supported.",
            "type": "object"
          }
        },
        "required": [
          "subject"
        ],
        "type": "object"
      },
      "BudgetGrantBulk": {
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "description": "null or omitted: no end date (only when adjustments.max_duration is \"unlimited\")",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "extra": {
            "description": "Default amount added to the base for every item (follows the base, like a grant's extra).",
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "grants": {
            "items": {
              "type": "object"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "limit": {
            "description": "Default absolute limit for every item (an item's own limit or extra replaces it).",
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "reason": {
            "maxLength": 1000,
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "subjects_from": {
            "additionalProperties": false,
            "properties": {
              "smart_group": {
                "type": "string"
              }
            },
            "required": [
              "smart_group"
            ],
            "type": "object"
          }
        },
        "type": "object"
      },
      "BudgetGrantBulkResult": {
        "properties": {
          "errors": {
            "items": {
              "properties": {
                "code": {
                  "type": "string"
                },
                "index": {
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "items": {
            "items": {
              "properties": {
                "grant": {
                  "$ref": "#/components/schemas/BudgetGrantView"
                },
                "index": {
                  "type": "integer"
                },
                "superseded": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BudgetGrantView"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "items",
          "errors"
        ],
        "type": "object"
      },
      "BudgetGrantList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/BudgetGrantView"
            },
            "type": "array"
          },
          "members_as_of": {
            "description": "When the members summaries' usage was read",
            "format": "date-time",
            "type": "string"
          },
          "members_stale": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "usage_as_of": {
            "format": "date-time",
            "type": "string"
          },
          "usage_stale": {
            "type": "boolean"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "BudgetGrantPatch": {
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "description": "Omitted: unchanged. null: no end date (only when adjustments.max_duration is \"unlimited\")",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "extra": {
            "description": "New amount on top of the base (the grant then follows the base). Not with limit.",
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "limit": {
            "description": "New absolute limit (an extra grant becomes absolute).",
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "reason": {
            "maxLength": 1000,
            "type": "string"
          }
        },
        "type": "object"
      },
      "BudgetGrantResult": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "grant": {
            "$ref": "#/components/schemas/BudgetGrantView"
          },
          "superseded": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BudgetGrantView"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "grant"
        ],
        "type": "object"
      },
      "BudgetGrantRevoke": {
        "additionalProperties": false,
        "properties": {
          "reason": {
            "maxLength": 1000,
            "type": "string"
          }
        },
        "type": "object"
      },
      "BudgetGrantView": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "auto_raise": {
            "description": "Set only on automatic raises (source auto): {step, of, window}. subject still names the person or app.",
            "type": "object"
          },
          "base_limit": {
            "oneOf": [
              {
                "description": "The budget's own limit (null when the budget was deleted). When the grant ends, another grant may apply instead: a Smart group grant covering the person, or an admin grant under an automatic raise.",
                "oneOf": [
                  {
                    "description": "spend: decimal USD",
                    "type": "string"
                  },
                  {
                    "type": "integer"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "bucket": {
            "type": "string"
          },
          "budget_id": {
            "type": "string"
          },
          "budget_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "etag": {
            "description": "If-Match for grant PATCH/DELETE (\"<version>\")",
            "type": "string"
          },
          "expires_at": {
            "description": "null: no end date",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "extra": {
            "description": "Set only on an extra grant: the amount added to the base",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "limit": {
            "description": "The grant's limit: absolute, or base + extra for an extra grant (follows the budget's current base; the ceiling caps it when applied)",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "members": {
            "oneOf": [
              {
                "description": "Smart group grants only: the group's current members by where their limit comes from. List them with GET /budgets/{budget_id}/usage?members_of=<group>. null when it cannot be worked out (see members_reason).",
                "properties": {
                  "at_limit": {
                    "description": "Members at or over their current limit",
                    "type": "integer"
                  },
                  "count": {
                    "description": "Current members of the group",
                    "type": "integer"
                  },
                  "on_this_grant": {
                    "description": "Members whose limit is this grant now",
                    "type": "integer"
                  },
                  "other_group": {
                    "description": "Members covered by a better-ranked group's grant",
                    "type": "integer"
                  },
                  "own_grant": {
                    "description": "Members with a grant of their own, which wins",
                    "type": "integer"
                  },
                  "used": {
                    "description": "The members' combined usage this window",
                    "oneOf": [
                      {
                        "description": "spend: decimal USD",
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  }
                },
                "required": [
                  "count",
                  "on_this_grant",
                  "own_grant",
                  "other_group",
                  "at_limit",
                  "used"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "members_reason": {
            "description": "Set when members is null. grant_not_in_effect: a scheduled or ended grant covers no one now.",
            "enum": [
              "grant_not_in_effect",
              "group_not_found",
              "membership_unavailable",
              "budget_not_found",
              "budget_not_per_person",
              "usage_incomplete",
              "usage_unavailable"
            ]
          },
          "metric": {
            "type": [
              "string",
              "null"
            ]
          },
          "no_end_date": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "active: in effect now; scheduled: starts_at is later (not in effect yet); expired: ended; revoked / superseded: ended by a change.",
            "enum": [
              "active",
              "scheduled",
              "revoked",
              "superseded",
              "expired"
            ]
          },
          "subject": {
            "type": "object"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "usage": {
            "oneOf": [
              {
                "properties": {
                  "pct": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "used": {
                    "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                    "oneOf": [
                      {
                        "description": "spend: decimal USD",
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "description": "updated_at in epoch microseconds",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "budget_id",
          "bucket",
          "limit",
          "expires_at",
          "status",
          "etag"
        ],
        "type": "object"
      },
      "BudgetList": {
        "properties": {
          "caller": {
            "properties": {
              "can_edit_policy": {
                "type": "boolean"
              },
              "can_grant": {
                "type": "boolean"
              },
              "can_read": {
                "type": "boolean"
              },
              "scopes": {
                "items": {
                  "enum": [
                    "budgets:read",
                    "budgets:grant",
                    "budgets:policy"
                  ]
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BudgetRecord"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "policy_engine": {
            "properties": {
              "active_revision": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "enabled": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "caller"
        ],
        "type": "object"
      },
      "BudgetPatch": {
        "description": "Identity fields (id, metric, per/group_by, window) are immutable (422 identity_field_immutable); applies_to only on API-managed budgets.",
        "properties": {
          "adjustments": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BudgetAdjustments"
              },
              {
                "type": "null"
              }
            ]
          },
          "alerts": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "at_pct": {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "at_pct"
              ],
              "type": "object"
            },
            "maxItems": 5,
            "type": [
              "array",
              "null"
            ]
          },
          "applies_to": {
            "additionalProperties": false,
            "properties": {
              "apps": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "family": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "budget",
              "rate",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "maxLength": 120,
            "type": [
              "string",
              "null"
            ]
          },
          "limit": {
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "missing_id": {
            "description": "Only for budgets counted per conversation, agent or agent_run. skip (default): a request without that id is not counted. refuse: it is answered 400 quota_id_required, listing the accepted id sources. Explicit ids (x-conversation-id, x-quilr-agent-id, x-quilr-agent-run-id, body metadata) win; otherwise the ids well-known clients send count (Claude Code session and subagent, Codex, OpenCode, Copilot Studio, Responses conversation, ...). A coding tool session can last many hours.",
            "enum": [
              "skip",
              "refuse",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "enum": [
              "enforce",
              "alert",
              "paused",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "one_time": {
            "description": "Required true on a new lifetime budget (window {\"kind\": \"lifetime\"}): confirms an allowance that never resets (else 422 lifetime_requires_one_time). Valid only with a lifetime window (422 invalid_quota_one_time). Returned only when true.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "BudgetPricingPatch": {
        "additionalProperties": false,
        "properties": {
          "unpriced_models": {
            "enum": [
              "zero",
              "block",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "unpriced_models"
        ],
        "type": "object"
      },
      "BudgetPricingView": {
        "additionalProperties": true,
        "properties": {
          "conditional_rates_present": {
            "type": "boolean"
          },
          "effective": {
            "description": "Every configured provider and model with its effective price and price source.",
            "items": {
              "additionalProperties": true,
              "properties": {
                "model": {
                  "type": "string"
                },
                "provider": {
                  "type": "string"
                },
                "provider_label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source": {
                  "enum": [
                    "policy",
                    "provider",
                    "catalog",
                    "mixed",
                    "unpriced"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "etag": {
            "description": "Optional If-Match of pricing writes (\"r<revision>\").",
            "type": "string"
          },
          "open_ended": {
            "description": "Providers whose apps may call any model.",
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "rates": {
            "description": "Tenant-wide rate items set through this API or policy.",
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "revision": {
            "type": "integer"
          },
          "unpriced_models": {
            "description": "How requests to models without a price are charged.",
            "enum": [
              "zero",
              "block",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "revision",
          "etag"
        ],
        "type": "object"
      },
      "BudgetRate": {
        "additionalProperties": false,
        "description": "One model rate (provider/model come from the path). Rates are USD per 1M tokens (*_usd_per_1m), tool fees USD per 1k calls / hour / session, multipliers > 0; each a number or a decimal string (\"0.15\"). At least one rate, fee, multiplier, tiers or cache_write_default_ttl.",
        "properties": {
          "audio_input_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "audio_output_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "cache_read_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "cache_write_1h_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "cache_write_5m_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "cache_write_default_ttl": {
            "enum": [
              "5m",
              "1h",
              "unpriced"
            ]
          },
          "cache_write_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "code_execution_usd_per_hour": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "container_usd_per_session": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "file_search_usd_per_1k": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "grounding_usd_per_1k": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "image_input_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "image_output_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "input_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "model": {
            "description": "Optional; must equal the path value",
            "type": "string"
          },
          "output_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "provider": {
            "description": "Optional; must equal the path value",
            "type": "string"
          },
          "provider_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "reasoning_usd_per_1m": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "regional_multipliers": {
            "additionalProperties": false,
            "properties": {
              "data_residency": {
                "oneOf": [
                  {
                    "exclusiveMinimum": 0,
                    "type": "number"
                  },
                  {
                    "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                    "type": "string"
                  }
                ]
              },
              "geo": {
                "oneOf": [
                  {
                    "exclusiveMinimum": 0,
                    "type": "number"
                  },
                  {
                    "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                    "type": "string"
                  }
                ]
              },
              "regional": {
                "oneOf": [
                  {
                    "exclusiveMinimum": 0,
                    "type": "number"
                  },
                  {
                    "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                    "type": "string"
                  }
                ]
              },
              "us_only": {
                "oneOf": [
                  {
                    "exclusiveMinimum": 0,
                    "type": "number"
                  },
                  {
                    "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                    "type": "string"
                  }
                ]
              }
            },
            "type": "object"
          },
          "service_tier_multipliers": {
            "additionalProperties": false,
            "properties": {
              "fast": {
                "oneOf": [
                  {
                    "exclusiveMinimum": 0,
                    "type": "number"
                  },
                  {
                    "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                    "type": "string"
                  }
                ]
              },
              "flex": {
                "oneOf": [
                  {
                    "exclusiveMinimum": 0,
                    "type": "number"
                  },
                  {
                    "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                    "type": "string"
                  }
                ]
              },
              "priority": {
                "oneOf": [
                  {
                    "exclusiveMinimum": 0,
                    "type": "number"
                  },
                  {
                    "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                    "type": "string"
                  }
                ]
              }
            },
            "type": "object"
          },
          "tiers": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "above_input_tokens": {
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "type": "integer"
                },
                "audio_input_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "audio_output_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "cache_read_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "cache_write_1h_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "cache_write_5m_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "cache_write_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "image_input_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "image_output_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "input_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "output_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                },
                "reasoning_usd_per_1m": {
                  "oneOf": [
                    {
                      "minimum": 0,
                      "type": "number"
                    },
                    {
                      "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                      "type": "string"
                    }
                  ]
                }
              },
              "required": [
                "above_input_tokens"
              ],
              "type": "object"
            },
            "maxItems": 8,
            "minItems": 1,
            "type": "array"
          },
          "web_fetch_usd_per_1k": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          },
          "web_search_usd_per_1k": {
            "oneOf": [
              {
                "minimum": 0,
                "type": "number"
              },
              {
                "pattern": "^\\d{1,12}(\\.\\d{1,12})?$",
                "type": "string"
              }
            ]
          }
        },
        "type": "object"
      },
      "BudgetRecord": {
        "properties": {
          "adjustments": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/BudgetAdjustments"
              },
              {
                "type": "null"
              }
            ]
          },
          "alerts": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "applies_to": {
            "properties": {
              "apps": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "conditional": {
                "type": "boolean"
              },
              "smart_groups": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "text": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "base_limit": {
            "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "etag": {
            "description": "If-Match for PATCH/DELETE (\"b<16 hex>\", a hash of this budget's definition: unrelated publishes keep it valid)",
            "type": "string"
          },
          "family": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_set": {
            "oneOf": [
              {
                "properties": {
                  "group": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  },
                  "inferred": {
                    "description": "A per-group budget written before group budget sets existed, shown as a strictest set; PATCH the set to make it explicit.",
                    "type": "boolean"
                  },
                  "resolve": {
                    "enum": [
                      "strongest",
                      "strictest"
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "managed": {
            "type": "boolean"
          },
          "metric": {
            "type": "string"
          },
          "missing_id": {
            "description": "Present only on budgets counted per conversation, agent or agent_run.",
            "enum": [
              "skip",
              "refuse"
            ]
          },
          "mode": {
            "type": "string"
          },
          "one_time": {
            "description": "Present (true) only on a lifetime budget confirmed as a one-time allowance.",
            "type": "boolean"
          },
          "per": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "window": {
            "type": "object"
          }
        },
        "required": [
          "id",
          "metric",
          "base_limit",
          "window",
          "etag"
        ],
        "type": "object"
      },
      "BudgetSetCreate": {
        "additionalProperties": false,
        "properties": {
          "adjustments": {
            "$ref": "#/components/schemas/BudgetAdjustments"
          },
          "alerts": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "at_pct": {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "at_pct"
              ],
              "type": "object"
            },
            "maxItems": 5,
            "type": [
              "array",
              "null"
            ]
          },
          "applies_to": {
            "additionalProperties": false,
            "properties": {
              "apps": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "groups": {
            "description": "One budget per group; {group, limit} overrides that group's limit.",
            "items": {
              "oneOf": [
                {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "additionalProperties": false,
                  "properties": {
                    "group": {
                      "maxLength": 256,
                      "minLength": 1,
                      "type": "string"
                    },
                    "limit": {
                      "oneOf": [
                        {
                          "pattern": "^\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        {
                          "minimum": 0,
                          "type": "number"
                        }
                      ]
                    }
                  },
                  "required": [
                    "group"
                  ],
                  "type": "object"
                }
              ]
            },
            "maxItems": 32,
            "minItems": 1,
            "type": "array"
          },
          "id": {
            "description": "Default set_<12 hex>. Also written as each member's family.",
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
            "type": "string"
          },
          "kind": {
            "enum": [
              "budget",
              "rate"
            ],
            "type": "string"
          },
          "label": {
            "description": "Members are labelled \"<label> · <group>\".",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "limit": {
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "metric": {
            "type": "string"
          },
          "missing_id": {
            "description": "As on a budget: only with a conversation, agent or agent_run per.",
            "enum": [
              "skip",
              "refuse"
            ],
            "type": "string"
          },
          "mode": {
            "enum": [
              "enforce",
              "alert",
              "paused"
            ],
            "type": "string"
          },
          "one_time": {
            "description": "As on a budget: required true with a lifetime window.",
            "type": "boolean"
          },
          "per": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "resolve": {
            "default": "strongest",
            "description": "strongest: a person in several of the set's groups gets only their best-ranked group's budget (smart-group rank: lowest priority, then name). strictest: every group's budget applies (stacking; the tightest blocks first).",
            "enum": [
              "strongest",
              "strictest"
            ]
          },
          "window": {
            "type": "object"
          }
        },
        "required": [
          "label",
          "metric",
          "limit",
          "window",
          "groups"
        ],
        "type": "object"
      },
      "BudgetSetGet": {
        "properties": {
          "budgets": {
            "items": {
              "$ref": "#/components/schemas/BudgetRecord"
            },
            "type": "array"
          },
          "etag": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "set": {
            "$ref": "#/components/schemas/BudgetSetView"
          }
        },
        "required": [
          "set",
          "etag"
        ],
        "type": "object"
      },
      "BudgetSetGroupAdd": {
        "additionalProperties": false,
        "properties": {
          "group": {
            "maxLength": 256,
            "minLength": 1,
            "type": "string"
          },
          "limit": {
            "oneOf": [
              {
                "pattern": "^\\d+(\\.\\d{1,6})?$",
                "type": "string"
              },
              {
                "minimum": 0,
                "type": "number"
              }
            ]
          },
          "message": {
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "group"
        ],
        "type": "object"
      },
      "BudgetSetList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/BudgetSetView"
            },
            "type": "array"
          },
          "policy_engine": {
            "properties": {
              "active_revision": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "enabled": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "BudgetSetPatch": {
        "additionalProperties": false,
        "properties": {
          "message": {
            "maxLength": 500,
            "type": "string"
          },
          "resolve": {
            "description": "strongest: a person in several of the set's groups gets only their best-ranked group's budget (smart-group rank: lowest priority, then name). strictest: every group's budget applies (stacking; the tightest blocks first).",
            "enum": [
              "strongest",
              "strictest"
            ]
          }
        },
        "required": [
          "resolve"
        ],
        "type": "object"
      },
      "BudgetSetView": {
        "properties": {
          "budget_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "editable_in_console": {
            "type": "boolean"
          },
          "etag": {
            "description": "If-Match for PATCH/DELETE (\"s<16 hex>\")",
            "type": "string"
          },
          "groups": {
            "items": {
              "properties": {
                "budget_ids": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "group": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "inferred": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "managed": {
            "description": "Every member budget is API-managed (groups can be added and removed here).",
            "type": "boolean"
          },
          "managed_by": {
            "description": "management_api: created through this API and editable only here (the console shows it read-only); console: written in the console policy editor (this API can read it and switch resolve).",
            "enum": [
              "management_api",
              "console"
            ]
          },
          "metric": {
            "type": "string"
          },
          "per": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "policy": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolve": {
            "enum": [
              "strongest",
              "strictest"
            ]
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "windows": {
            "items": {
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "resolve",
          "inferred",
          "groups",
          "etag"
        ],
        "type": "object"
      },
      "BudgetSubjectDetail": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "description": "Every budget that counts this subject, with used, base, effective and remaining limits, grant, overflow and whether the rule is conditional.",
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "subject": {
            "additionalProperties": true,
            "properties": {
              "kind": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "BudgetSubjectRow": {
        "properties": {
          "active_grants": {
            "type": "integer"
          },
          "budgets": {
            "items": {
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "budget_id": {
                  "type": "string"
                },
                "effective_limit": {
                  "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                  "oneOf": [
                    {
                      "description": "spend: decimal USD",
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    }
                  ]
                },
                "grant": {
                  "oneOf": [
                    {
                      "properties": {
                        "auto_raise": {
                          "description": "Set on automatic raises: {step, of, window}",
                          "type": "object"
                        },
                        "expires_at": {
                          "description": "null: no end date",
                          "format": "date-time",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "extra": {
                          "description": "Set on an extra grant: limit = base + extra",
                          "oneOf": [
                            {
                              "description": "spend: decimal USD",
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "id": {
                          "type": "string"
                        },
                        "limit": {
                          "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                          "oneOf": [
                            {
                              "description": "spend: decimal USD",
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "members_of": {
                          "description": "Set when the limit comes from a Smart group grant to this group",
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "pct": {
                  "type": "number"
                },
                "state": {
                  "enum": [
                    "ok",
                    "alerting",
                    "granted",
                    "overflow",
                    "blocked"
                  ]
                },
                "used": {
                  "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                  "oneOf": [
                    {
                      "description": "spend: decimal USD",
                      "type": "string"
                    },
                    {
                      "type": "integer"
                    }
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "subject": {
            "properties": {
              "key": {
                "type": "object"
              },
              "kind": {
                "enum": [
                  "user",
                  "app",
                  "key",
                  "smart_group",
                  "other"
                ]
              },
              "value": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "tightest": {
            "properties": {
              "budget_id": {
                "type": "string"
              },
              "pct": {
                "type": "number"
              },
              "state": {
                "enum": [
                  "ok",
                  "alerting",
                  "granted",
                  "overflow",
                  "blocked"
                ]
              }
            },
            "type": "object"
          }
        },
        "required": [
          "subject",
          "budgets",
          "tightest"
        ],
        "type": "object"
      },
      "BudgetSubjectsPage": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BudgetSubjectRow"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "period": {
            "type": "string"
          },
          "period_not_supported": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "snapshot": {
            "description": "Usage snapshot the page was cut from (= as_of; informational). Cursors are keyset (last row's sort key) and stay valid across snapshots; rows whose values changed between pages may move.",
            "type": "string"
          },
          "stale": {
            "type": "boolean"
          },
          "total": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "items",
          "snapshot"
        ],
        "type": "object"
      },
      "BudgetUsageItem": {
        "properties": {
          "base_limit": {
            "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "bucket": {
            "type": "string"
          },
          "effective_limit": {
            "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "grant": {
            "oneOf": [
              {
                "properties": {
                  "auto_raise": {
                    "description": "Set on automatic raises: {step, of, window}",
                    "type": "object"
                  },
                  "expires_at": {
                    "description": "null: no end date",
                    "format": "date-time",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "extra": {
                    "description": "Set on an extra grant: limit = base + extra",
                    "oneOf": [
                      {
                        "description": "spend: decimal USD",
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  },
                  "id": {
                    "type": "string"
                  },
                  "limit": {
                    "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                    "oneOf": [
                      {
                        "description": "spend: decimal USD",
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  },
                  "members_of": {
                    "description": "Set when the limit comes from a Smart group grant to this group",
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "limit_source": {
            "description": "Where effective_limit comes from: the budget (base), the subject's own grant, or a Smart group grant (grant.members_of names the group). With members_of, a grant of another group is other_group_grant.",
            "enum": [
              "base",
              "own_grant",
              "group_grant",
              "other_group_grant"
            ]
          },
          "overflow": {
            "oneOf": [
              {
                "properties": {
                  "active": {
                    "type": "boolean"
                  },
                  "limit": {
                    "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                    "oneOf": [
                      {
                        "description": "spend: decimal USD",
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  },
                  "remaining": {
                    "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
                    "oneOf": [
                      {
                        "description": "spend: decimal USD",
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "pct": {
            "type": "number"
          },
          "remaining": {
            "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "state": {
            "enum": [
              "ok",
              "alerting",
              "granted",
              "overflow",
              "blocked"
            ]
          },
          "subject": {
            "type": "object"
          },
          "used": {
            "description": "Spend as a decimal USD string (\"12.50\"); requests/tokens as integers",
            "oneOf": [
              {
                "description": "spend: decimal USD",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          }
        },
        "required": [
          "bucket",
          "used",
          "effective_limit",
          "pct",
          "state"
        ],
        "type": "object"
      },
      "BudgetUsagePage": {
        "properties": {
          "as_of": {
            "format": "date-time",
            "type": "string"
          },
          "budget": {
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/BudgetUsageItem"
            },
            "type": "array"
          },
          "members_of": {
            "description": "Set with the members_of filter: the group and its member count",
            "properties": {
              "group": {
                "type": "string"
              },
              "members": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "period": {
            "type": "string"
          },
          "period_not_supported": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "snapshot": {
            "description": "Usage snapshot the page was cut from (= as_of; informational). Cursors are keyset (last row's sort key) and stay valid across snapshots; rows whose values changed between pages may move.",
            "type": "string"
          },
          "stale": {
            "type": "boolean"
          },
          "total": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          },
          "window": {
            "properties": {
              "reset_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "start": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": "object"
          }
        },
        "required": [
          "items",
          "snapshot"
        ],
        "type": "object"
      },
      "BudgetUsageSummary": {
        "additionalProperties": true,
        "properties": {
          "as_of": {
            "format": "date-time",
            "type": "string"
          },
          "items": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "active_grants": {
                  "type": "integer"
                },
                "at_limit": {
                  "type": "integer"
                },
                "blocked": {
                  "type": "integer"
                },
                "budget_id": {
                  "type": "string"
                },
                "in_overflow": {
                  "type": "integer"
                },
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "metric": {
                  "type": "string"
                },
                "over_80_pct": {
                  "type": "integer"
                },
                "subjects_tracked": {
                  "type": "integer"
                },
                "total_used": {
                  "description": "Decimal USD string for spend.",
                  "type": [
                    "string",
                    "integer"
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "period": {
            "type": "string"
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "snapshot": {
            "type": "string"
          },
          "stale": {
            "type": "boolean"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "Capabilities": {
        "additionalProperties": true,
        "properties": {
          "app_fields": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "description": "Writable fields of each app section.",
            "type": "object"
          },
          "app_top_level_fields": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "budget_policy_updates": {
            "type": "boolean"
          },
          "caller": {
            "additionalProperties": true,
            "description": "The calling management key, so a client can hide actions it cannot perform.",
            "properties": {
              "scopes": {
                "description": "Scopes of the calling key, sorted.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "scopes"
            ],
            "type": "object"
          },
          "completely_no_gpu": {
            "description": "The deployment runs no Quilr detection models; provider tests are unaffected.",
            "type": "boolean"
          },
          "configuration_propagation": {
            "enum": [
              "asynchronous"
            ],
            "type": "string"
          },
          "connection_test_provider_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "draft_settings_tests_available": {
            "type": "boolean"
          },
          "managed_controls": {
            "description": "Typed managed controls under /controls.",
            "properties": {
              "domains": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "enabled": {
                "description": "Writes are accepted (the deployment switch).",
                "type": "boolean"
              },
              "limits": {
                "description": "Policy capacity used and allowed; null while the policy engine is off.",
                "properties": {
                  "policies_max": {
                    "type": "integer"
                  },
                  "policies_used": {
                    "type": "integer"
                  },
                  "rules_max": {
                    "type": "integer"
                  },
                  "rules_used": {
                    "type": "integer"
                  },
                  "source_bytes_max": {
                    "type": "integer"
                  },
                  "source_bytes_used": {
                    "type": "integer"
                  }
                },
                "type": [
                  "object",
                  "null"
                ]
              },
              "renderer_version": {
                "type": "string"
              },
              "unavailable_domains": {
                "description": "Collections that can be read but not written in this release, with the error writes get.",
                "items": {
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "model_discovery_provider_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "model_test_provider_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "model_tests_available": {
            "type": "boolean"
          },
          "modes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "policy_authority": {
            "$ref": "#/components/schemas/PolicyAuthority"
          },
          "policy_updates": {
            "description": "General policy authoring (always false).",
            "type": "boolean"
          },
          "provider_delete_available": {
            "type": "boolean"
          },
          "provider_list_filters": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "provider_saves_call_upstream": {
            "type": "boolean"
          },
          "provider_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "quota_pools_available": {
            "type": "boolean"
          },
          "schema_version": {
            "type": "string"
          },
          "scopes": {
            "description": "Every scope a key may hold.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "writes_available": {
            "type": "boolean"
          }
        },
        "required": [
          "schema_version",
          "scopes",
          "caller",
          "provider_types",
          "app_fields"
        ],
        "type": "object"
      },
      "ContextRoute": {
        "additionalProperties": true,
        "description": "Route by request context size. A published route needs at least one model.",
        "properties": {
          "group": {
            "default": "chat_completion",
            "enum": [
              "anthropic_messages",
              "bedrock_runtime",
              "chat_completion",
              "responses",
              "vertex_ai"
            ],
            "type": "string"
          },
          "is_published": {
            "type": "boolean"
          },
          "models": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "credential_source": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "provider_name": {
                  "type": "string"
                }
              },
              "required": [
                "provider_name",
                "model"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "type": {
            "enum": [
              "High_Context_Request",
              "Low_Context_Request",
              "Medium_Context_Request"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "is_published",
          "models"
        ],
        "type": "object"
      },
      "ControlsAccess": {
        "additionalProperties": false,
        "description": "Access controls tighten access for the scoped requests and never loosen it: block denies the request, require_identity and require_conversation_id require a user identity or conversation ID, and allowed_source_ips limits the source IP ranges. They apply above every console policy rule wherever they match; console denies and requirements still apply everywhere they match, and source IP lists from every matching control and console rule are intersected (lists with nothing in common deny every source). Overlapping access controls combine to the strictest result.",
        "example": {
          "description": "Contractors: office network only",
          "scope": {
            "smart_groups": [
              "contractors"
            ]
          },
          "settings": {
            "allowed_source_ips": [
              "203.0.113.0/24"
            ],
            "require_identity": true
          }
        },
        "properties": {
          "all_apps": {
            "description": "Required (true) to leave scope empty.",
            "type": "boolean"
          },
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict (the control then applies to every request). Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "At least one restriction. Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "allowed_source_ips": {
                "description": "IP addresses or CIDR ranges; intersected with every other matching list.",
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              "block": {
                "const": true,
                "description": "Deny every matching request."
              },
              "require_conversation_id": {
                "const": true,
                "description": "Require a conversation ID."
              },
              "require_identity": {
                "const": true,
                "description": "Require a user identity."
              }
            },
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsAccessItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsAccessView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsAccessList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsAccessView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsAccessPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsAccess: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsAccess.",
        "properties": {
          "all_apps": {
            "anyOf": [
              {
                "description": "Required (true) to leave scope empty.",
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict (the control then applies to every request). Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "At least one restriction. Omitted settings are not set by this control.",
                "properties": {
                  "allowed_source_ips": {
                    "anyOf": [
                      {
                        "description": "IP addresses or CIDR ranges; intersected with every other matching list.",
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "minItems": 1,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "block": {
                    "anyOf": [
                      {
                        "const": true,
                        "description": "Deny every matching request."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "require_conversation_id": {
                    "anyOf": [
                      {
                        "const": true,
                        "description": "Require a conversation ID."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "require_identity": {
                    "anyOf": [
                      {
                        "const": true,
                        "description": "Require a user identity."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsAccessView": {
        "description": "An access control as read: the resource plus read-only fields.",
        "properties": {
          "all_apps": {
            "description": "Required (true) to leave scope empty.",
            "type": "boolean"
          },
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "overlaps": {
            "description": "Console policy rules that set an access setting where this control may also apply (read-only). This control's restrictions apply on top of them: a console allow or false loses, a console deny or requirement still applies, source IP lists intersect.",
            "items": {
              "properties": {
                "effects": {
                  "type": "object"
                },
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict (the control then applies to every request). Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "At least one restriction. Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "allowed_source_ips": {
                "description": "IP addresses or CIDR ranges; intersected with every other matching list.",
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              "block": {
                "const": true,
                "description": "Deny every matching request."
              },
              "require_conversation_id": {
                "const": true,
                "description": "Require a conversation ID."
              },
              "require_identity": {
                "const": true,
                "description": "Require a user identity."
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsBatchRequest": {
        "additionalProperties": false,
        "properties": {
          "ops": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "type": "object"
                },
                "collection": {
                  "description": "Collection path, for example routes",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "if_match": {
                  "type": "string"
                },
                "if_none_match": {
                  "const": "*"
                },
                "op": {
                  "description": "put, patch, delete or a quick operation name",
                  "type": "string"
                }
              },
              "required": [
                "op",
                "collection"
              ],
              "type": "object"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "ops"
        ],
        "type": "object"
      },
      "ControlsBatchResponse": {
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "dry_run": {
            "type": "boolean"
          },
          "propagation": {
            "$ref": "#/components/schemas/ControlsPropagation"
          },
          "results": {
            "items": {
              "properties": {
                "changed": {
                  "type": "boolean"
                },
                "deleted": {
                  "type": "boolean"
                },
                "domain": {
                  "type": "string"
                },
                "etag": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "type": "string"
                },
                "op_index": {
                  "type": "integer"
                },
                "resource": {
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "revision": {
            "type": "integer"
          },
          "warnings": {
            "type": "array"
          }
        },
        "type": "object"
      },
      "ControlsCacheWarm": {
        "additionalProperties": false,
        "description": "Provider prompt-cache keep-warm: extend_cache_lifetime (1-hour cache lifetime where the provider supports it, no extra requests) and refresh_requests (paid 1-token refresh requests before the provider cache lapses). Both are off unless set to true. A control replaces the whole setting where it wins: omitted keys are stored and read back at their defaults. Gateway-feature controls take precedence over console policy rules wherever they match, except console policies above priority 999 and console policies at 950 to 999 that predate the controls and are unchanged (both listed in overridden_by); console rules still apply elsewhere.",
        "example": {
          "scope": {
            "app_tags": [
              "coding-agents"
            ]
          },
          "settings": {
            "extend_cache_lifetime": true,
            "stop_after_idle_minutes": 20
          }
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "extend_cache_lifetime": {
                "type": "boolean"
              },
              "min_prompt_tokens": {
                "default": 4000,
                "maximum": 2000000,
                "minimum": 0,
                "type": "integer"
              },
              "refresh_requests": {
                "type": "boolean"
              },
              "stop_after_idle_minutes": {
                "default": 30,
                "maximum": 60,
                "minimum": 1,
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsCacheWarmItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsCacheWarmView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsCacheWarmList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsCacheWarmView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsCacheWarmPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsCacheWarm: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsCacheWarm.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "default": 0,
                "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
                "maximum": 49,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Omitted settings are not set by this control.",
                "properties": {
                  "extend_cache_lifetime": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "min_prompt_tokens": {
                    "anyOf": [
                      {
                        "default": 4000,
                        "maximum": 2000000,
                        "minimum": 0,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "refresh_requests": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "stop_after_idle_minutes": {
                    "anyOf": [
                      {
                        "default": 30,
                        "maximum": 60,
                        "minimum": 1,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsCacheWarmView": {
        "description": "A cache warm setting as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "overridden_by": {
            "description": "Console policy rules that take precedence over this control where both apply.",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "overrides": {
            "description": "Console policy rules this control takes precedence over where both apply and both set one of its settings (union settings merge and are not listed).",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "extend_cache_lifetime": {
                "type": "boolean"
              },
              "min_prompt_tokens": {
                "default": 4000,
                "maximum": 2000000,
                "minimum": 0,
                "type": "integer"
              },
              "refresh_requests": {
                "type": "boolean"
              },
              "stop_after_idle_minutes": {
                "default": 30,
                "maximum": 60,
                "minimum": 1,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsCapacity": {
        "properties": {
          "limits": {
            "$ref": "#/components/schemas/ControlsCapacityLimits"
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsCapacityLimits": {
        "properties": {
          "policies_max": {
            "type": "integer"
          },
          "policies_used": {
            "type": "integer"
          },
          "rules_max": {
            "type": "integer"
          },
          "rules_used": {
            "type": "integer"
          },
          "source_bytes_max": {
            "type": "integer"
          },
          "source_bytes_used": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsCollection": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console, policy, rule_index, view).",
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsComplexityLevels": {
        "description": "Set levels and/or context_thresholds. Console policy rules with a higher priority than managed controls override it where they overlap.",
        "example": {
          "description": "Support complexity",
          "levels": {
            "high": {
              "description": "Multi-step reasoning or coding"
            },
            "low": {
              "description": "Short factual questions",
              "max_tokens": 200
            },
            "medium": {
              "description": "Everyday drafting",
              "max_tokens": 2000
            },
            "method": "ai"
          },
          "rank": 10,
          "scope": {
            "apps": [
              "support-bot"
            ]
          }
        },
        "properties": {
          "context_thresholds": {
            "additionalProperties": false,
            "description": "Word-count bounds over ALL user-message text of the request (resent history included, not only the latest message); used when no levels apply.",
            "properties": {
              "low_max_words": {
                "minimum": 0,
                "type": "integer"
              },
              "medium_max_words": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "low_max_words",
              "medium_max_words"
            ],
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "levels": {
            "additionalProperties": false,
            "description": "Descriptions are required with method ai. low and medium carry exactly one bound, the same unit for both (max_tokens or max_words, counted on the latest user message), low <= medium.",
            "properties": {
              "high": {
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "maxLength": 300,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "low": {
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "maxLength": 300,
                    "minLength": 1,
                    "type": "string"
                  },
                  "max_tokens": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "max_words": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "medium": {
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "maxLength": 300,
                    "minLength": 1,
                    "type": "string"
                  },
                  "max_tokens": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "max_words": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "method": {
                "default": "ai",
                "description": "ai: the route classifier picks the level from the descriptions (bounds are the fallback when it is unavailable); length: the bounds alone decide.",
                "enum": [
                  "ai",
                  "length"
                ]
              }
            },
            "required": [
              "low",
              "medium",
              "high"
            ],
            "type": "object"
          },
          "match": {
            "additionalProperties": false,
            "properties": {
              "requested_models": {
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "type": "array"
              }
            },
            "type": "object"
          },
          "rank": {
            "description": "Order among overlapping complexity-levels resources (higher wins); omitted = max(overlapping) + 10, returned with rank_source assigned.",
            "maximum": 9999,
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsComplexityLevelsItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsComplexityLevelsView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsComplexityLevelsList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsComplexityLevelsView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsComplexityLevelsPatch": {
        "description": "JSON merge patch of ControlsComplexityLevels: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsComplexityLevels.",
        "properties": {
          "context_thresholds": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Word-count bounds over ALL user-message text of the request (resent history included, not only the latest message); used when no levels apply.",
                "properties": {
                  "low_max_words": {
                    "anyOf": [
                      {
                        "minimum": 0,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "medium_max_words": {
                    "anyOf": [
                      {
                        "minimum": 0,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "levels": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Descriptions are required with method ai. low and medium carry exactly one bound, the same unit for both (max_tokens or max_words, counted on the latest user message), low <= medium.",
                "properties": {
                  "high": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "description": {
                            "anyOf": [
                              {
                                "maxLength": 300,
                                "minLength": 1,
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "low": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "description": {
                            "anyOf": [
                              {
                                "maxLength": 300,
                                "minLength": 1,
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "max_tokens": {
                            "anyOf": [
                              {
                                "minimum": 0,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "max_words": {
                            "anyOf": [
                              {
                                "minimum": 0,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "medium": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "description": {
                            "anyOf": [
                              {
                                "maxLength": 300,
                                "minLength": 1,
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "max_tokens": {
                            "anyOf": [
                              {
                                "minimum": 0,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "max_words": {
                            "anyOf": [
                              {
                                "minimum": 0,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "method": {
                    "anyOf": [
                      {
                        "default": "ai",
                        "description": "ai: the route classifier picks the level from the descriptions (bounds are the fallback when it is unavailable); length: the bounds alone decide.",
                        "enum": [
                          "ai",
                          "length"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "match": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "requested_models": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 64,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "description": "Order among overlapping complexity-levels resources (higher wins); omitted = max(overlapping) + 10, returned with rank_source assigned.",
                "maximum": 9999,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty lists do not restrict.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsComplexityLevelsView": {
        "description": "A complexity levels as read: the resource plus read-only fields.",
        "properties": {
          "context_thresholds": {
            "additionalProperties": false,
            "description": "Word-count bounds over ALL user-message text of the request (resent history included, not only the latest message); used when no levels apply.",
            "properties": {
              "low_max_words": {
                "minimum": 0,
                "type": "integer"
              },
              "medium_max_words": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "low_max_words",
              "medium_max_words"
            ],
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "levels": {
            "additionalProperties": false,
            "description": "Descriptions are required with method ai. low and medium carry exactly one bound, the same unit for both (max_tokens or max_words, counted on the latest user message), low <= medium.",
            "properties": {
              "high": {
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "maxLength": 300,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "low": {
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "maxLength": 300,
                    "minLength": 1,
                    "type": "string"
                  },
                  "max_tokens": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "max_words": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "medium": {
                "additionalProperties": false,
                "properties": {
                  "description": {
                    "maxLength": 300,
                    "minLength": 1,
                    "type": "string"
                  },
                  "max_tokens": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "max_words": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "method": {
                "default": "ai",
                "description": "ai: the route classifier picks the level from the descriptions (bounds are the fallback when it is unavailable); length: the bounds alone decide.",
                "enum": [
                  "ai",
                  "length"
                ]
              }
            },
            "required": [
              "low",
              "medium",
              "high"
            ],
            "type": "object"
          },
          "match": {
            "additionalProperties": false,
            "properties": {
              "requested_models": {
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "type": "array"
              }
            },
            "type": "object"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "description": "Order among overlapping complexity-levels resources (higher wins); omitted = max(overlapping) + 10, returned with rank_source assigned.",
            "maximum": 9999,
            "minimum": 1,
            "type": "integer"
          },
          "rank_source": {
            "enum": [
              "explicit",
              "assigned"
            ]
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "tenant_wide_effects": {
            "description": "Complexity levels switch the whole tenant (every app) from legacy complexity routing: console rules with targets under a complexity condition that behave differently because levels exist (they no longer beat routing groups, and without their own route decision they escalate instead of deciding per message).",
            "properties": {
              "console_rules": {
                "items": {
                  "properties": {
                    "changes": {
                      "items": {
                        "enum": [
                          "targets_precede_groups",
                          "route_decision_per_message"
                        ]
                      },
                      "type": "array"
                    },
                    "policy": {
                      "type": "string"
                    },
                    "priority": {
                      "type": "integer"
                    },
                    "rule_index": {
                      "type": "integer"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsConversationHeaders": {
        "additionalProperties": false,
        "description": "Extra header names that carry the conversation ID. Read before the caller is identified, so scope may name apps only. Lists add up. Gateway-feature controls take precedence over console policy rules wherever they match, except console policies above priority 999 and console policies at 950 to 999 that predate the controls and are unchanged (both listed in overridden_by); console rules still apply elsewhere.",
        "example": {
          "scope": {
            "apps": [
              "support-bot"
            ]
          },
          "settings": {
            "id_headers": [
              "x-thread-id"
            ]
          }
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present. Only apps may be non-empty.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 0,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 0,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 0,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "id_headers": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsConversationHeadersItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsConversationHeadersView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsConversationHeadersList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsConversationHeadersView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsConversationHeadersPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsConversationHeaders: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsConversationHeaders.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "default": 0,
                "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
                "maximum": 49,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present. Only apps may be non-empty.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 0,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 0,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 0,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Omitted settings are not set by this control.",
                "properties": {
                  "id_headers": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "minItems": 1,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsConversationHeadersView": {
        "description": "A conversation header setting as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "overridden_by": {
            "description": "Console policy rules that take precedence over this control where both apply.",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "overrides": {
            "description": "Console policy rules this control takes precedence over where both apply and both set one of its settings (union settings merge and are not listed).",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present. Only apps may be non-empty.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 0,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 0,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 0,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "id_headers": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsDestinations": {
        "example": {
          "members": [
            {
              "model": "gpt-4.1",
              "provider_label": "azure-eu",
              "weight": 70
            },
            {
              "model": "anthropic.claude-sonnet-4",
              "provider_label": "bedrock-eu",
              "weight": 30
            }
          ],
          "mode": "request_count",
          "type": "weighted"
        },
        "oneOf": [
          {
            "description": "Weights total 100.",
            "properties": {
              "description": {
                "type": "string"
              },
              "members": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "provider_label": {
                      "type": "string"
                    },
                    "weight": {
                      "exclusiveMinimum": 0,
                      "maximum": 100,
                      "type": "number"
                    }
                  },
                  "required": [
                    "provider_label",
                    "model",
                    "weight"
                  ],
                  "type": "object"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              },
              "mode": {
                "enum": [
                  "request_count",
                  "token"
                ]
              },
              "type": {
                "const": "weighted"
              }
            },
            "required": [
              "type",
              "members"
            ],
            "type": "object"
          },
          {
            "properties": {
              "description": {
                "type": "string"
              },
              "targets": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "provider_label": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "provider_label",
                    "model"
                  ],
                  "type": "object"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              },
              "type": {
                "const": "ordered"
              }
            },
            "required": [
              "type",
              "targets"
            ],
            "type": "object"
          }
        ]
      },
      "ControlsDestinationsItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsDestinationsView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsDestinationsList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsDestinationsView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsDestinationsPatch": {
        "description": "JSON merge patch of ControlsDestinations: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsDestinations.",
        "type": "object"
      },
      "ControlsDestinationsReplaceMember": {
        "properties": {
          "from": {
            "additionalProperties": false,
            "properties": {
              "model": {
                "type": "string"
              },
              "provider_label": {
                "type": "string"
              }
            },
            "required": [
              "provider_label",
              "model"
            ],
            "type": "object"
          },
          "to": {
            "additionalProperties": false,
            "properties": {
              "model": {
                "type": "string"
              },
              "provider_label": {
                "type": "string"
              }
            },
            "required": [
              "provider_label",
              "model"
            ],
            "type": "object"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "type": "object"
      },
      "ControlsDestinationsSetWeights": {
        "properties": {
          "members": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "model": {
                  "type": "string"
                },
                "provider_label": {
                  "type": "string"
                },
                "weight": {
                  "exclusiveMinimum": 0,
                  "maximum": 100,
                  "type": "number"
                }
              },
              "required": [
                "provider_label",
                "model",
                "weight"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "members"
        ],
        "type": "object"
      },
      "ControlsDestinationsView": {
        "description": "A destination as read: the resource plus read-only fields.",
        "oneOf": [
          {
            "description": "Weights total 100.",
            "properties": {
              "description": {
                "type": "string"
              },
              "etag": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "id": {
                "type": "string"
              },
              "members": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "provider_label": {
                      "type": "string"
                    },
                    "weight": {
                      "exclusiveMinimum": 0,
                      "maximum": 100,
                      "type": "number"
                    }
                  },
                  "required": [
                    "provider_label",
                    "model",
                    "weight"
                  ],
                  "type": "object"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              },
              "mode": {
                "enum": [
                  "request_count",
                  "token"
                ]
              },
              "policy": {
                "type": "string"
              },
              "priority": {
                "type": "integer"
              },
              "read_only": {
                "type": "boolean"
              },
              "rule_index": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "source": {
                "enum": [
                  "managed",
                  "console"
                ]
              },
              "type": {
                "const": "weighted"
              },
              "used_by": {
                "type": "object"
              },
              "view": {
                "description": "Console rows: condition, scope and effects (read-only).",
                "type": "object"
              }
            },
            "required": [
              "type",
              "members"
            ],
            "type": "object"
          },
          {
            "properties": {
              "description": {
                "type": "string"
              },
              "etag": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "id": {
                "type": "string"
              },
              "policy": {
                "type": "string"
              },
              "priority": {
                "type": "integer"
              },
              "read_only": {
                "type": "boolean"
              },
              "rule_index": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "source": {
                "enum": [
                  "managed",
                  "console"
                ]
              },
              "targets": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "provider_label": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "provider_label",
                    "model"
                  ],
                  "type": "object"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              },
              "type": {
                "const": "ordered"
              },
              "used_by": {
                "type": "object"
              },
              "view": {
                "description": "Console rows: condition, scope and effects (read-only).",
                "type": "object"
              }
            },
            "required": [
              "type",
              "targets"
            ],
            "type": "object"
          }
        ]
      },
      "ControlsDiff": {
        "properties": {
          "source": {
            "description": "Optional detail: unified diff of the generated policy source.",
            "type": "string"
          },
          "spec": {
            "description": "One entry per changed resource.",
            "items": {
              "$ref": "#/components/schemas/ControlsDiffEntry"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ControlsDiffEntry": {
        "properties": {
          "after": {
            "type": [
              "object",
              "null"
            ]
          },
          "before": {
            "type": [
              "object",
              "null"
            ]
          },
          "collection": {
            "description": "Collection path, for example routes.",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "op": {
            "enum": [
              "create",
              "update",
              "delete"
            ]
          }
        },
        "required": [
          "collection",
          "id",
          "op"
        ],
        "type": "object"
      },
      "ControlsErrorCode": {
        "description": "Every error code the managed-controls routes return (management error envelope error.code). x-limits-codes gives the status and meaning of the limits codes, x-gateway-feature-codes those of the gateway-feature codes, x-access-codes those of the access-control codes, x-hooks-codes those of the external-hook codes.",
        "enum": [
          "access_not_restrictive",
          "access_scope_required",
          "api_family_unsupported",
          "app_not_found",
          "budget_exemption_not_supported",
          "central_service_required",
          "collection_changed",
          "complexity_rank_conflict",
          "content_condition_conflict",
          "deprecated_field",
          "destination_in_use",
          "destination_not_allowed",
          "draft_base_pruned",
          "duplicate_subject",
          "exemption_expired",
          "failover_profile_in_use",
          "feature_conflict",
          "feature_not_enabled",
          "field_not_allowed_here",
          "field_not_available_at_stage",
          "grant_above_ceiling",
          "grant_not_active",
          "grant_not_found",
          "grant_too_long",
          "header_conflict",
          "header_not_allowed",
          "hook_limit",
          "hook_scope_required",
          "idempotency_conflict",
          "idempotency_key_required",
          "identity_field_immutable",
          "insufficient_scope",
          "invalid_cursor",
          "invalid_grant",
          "invalid_named_reference",
          "invalid_quota_adjustments",
          "invalid_request",
          "invalid_resource_id",
          "invalid_route_decision",
          "invalid_source",
          "invalid_subject",
          "invalid_target_check_request",
          "invalid_test_routing_request",
          "invalid_weights",
          "kind_not_supported",
          "limit_response_conflict",
          "list_field_not_allowed_here",
          "managed_controls_changed",
          "managed_controls_disabled",
          "managed_policy_read_only",
          "member_not_found",
          "method_not_allowed",
          "not_found",
          "operation_expired",
          "override_target_not_allowed",
          "policy_capacity_exceeded",
          "policy_conflict",
          "policy_not_enabled",
          "precondition_required",
          "publish_rate_limited",
          "quilrql_invalid",
          "quota_id_conflict",
          "quota_id_reused",
          "rate_limit_not_adjustable",
          "rate_limit_not_found",
          "repin_scope_confirmation_required",
          "report_busy",
          "request_header_not_allowed",
          "restore_conflict",
          "revision_not_found",
          "revision_pruned",
          "revision_status_unavailable",
          "route_rank_conflict",
          "routing_constraint_no_candidates",
          "rule_not_api_managed",
          "secret_not_allowed_here",
          "subject_not_in_budget",
          "subject_unresolved",
          "surface_family_overlap",
          "surface_family_required",
          "surface_not_supported_for_explain",
          "test_routing_busy",
          "test_routing_unavailable",
          "time_range_not_supported",
          "too_many_resources",
          "unknown_data_type",
          "unknown_field",
          "unknown_secret",
          "unsupported_fields",
          "validation_failed",
          "version_conflict"
        ],
        "x-access-codes": {
          "access_not_restrictive": {
            "description": "An access control sets nothing restrictive, or a setting is false: access controls only tighten (block, require_identity and require_conversation_id accept only true). details.field.",
            "status": 422
          },
          "access_scope_required": {
            "description": "An empty scope needs all_apps: true.",
            "status": 422
          }
        },
        "x-gateway-feature-codes": {
          "feature_conflict": {
            "description": "Two gateway-feature controls of one collection (or one and a console rule at the same precedence) overlap with the same rank and set different values; error-message controls must not overlap at all. details: id, conflicts [{id | policy, rule_index, settings}].",
            "status": 422
          },
          "feature_not_enabled": {
            "description": "The setting is not enabled in this release.",
            "status": 422
          },
          "unsupported_fields": {
            "description": "Unknown resource fields or settings; details.fields.",
            "status": 422
          }
        },
        "x-hooks-codes": {
          "api_family_unsupported": {
            "description": "The API family is not supported by hooks.",
            "status": 422
          },
          "destination_not_allowed": {
            "description": "Not https, or a Quilr, local or private host.",
            "status": 422
          },
          "field_not_allowed_here": {
            "description": "The field cannot be used in that position.",
            "status": 422
          },
          "field_not_available_at_stage": {
            "description": "The field is not available at the hook's stage (e.g. usage or send.response_body at pre_call).",
            "status": 422
          },
          "header_conflict": {
            "description": "A header is set twice, or also by auth/signing.",
            "status": 422
          },
          "header_not_allowed": {
            "description": "A framing, hop-by-hop or x-quilr-* header.",
            "status": 422
          },
          "hook_limit": {
            "description": "More than 3 enabled enforcing pre_call hooks, or more than 3 enabled enforcing post_call hooks, per tenant.",
            "status": 422
          },
          "hook_scope_required": {
            "description": "An empty scope needs all_apps: true.",
            "status": 422
          },
          "list_field_not_allowed_here": {
            "description": "A list or object field was used in a header, the URL or a string slot.",
            "status": 422
          },
          "request_header_not_allowed": {
            "description": "A credential, identity or x-quilr-* client header can never be sent.",
            "status": 422
          },
          "secret_not_allowed_here": {
            "description": "Secrets go only in headers, query values, auth and signing.",
            "status": 422
          },
          "unknown_field": {
            "description": "A field path is not in the field catalog.",
            "status": 422
          },
          "unknown_secret": {
            "description": "A {{secret.name}} or auth secret is not defined.",
            "status": 422
          },
          "unsupported_fields": {
            "description": "A hook object has a key it does not take.",
            "status": 422
          }
        },
        "x-limits-codes": {
          "budget_exemption_not_supported": {
            "description": "Limit exemptions cover rate quotas only; budget exemptions use the budgets API.",
            "status": 422
          },
          "deprecated_field": {
            "description": "model_limits window keys (rate, input_tokens, output_tokens, concurrency) are deprecated; use a rate limit grouped by model.",
            "status": 422
          },
          "duplicate_subject": {
            "description": "A bulk request names one subject twice.",
            "status": 422
          },
          "exemption_expired": {
            "description": "expires_at is not in the future.",
            "status": 422
          },
          "grant_above_ceiling": {
            "description": "The granted limit exceeds adjustments.ceiling.",
            "status": 422
          },
          "grant_not_active": {
            "description": "The grant is already expired or revoked.",
            "status": 409
          },
          "grant_not_found": {
            "description": "The grant does not exist on this rate limit (a budget's or another rate limit's grant is never reachable here).",
            "status": 404
          },
          "grant_too_long": {
            "description": "The grant outlasts adjustments.max_duration.",
            "status": 422
          },
          "identity_field_immutable": {
            "description": "metric, group_by and window identify a rate limit's counter and are ForceNew: they never change in place (a Terraform-style replace must use a new id). details: fields, recorded_identity, requested_identity.",
            "status": 422
          },
          "invalid_cursor": {
            "description": "The list cursor is not valid.",
            "status": 400
          },
          "invalid_grant": {
            "description": "The grant body is malformed (exactly one of extra/limit; expires_at required).",
            "status": 422
          },
          "invalid_quota_adjustments": {
            "description": "adjustments is malformed or below limit.",
            "status": 422
          },
          "invalid_request": {
            "description": "The request is malformed.",
            "status": 400
          },
          "invalid_resource_id": {
            "description": "The id must start with a letter or digit, use letters, digits, '.', '_', ':' or '-', and be at most 120 characters.",
            "status": 400
          },
          "invalid_subject": {
            "description": "The grant subject or bucket is malformed.",
            "status": 422
          },
          "kind_not_supported": {
            "description": "Spend metrics, lifetime windows and kind budget belong to the budgets API.",
            "status": 422
          },
          "limit_response_conflict": {
            "description": "Two different limit responses (or one and a console policy rule at the same priority as managed controls) could apply to the same request: their scope.apps lists are not provably disjoint. details: id, conflicts.",
            "status": 422
          },
          "override_target_not_allowed": {
            "description": "overrides names a quota that is not a rate quota of this API or the console (a budget, itself, or an unknown id); details.targets [{id, quota_id, reason: budget|self|unknown}].",
            "status": 422
          },
          "policy_not_enabled": {
            "description": "Limits apply only while the LLM Gateway policy engine is enabled.",
            "status": 409
          },
          "precondition_required": {
            "description": "Revoking a grant needs If-Match.",
            "status": 428
          },
          "quilrql_invalid": {
            "description": "The control does not render to a valid policy rule; details.diagnostics.",
            "status": 422
          },
          "quota_id_conflict": {
            "description": "A console policy already defines quota id rl_<id>; details.quota_ids.",
            "status": 422
          },
          "quota_id_reused": {
            "description": "The quota id rl_<id> was published before with another metric/group_by/window (identities are recorded forever); use a new id. details: quota_id, recorded_identity, requested_identity.",
            "status": 422
          },
          "rate_limit_not_adjustable": {
            "description": "The rate limit has no adjustments, so it takes no grants.",
            "status": 409
          },
          "rate_limit_not_found": {
            "description": "No managed rate limit has this id.",
            "status": 404
          },
          "subject_not_in_budget": {
            "description": "The bucket does not match this rate limit's group_by; details.per.",
            "status": 422
          },
          "subject_unresolved": {
            "description": "The subject does not name this rate limit's bucket.",
            "status": 422
          },
          "unsupported_fields": {
            "description": "The resource has fields the domain does not take; details.fields lists them.",
            "status": 422
          },
          "validation_failed": {
            "description": "A field is missing or out of range; details.field names it.",
            "status": 422
          },
          "version_conflict": {
            "description": "If-Match does not match the grant's version.",
            "status": 412
          }
        }
      },
      "ControlsErrorMessages": {
        "additionalProperties": false,
        "description": "Friendly error messages: each mapping matches gateway or provider errors and replaces the message (status and code never change). Lists add up and are checked highest precedence first (higher rank first); two error-message controls of the same rank must name disjoint scope.apps lists. Gateway-feature controls take precedence over console policy rules wherever they match, except console policies above priority 999 and console policies at 950 to 999 that predate the controls and are unchanged (both listed in overridden_by); console rules still apply elsewhere.",
        "example": {
          "scope": {
            "apps": [
              "support-bot"
            ]
          },
          "settings": {
            "mappings": [
              {
                "id": "busy",
                "match": {
                  "class": [
                    "rate_limit"
                  ],
                  "source": "provider"
                },
                "message": "The assistant is busy; try again in a minute.",
                "url": "https://help.example.com/busy"
              }
            ]
          }
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "mappings": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "maxLength": 64,
                      "minLength": 1,
                      "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$",
                      "type": "string"
                    },
                    "match": {
                      "additionalProperties": false,
                      "minProperties": 1,
                      "properties": {
                        "class": {
                          "items": {
                            "enum": [
                              "timeout",
                              "connection",
                              "rate_limit",
                              "server_error",
                              "auth",
                              "model_not_found",
                              "context_length",
                              "content_filter"
                            ],
                            "type": "string"
                          },
                          "minItems": 1,
                          "type": "array",
                          "uniqueItems": true
                        },
                        "code": {
                          "items": {
                            "maxLength": 128,
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$",
                            "type": "string"
                          },
                          "maxItems": 32,
                          "minItems": 1,
                          "type": "array",
                          "uniqueItems": true
                        },
                        "message_contains": {
                          "items": {
                            "maxLength": 200,
                            "minLength": 1,
                            "type": "string"
                          },
                          "maxItems": 8,
                          "minItems": 1,
                          "type": "array"
                        },
                        "source": {
                          "default": "any",
                          "enum": [
                            "any",
                            "gateway",
                            "provider"
                          ],
                          "type": "string"
                        },
                        "status": {
                          "items": {
                            "maximum": 599,
                            "minimum": 400,
                            "type": "integer"
                          },
                          "maxItems": 16,
                          "minItems": 1,
                          "type": "array",
                          "uniqueItems": true
                        }
                      },
                      "type": "object"
                    },
                    "message": {
                      "maxLength": 300,
                      "minLength": 1,
                      "type": "string"
                    },
                    "url": {
                      "format": "uri",
                      "maxLength": 2048,
                      "pattern": "^https://",
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "match"
                  ],
                  "type": "object"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsErrorMessagesItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsErrorMessagesView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsErrorMessagesList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsErrorMessagesView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsErrorMessagesPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsErrorMessages: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsErrorMessages.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "default": 0,
                "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
                "maximum": 49,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Omitted settings are not set by this control.",
                "properties": {
                  "mappings": {
                    "anyOf": [
                      {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "id": {
                              "maxLength": 64,
                              "minLength": 1,
                              "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$",
                              "type": "string"
                            },
                            "match": {
                              "additionalProperties": false,
                              "minProperties": 1,
                              "properties": {
                                "class": {
                                  "items": {
                                    "enum": [
                                      "timeout",
                                      "connection",
                                      "rate_limit",
                                      "server_error",
                                      "auth",
                                      "model_not_found",
                                      "context_length",
                                      "content_filter"
                                    ],
                                    "type": "string"
                                  },
                                  "minItems": 1,
                                  "type": "array",
                                  "uniqueItems": true
                                },
                                "code": {
                                  "items": {
                                    "maxLength": 128,
                                    "minLength": 1,
                                    "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$",
                                    "type": "string"
                                  },
                                  "maxItems": 32,
                                  "minItems": 1,
                                  "type": "array",
                                  "uniqueItems": true
                                },
                                "message_contains": {
                                  "items": {
                                    "maxLength": 200,
                                    "minLength": 1,
                                    "type": "string"
                                  },
                                  "maxItems": 8,
                                  "minItems": 1,
                                  "type": "array"
                                },
                                "source": {
                                  "default": "any",
                                  "enum": [
                                    "any",
                                    "gateway",
                                    "provider"
                                  ],
                                  "type": "string"
                                },
                                "status": {
                                  "items": {
                                    "maximum": 599,
                                    "minimum": 400,
                                    "type": "integer"
                                  },
                                  "maxItems": 16,
                                  "minItems": 1,
                                  "type": "array",
                                  "uniqueItems": true
                                }
                              },
                              "type": "object"
                            },
                            "message": {
                              "maxLength": 300,
                              "minLength": 1,
                              "type": "string"
                            },
                            "url": {
                              "format": "uri",
                              "maxLength": 2048,
                              "pattern": "^https://",
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "match"
                          ],
                          "type": "object"
                        },
                        "maxItems": 64,
                        "minItems": 1,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsErrorMessagesView": {
        "description": "An error message setting as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "overridden_by": {
            "description": "Console policy rules that take precedence over this control where both apply.",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "overrides": {
            "description": "Console policy rules this control takes precedence over where both apply and both set one of its settings (union settings merge and are not listed).",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "mappings": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "maxLength": 64,
                      "minLength": 1,
                      "pattern": "^[a-z0-9][a-z0-9_.-]{0,63}$",
                      "type": "string"
                    },
                    "match": {
                      "additionalProperties": false,
                      "minProperties": 1,
                      "properties": {
                        "class": {
                          "items": {
                            "enum": [
                              "timeout",
                              "connection",
                              "rate_limit",
                              "server_error",
                              "auth",
                              "model_not_found",
                              "context_length",
                              "content_filter"
                            ],
                            "type": "string"
                          },
                          "minItems": 1,
                          "type": "array",
                          "uniqueItems": true
                        },
                        "code": {
                          "items": {
                            "maxLength": 128,
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$",
                            "type": "string"
                          },
                          "maxItems": 32,
                          "minItems": 1,
                          "type": "array",
                          "uniqueItems": true
                        },
                        "message_contains": {
                          "items": {
                            "maxLength": 200,
                            "minLength": 1,
                            "type": "string"
                          },
                          "maxItems": 8,
                          "minItems": 1,
                          "type": "array"
                        },
                        "source": {
                          "default": "any",
                          "enum": [
                            "any",
                            "gateway",
                            "provider"
                          ],
                          "type": "string"
                        },
                        "status": {
                          "items": {
                            "maximum": 599,
                            "minimum": 400,
                            "type": "integer"
                          },
                          "maxItems": 16,
                          "minItems": 1,
                          "type": "array",
                          "uniqueItems": true
                        }
                      },
                      "type": "object"
                    },
                    "message": {
                      "maxLength": 300,
                      "minLength": 1,
                      "type": "string"
                    },
                    "url": {
                      "format": "uri",
                      "maxLength": 2048,
                      "pattern": "^https://",
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "match"
                  ],
                  "type": "object"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsFailoverDefault": {
        "description": "Tenant singleton; DELETE resets to the built-in default.",
        "example": {
          "failover": {
            "candidate_scope": "same_model",
            "max_attempts": 2
          }
        },
        "properties": {
          "description": {
            "type": "string"
          },
          "failover": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "ref"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "A failover object: how the gateway retries and where it may move a failed request.",
                "properties": {
                  "attempt_timeout_ms": {
                    "maximum": 300000,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "candidate_scope": {
                    "description": "Alias of scope (the candidate tier); returned on reads.",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "capabilities": {
                    "type": "object"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "fallbacks": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "provider_label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "provider_label",
                        "model"
                      ],
                      "type": "object"
                    },
                    "maxItems": 8,
                    "type": "array"
                  },
                  "max_attempts": {
                    "maximum": 3,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "on": {
                    "items": {
                      "enum": [
                        "timeout",
                        "connection",
                        "rate_limit",
                        "server_error",
                        "auth",
                        "model_not_found",
                        "context_length",
                        "content_filter"
                      ]
                    },
                    "type": "array"
                  },
                  "preference": {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array"
                  },
                  "same_target_retries": {
                    "maximum": 2,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "scope": {
                    "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "total_timeout_ms": {
                    "maximum": 600000,
                    "minimum": 1000,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            ]
          }
        },
        "required": [
          "failover"
        ],
        "type": "object"
      },
      "ControlsFailoverDefaultItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsFailoverDefaultView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsFailoverDefaultList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsFailoverDefaultView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsFailoverDefaultView": {
        "description": "A failover default as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "failover": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "ref"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "A failover object: how the gateway retries and where it may move a failed request.",
                "properties": {
                  "attempt_timeout_ms": {
                    "maximum": 300000,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "candidate_scope": {
                    "description": "Alias of scope (the candidate tier); returned on reads.",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "capabilities": {
                    "type": "object"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "fallbacks": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "provider_label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "provider_label",
                        "model"
                      ],
                      "type": "object"
                    },
                    "maxItems": 8,
                    "type": "array"
                  },
                  "max_attempts": {
                    "maximum": 3,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "on": {
                    "items": {
                      "enum": [
                        "timeout",
                        "connection",
                        "rate_limit",
                        "server_error",
                        "auth",
                        "model_not_found",
                        "context_length",
                        "content_filter"
                      ]
                    },
                    "type": "array"
                  },
                  "preference": {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array"
                  },
                  "same_target_retries": {
                    "maximum": 2,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "scope": {
                    "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "total_timeout_ms": {
                    "maximum": 600000,
                    "minimum": 1000,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "failover"
        ],
        "type": "object"
      },
      "ControlsFailoverProfiles": {
        "additionalProperties": false,
        "description": "A failover object: how the gateway retries and where it may move a failed request.",
        "example": {
          "candidate_scope": "route",
          "description": "Two tries, then the mini model",
          "fallbacks": [
            {
              "model": "gpt-4.1-mini",
              "provider_label": "azure-eu"
            }
          ],
          "max_attempts": 2
        },
        "properties": {
          "attempt_timeout_ms": {
            "maximum": 300000,
            "minimum": 0,
            "type": "integer"
          },
          "candidate_scope": {
            "description": "Alias of scope (the candidate tier); returned on reads.",
            "enum": [
              "route",
              "same_model",
              "app"
            ]
          },
          "capabilities": {
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "fallbacks": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "model": {
                  "type": "string"
                },
                "provider_label": {
                  "type": "string"
                }
              },
              "required": [
                "provider_label",
                "model"
              ],
              "type": "object"
            },
            "maxItems": 8,
            "type": "array"
          },
          "max_attempts": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer"
          },
          "on": {
            "items": {
              "enum": [
                "timeout",
                "connection",
                "rate_limit",
                "server_error",
                "auth",
                "model_not_found",
                "context_length",
                "content_filter"
              ]
            },
            "type": "array"
          },
          "preference": {
            "items": {
              "type": "string"
            },
            "maxItems": 32,
            "type": "array"
          },
          "same_target_retries": {
            "maximum": 2,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
            "enum": [
              "route",
              "same_model",
              "app"
            ]
          },
          "total_timeout_ms": {
            "maximum": 600000,
            "minimum": 1000,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsFailoverProfilesItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsFailoverProfilesView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsFailoverProfilesList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsFailoverProfilesView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsFailoverProfilesPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsFailoverProfiles: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsFailoverProfiles.",
        "properties": {
          "attempt_timeout_ms": {
            "anyOf": [
              {
                "maximum": 300000,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "candidate_scope": {
            "anyOf": [
              {
                "description": "Alias of scope (the candidate tier); returned on reads.",
                "enum": [
                  "route",
                  "same_model",
                  "app"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "capabilities": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "fallbacks": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "provider_label": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "provider_label",
                    "model"
                  ],
                  "type": "object"
                },
                "maxItems": 8,
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_attempts": {
            "anyOf": [
              {
                "maximum": 3,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "on": {
            "anyOf": [
              {
                "items": {
                  "enum": [
                    "timeout",
                    "connection",
                    "rate_limit",
                    "server_error",
                    "auth",
                    "model_not_found",
                    "context_length",
                    "content_filter"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "preference": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 32,
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "same_target_retries": {
            "anyOf": [
              {
                "maximum": 2,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
                "enum": [
                  "route",
                  "same_model",
                  "app"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "total_timeout_ms": {
            "anyOf": [
              {
                "maximum": 600000,
                "minimum": 1000,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsFailoverProfilesView": {
        "description": "A failover profile as read: the resource plus read-only fields.",
        "properties": {
          "attempt_timeout_ms": {
            "maximum": 300000,
            "minimum": 0,
            "type": "integer"
          },
          "candidate_scope": {
            "description": "Alias of scope (the candidate tier); returned on reads.",
            "enum": [
              "route",
              "same_model",
              "app"
            ]
          },
          "capabilities": {
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "fallbacks": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "model": {
                  "type": "string"
                },
                "provider_label": {
                  "type": "string"
                }
              },
              "required": [
                "provider_label",
                "model"
              ],
              "type": "object"
            },
            "maxItems": 8,
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "max_attempts": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer"
          },
          "on": {
            "items": {
              "enum": [
                "timeout",
                "connection",
                "rate_limit",
                "server_error",
                "auth",
                "model_not_found",
                "context_length",
                "content_filter"
              ]
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "preference": {
            "items": {
              "type": "string"
            },
            "maxItems": 32,
            "type": "array"
          },
          "priority": {
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "same_target_retries": {
            "maximum": 2,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
            "enum": [
              "route",
              "same_model",
              "app"
            ]
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "total_timeout_ms": {
            "maximum": 600000,
            "minimum": 1000,
            "type": "integer"
          },
          "used_by": {
            "type": "object"
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsFailoverRules": {
        "example": {
          "failover": {
            "ref": "standard"
          },
          "rank": 10,
          "scope": {
            "smart_groups": [
              "eu-staff"
            ]
          }
        },
        "properties": {
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "failover": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "ref"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "A failover object: how the gateway retries and where it may move a failed request.",
                "properties": {
                  "attempt_timeout_ms": {
                    "maximum": 300000,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "candidate_scope": {
                    "description": "Alias of scope (the candidate tier); returned on reads.",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "capabilities": {
                    "type": "object"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "fallbacks": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "provider_label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "provider_label",
                        "model"
                      ],
                      "type": "object"
                    },
                    "maxItems": 8,
                    "type": "array"
                  },
                  "max_attempts": {
                    "maximum": 3,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "on": {
                    "items": {
                      "enum": [
                        "timeout",
                        "connection",
                        "rate_limit",
                        "server_error",
                        "auth",
                        "model_not_found",
                        "context_length",
                        "content_filter"
                      ]
                    },
                    "type": "array"
                  },
                  "preference": {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array"
                  },
                  "same_target_retries": {
                    "maximum": 2,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "scope": {
                    "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "total_timeout_ms": {
                    "maximum": 600000,
                    "minimum": 1000,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            ]
          },
          "match": {
            "additionalProperties": false,
            "properties": {
              "requested_models": {
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "type": "array"
              }
            },
            "type": "object"
          },
          "rank": {
            "description": "Order among overlapping managed routes and failover rules (higher wins; console policies with a higher priority than managed controls override them); omitted = max(overlapping) + 10, returned with rank_source assigned.",
            "maximum": 9999,
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "failover"
        ],
        "type": "object"
      },
      "ControlsFailoverRulesItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsFailoverRulesView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsFailoverRulesList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsFailoverRulesView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsFailoverRulesPatch": {
        "description": "JSON merge patch of ControlsFailoverRules: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsFailoverRules.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "failover": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "match": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "requested_models": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 64,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "description": "Order among overlapping managed routes and failover rules (higher wins; console policies with a higher priority than managed controls override them); omitted = max(overlapping) + 10, returned with rank_source assigned.",
                "maximum": 9999,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty lists do not restrict.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsFailoverRulesView": {
        "description": "A failover rule as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "failover": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "ref"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "A failover object: how the gateway retries and where it may move a failed request.",
                "properties": {
                  "attempt_timeout_ms": {
                    "maximum": 300000,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "candidate_scope": {
                    "description": "Alias of scope (the candidate tier); returned on reads.",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "capabilities": {
                    "type": "object"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "fallbacks": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "provider_label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "provider_label",
                        "model"
                      ],
                      "type": "object"
                    },
                    "maxItems": 8,
                    "type": "array"
                  },
                  "max_attempts": {
                    "maximum": 3,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "on": {
                    "items": {
                      "enum": [
                        "timeout",
                        "connection",
                        "rate_limit",
                        "server_error",
                        "auth",
                        "model_not_found",
                        "context_length",
                        "content_filter"
                      ]
                    },
                    "type": "array"
                  },
                  "preference": {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array"
                  },
                  "same_target_retries": {
                    "maximum": 2,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "scope": {
                    "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "total_timeout_ms": {
                    "maximum": 600000,
                    "minimum": 1000,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "match": {
            "additionalProperties": false,
            "properties": {
              "requested_models": {
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "type": "array"
              }
            },
            "type": "object"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "description": "Order among overlapping managed routes and failover rules (higher wins; console policies with a higher priority than managed controls override them); omitted = max(overlapping) + 10, returned with rank_source assigned.",
            "maximum": 9999,
            "minimum": 1,
            "type": "integer"
          },
          "rank_source": {
            "enum": [
              "explicit",
              "assigned"
            ]
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "failover"
        ],
        "type": "object"
      },
      "ControlsHooks": {
        "additionalProperties": false,
        "description": "External hooks call your own HTTPS API on gateway traffic. A pre_call hook runs after Quilr's checks and before the model call and can allow, flag or block the request (observe mode logs without enforcing). A post_call hook runs on the final non-streaming response (after Quilr's response checks, before it is cached or returned) and can allow, flag or block it; streaming requests skip it. An on_complete hook exports finished requests in batches. You choose the fields sent, the method, URL, headers, auth and signing, the body shape and how the reply maps to a decision. Secrets are write-only.",
        "example": {
          "description": "ACME prompt policy check",
          "endpoint": {
            "headers": [
              {
                "name": "X-Api-Key",
                "value": "{{secret.api_key}}"
              },
              {
                "name": "X-Agent",
                "omit_if_empty": true,
                "value": "{{client.agent.name}}"
              }
            ],
            "on_failure": "allow",
            "signing": {
              "secret": "hmac_key"
            },
            "timeout_ms": 1500,
            "url": "https://guard.example.com/v1/check?app={{app.name}}"
          },
          "match": {
            "api_families": [
              "openai.chat_completions",
              "anthropic.messages"
            ]
          },
          "mode": "observe",
          "scope": {
            "apps": [
              "support-bot"
            ]
          },
          "secrets": {
            "api_key": "sk_live_example",
            "hmac_key": "whsec_example"
          },
          "send": {
            "preset": "standard",
            "request_headers": [
              "user-agent",
              "x-team-id"
            ]
          },
          "stage": "pre_call"
        },
        "properties": {
          "all_apps": {
            "description": "Required (true) to leave scope empty.",
            "type": "boolean"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "endpoint": {
            "description": "pre_call and post_call.",
            "properties": {
              "auth": {
                "properties": {
                  "header": {
                    "type": "string"
                  },
                  "password_secret": {
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "none",
                      "bearer",
                      "basic",
                      "api_key"
                    ]
                  },
                  "username_secret": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "body": {
                "properties": {
                  "format": {
                    "enum": [
                      "quilr",
                      "template",
                      "raw",
                      "none"
                    ]
                  },
                  "template": {
                    "description": "JSON in your own schema."
                  }
                },
                "type": "object"
              },
              "headers": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "omit_if_empty": {
                      "type": "boolean"
                    },
                    "value": {
                      "description": "Fixed text mixed with {{field}}, {{secret.name}} or {{request_header.name}} placeholders.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "value"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "method": {
                "enum": [
                  "POST",
                  "PUT",
                  "PATCH"
                ]
              },
              "on_failure": {
                "default": "allow",
                "enum": [
                  "allow",
                  "block"
                ]
              },
              "response": {
                "properties": {
                  "decision": {
                    "properties": {
                      "block_values": {
                        "type": "array"
                      },
                      "case_insensitive": {
                        "type": "boolean"
                      },
                      "flag_values": {
                        "type": "array"
                      },
                      "otherwise": {
                        "enum": [
                          "allow",
                          "failure"
                        ]
                      },
                      "path": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "format": {
                    "enum": [
                      "quilr",
                      "mapped"
                    ]
                  },
                  "labels_path": {
                    "type": "string"
                  },
                  "metadata_paths": {
                    "type": "object"
                  },
                  "reason_path": {
                    "type": "string"
                  },
                  "status_map": {
                    "type": "object"
                  },
                  "user_message_path": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "signing": {
                "properties": {
                  "algorithm": {
                    "enum": [
                      "sha256",
                      "sha512"
                    ]
                  },
                  "encoding": {
                    "enum": [
                      "hex",
                      "base64"
                    ]
                  },
                  "format": {
                    "description": "quilr: t=<unix>,v1=<hmac of \"t.body\">; body: hmac of the body (or \"t.body\" with timestamp_header).",
                    "enum": [
                      "quilr",
                      "body"
                    ]
                  },
                  "header": {
                    "default": "X-Quilr-Signature",
                    "type": "string"
                  },
                  "prefix": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string"
                  },
                  "timestamp_header": {
                    "type": "string"
                  }
                },
                "required": [
                  "secret"
                ],
                "type": "object"
              },
              "timeout_ms": {
                "default": 1500,
                "maximum": 10000,
                "minimum": 100,
                "type": "integer"
              },
              "url": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "export": {
            "description": "on_complete only.",
            "properties": {
              "auth": {
                "properties": {
                  "header": {
                    "type": "string"
                  },
                  "password_secret": {
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "none",
                      "bearer",
                      "basic",
                      "api_key"
                    ]
                  },
                  "username_secret": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "batch_size": {
                "default": 100,
                "maximum": 1000,
                "minimum": 1,
                "type": "integer"
              },
              "flush_ms": {
                "default": 5000,
                "maximum": 60000,
                "minimum": 250,
                "type": "integer"
              },
              "headers": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "omit_if_empty": {
                      "type": "boolean"
                    },
                    "value": {
                      "description": "Fixed text mixed with {{field}}, {{secret.name}} or {{request_header.name}} placeholders.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "value"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "max_batch_bytes": {
                "default": 4194304,
                "type": "integer"
              },
              "record": {
                "properties": {
                  "format": {
                    "enum": [
                      "quilr",
                      "template"
                    ]
                  },
                  "template": {}
                },
                "type": "object"
              },
              "signing": {
                "properties": {
                  "algorithm": {
                    "enum": [
                      "sha256",
                      "sha512"
                    ]
                  },
                  "encoding": {
                    "enum": [
                      "hex",
                      "base64"
                    ]
                  },
                  "format": {
                    "description": "quilr: t=<unix>,v1=<hmac of \"t.body\">; body: hmac of the body (or \"t.body\" with timestamp_header).",
                    "enum": [
                      "quilr",
                      "body"
                    ]
                  },
                  "header": {
                    "default": "X-Quilr-Signature",
                    "type": "string"
                  },
                  "prefix": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string"
                  },
                  "timestamp_header": {
                    "type": "string"
                  }
                },
                "required": [
                  "secret"
                ],
                "type": "object"
              },
              "url": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "match": {
            "properties": {
              "api_families": {
                "items": {
                  "enum": [
                    "openai.chat_completions",
                    "openai.responses",
                    "anthropic.messages",
                    "gemini.generate_content",
                    "bedrock.converse",
                    "bedrock.invoke"
                  ]
                },
                "type": "array"
              },
              "requested_models": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "mode": {
            "description": "pre_call and post_call only. observe logs decisions and never blocks.",
            "enum": [
              "enforce",
              "observe"
            ]
          },
          "scope": {
            "properties": {
              "app_tags": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "apps": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "users": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "secrets": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Write-only. Reads return ******** ; sending ******** keeps the stored value.",
            "type": "object"
          },
          "send": {
            "properties": {
              "body": {
                "enum": [
                  "as_received",
                  "none"
                ]
              },
              "exclude": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "include": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "max_body_bytes": {
                "maximum": 4194304,
                "minimum": 1024,
                "type": "integer"
              },
              "on_oversize": {
                "enum": [
                  "send_without_body",
                  "skip_hook",
                  "apply_on_failure"
                ]
              },
              "preset": {
                "enum": [
                  "minimal",
                  "standard",
                  "full_export",
                  "empty"
                ]
              },
              "request_headers": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "response_body": {
                "description": "post_call (default true) and on_complete (default false) only: send the response the client receives, as delivered (quilr envelope key response_body, or {\"$raw\": \"response_body\"} in a template). Non-streaming requests only; streams carry response_body_omitted: \"stream\".",
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "stage": {
            "enum": [
              "pre_call",
              "post_call",
              "on_complete"
            ]
          },
          "stream_mode": {
            "default": "skip",
            "description": "post_call only. Streaming requests never run post_call hooks (buffering a stream is a later phase).",
            "enum": [
              "skip"
            ]
          }
        },
        "required": [
          "stage"
        ],
        "type": "object"
      },
      "ControlsHooksItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsHooksView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsHooksList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsHooksView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsHooksPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsHooks: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsHooks.",
        "properties": {
          "all_apps": {
            "anyOf": [
              {
                "description": "Required (true) to leave scope empty.",
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "anyOf": [
              {
                "default": true,
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "endpoint": {
            "anyOf": [
              {
                "description": "pre_call and post_call.",
                "properties": {
                  "auth": {
                    "anyOf": [
                      {
                        "properties": {
                          "header": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "password_secret": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "query": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "secret": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "type": {
                            "anyOf": [
                              {
                                "enum": [
                                  "none",
                                  "bearer",
                                  "basic",
                                  "api_key"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "username_secret": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "body": {
                    "anyOf": [
                      {
                        "properties": {
                          "format": {
                            "anyOf": [
                              {
                                "enum": [
                                  "quilr",
                                  "template",
                                  "raw",
                                  "none"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "template": {
                            "anyOf": [
                              {
                                "description": "JSON in your own schema."
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "headers": {
                    "anyOf": [
                      {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "omit_if_empty": {
                              "type": "boolean"
                            },
                            "value": {
                              "description": "Fixed text mixed with {{field}}, {{secret.name}} or {{request_header.name}} placeholders.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "value"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "method": {
                    "anyOf": [
                      {
                        "enum": [
                          "POST",
                          "PUT",
                          "PATCH"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "on_failure": {
                    "anyOf": [
                      {
                        "default": "allow",
                        "enum": [
                          "allow",
                          "block"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "response": {
                    "anyOf": [
                      {
                        "properties": {
                          "decision": {
                            "anyOf": [
                              {
                                "properties": {
                                  "block_values": {
                                    "anyOf": [
                                      {
                                        "type": "array"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "case_insensitive": {
                                    "anyOf": [
                                      {
                                        "type": "boolean"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "flag_values": {
                                    "anyOf": [
                                      {
                                        "type": "array"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "otherwise": {
                                    "anyOf": [
                                      {
                                        "enum": [
                                          "allow",
                                          "failure"
                                        ]
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "path": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "format": {
                            "anyOf": [
                              {
                                "enum": [
                                  "quilr",
                                  "mapped"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "labels_path": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "metadata_paths": {
                            "anyOf": [
                              {
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "reason_path": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status_map": {
                            "anyOf": [
                              {
                                "type": "object"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "user_message_path": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "signing": {
                    "anyOf": [
                      {
                        "properties": {
                          "algorithm": {
                            "anyOf": [
                              {
                                "enum": [
                                  "sha256",
                                  "sha512"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "encoding": {
                            "anyOf": [
                              {
                                "enum": [
                                  "hex",
                                  "base64"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "format": {
                            "anyOf": [
                              {
                                "description": "quilr: t=<unix>,v1=<hmac of \"t.body\">; body: hmac of the body (or \"t.body\" with timestamp_header).",
                                "enum": [
                                  "quilr",
                                  "body"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "header": {
                            "anyOf": [
                              {
                                "default": "X-Quilr-Signature",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "prefix": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "secret": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "timestamp_header": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "timeout_ms": {
                    "anyOf": [
                      {
                        "default": 1500,
                        "maximum": 10000,
                        "minimum": 100,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "url": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "export": {
            "anyOf": [
              {
                "description": "on_complete only.",
                "properties": {
                  "auth": {
                    "anyOf": [
                      {
                        "properties": {
                          "header": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "password_secret": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "query": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "secret": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "type": {
                            "anyOf": [
                              {
                                "enum": [
                                  "none",
                                  "bearer",
                                  "basic",
                                  "api_key"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "username_secret": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "batch_size": {
                    "anyOf": [
                      {
                        "default": 100,
                        "maximum": 1000,
                        "minimum": 1,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "flush_ms": {
                    "anyOf": [
                      {
                        "default": 5000,
                        "maximum": 60000,
                        "minimum": 250,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "headers": {
                    "anyOf": [
                      {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "omit_if_empty": {
                              "type": "boolean"
                            },
                            "value": {
                              "description": "Fixed text mixed with {{field}}, {{secret.name}} or {{request_header.name}} placeholders.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "name",
                            "value"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "max_batch_bytes": {
                    "anyOf": [
                      {
                        "default": 4194304,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "record": {
                    "anyOf": [
                      {
                        "properties": {
                          "format": {
                            "anyOf": [
                              {
                                "enum": [
                                  "quilr",
                                  "template"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "template": {
                            "anyOf": [
                              {},
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "signing": {
                    "anyOf": [
                      {
                        "properties": {
                          "algorithm": {
                            "anyOf": [
                              {
                                "enum": [
                                  "sha256",
                                  "sha512"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "encoding": {
                            "anyOf": [
                              {
                                "enum": [
                                  "hex",
                                  "base64"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "format": {
                            "anyOf": [
                              {
                                "description": "quilr: t=<unix>,v1=<hmac of \"t.body\">; body: hmac of the body (or \"t.body\" with timestamp_header).",
                                "enum": [
                                  "quilr",
                                  "body"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "header": {
                            "anyOf": [
                              {
                                "default": "X-Quilr-Signature",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "prefix": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "secret": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "timestamp_header": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "url": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "match": {
            "anyOf": [
              {
                "properties": {
                  "api_families": {
                    "anyOf": [
                      {
                        "items": {
                          "enum": [
                            "openai.chat_completions",
                            "openai.responses",
                            "anthropic.messages",
                            "gemini.generate_content",
                            "bedrock.converse",
                            "bedrock.invoke"
                          ]
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "requested_models": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "mode": {
            "anyOf": [
              {
                "description": "pre_call and post_call only. observe logs decisions and never blocks.",
                "enum": [
                  "enforce",
                  "observe"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "secrets": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Write-only. Reads return ******** ; sending ******** keeps the stored value.",
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "send": {
            "anyOf": [
              {
                "properties": {
                  "body": {
                    "anyOf": [
                      {
                        "enum": [
                          "as_received",
                          "none"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "exclude": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "include": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "max_body_bytes": {
                    "anyOf": [
                      {
                        "maximum": 4194304,
                        "minimum": 1024,
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "on_oversize": {
                    "anyOf": [
                      {
                        "enum": [
                          "send_without_body",
                          "skip_hook",
                          "apply_on_failure"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "preset": {
                    "anyOf": [
                      {
                        "enum": [
                          "minimal",
                          "standard",
                          "full_export",
                          "empty"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "request_headers": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "response_body": {
                    "anyOf": [
                      {
                        "description": "post_call (default true) and on_complete (default false) only: send the response the client receives, as delivered (quilr envelope key response_body, or {\"$raw\": \"response_body\"} in a template). Non-streaming requests only; streams carry response_body_omitted: \"stream\".",
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "stage": {
            "anyOf": [
              {
                "enum": [
                  "pre_call",
                  "post_call",
                  "on_complete"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "stream_mode": {
            "anyOf": [
              {
                "default": "skip",
                "description": "post_call only. Streaming requests never run post_call hooks (buffering a stream is a later phase).",
                "enum": [
                  "skip"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsHooksView": {
        "description": "A hook as read: the resource plus read-only fields.",
        "properties": {
          "all_apps": {
            "description": "Required (true) to leave scope empty.",
            "type": "boolean"
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "endpoint": {
            "description": "pre_call and post_call.",
            "properties": {
              "auth": {
                "properties": {
                  "header": {
                    "type": "string"
                  },
                  "password_secret": {
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "none",
                      "bearer",
                      "basic",
                      "api_key"
                    ]
                  },
                  "username_secret": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "body": {
                "properties": {
                  "format": {
                    "enum": [
                      "quilr",
                      "template",
                      "raw",
                      "none"
                    ]
                  },
                  "template": {
                    "description": "JSON in your own schema."
                  }
                },
                "type": "object"
              },
              "headers": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "omit_if_empty": {
                      "type": "boolean"
                    },
                    "value": {
                      "description": "Fixed text mixed with {{field}}, {{secret.name}} or {{request_header.name}} placeholders.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "value"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "method": {
                "enum": [
                  "POST",
                  "PUT",
                  "PATCH"
                ]
              },
              "on_failure": {
                "default": "allow",
                "enum": [
                  "allow",
                  "block"
                ]
              },
              "response": {
                "properties": {
                  "decision": {
                    "properties": {
                      "block_values": {
                        "type": "array"
                      },
                      "case_insensitive": {
                        "type": "boolean"
                      },
                      "flag_values": {
                        "type": "array"
                      },
                      "otherwise": {
                        "enum": [
                          "allow",
                          "failure"
                        ]
                      },
                      "path": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "format": {
                    "enum": [
                      "quilr",
                      "mapped"
                    ]
                  },
                  "labels_path": {
                    "type": "string"
                  },
                  "metadata_paths": {
                    "type": "object"
                  },
                  "reason_path": {
                    "type": "string"
                  },
                  "status_map": {
                    "type": "object"
                  },
                  "user_message_path": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "signing": {
                "properties": {
                  "algorithm": {
                    "enum": [
                      "sha256",
                      "sha512"
                    ]
                  },
                  "encoding": {
                    "enum": [
                      "hex",
                      "base64"
                    ]
                  },
                  "format": {
                    "description": "quilr: t=<unix>,v1=<hmac of \"t.body\">; body: hmac of the body (or \"t.body\" with timestamp_header).",
                    "enum": [
                      "quilr",
                      "body"
                    ]
                  },
                  "header": {
                    "default": "X-Quilr-Signature",
                    "type": "string"
                  },
                  "prefix": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string"
                  },
                  "timestamp_header": {
                    "type": "string"
                  }
                },
                "required": [
                  "secret"
                ],
                "type": "object"
              },
              "timeout_ms": {
                "default": 1500,
                "maximum": 10000,
                "minimum": 100,
                "type": "integer"
              },
              "url": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "export": {
            "description": "on_complete only.",
            "properties": {
              "auth": {
                "properties": {
                  "header": {
                    "type": "string"
                  },
                  "password_secret": {
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "none",
                      "bearer",
                      "basic",
                      "api_key"
                    ]
                  },
                  "username_secret": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "batch_size": {
                "default": 100,
                "maximum": 1000,
                "minimum": 1,
                "type": "integer"
              },
              "flush_ms": {
                "default": 5000,
                "maximum": 60000,
                "minimum": 250,
                "type": "integer"
              },
              "headers": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "omit_if_empty": {
                      "type": "boolean"
                    },
                    "value": {
                      "description": "Fixed text mixed with {{field}}, {{secret.name}} or {{request_header.name}} placeholders.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "value"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "max_batch_bytes": {
                "default": 4194304,
                "type": "integer"
              },
              "record": {
                "properties": {
                  "format": {
                    "enum": [
                      "quilr",
                      "template"
                    ]
                  },
                  "template": {}
                },
                "type": "object"
              },
              "signing": {
                "properties": {
                  "algorithm": {
                    "enum": [
                      "sha256",
                      "sha512"
                    ]
                  },
                  "encoding": {
                    "enum": [
                      "hex",
                      "base64"
                    ]
                  },
                  "format": {
                    "description": "quilr: t=<unix>,v1=<hmac of \"t.body\">; body: hmac of the body (or \"t.body\" with timestamp_header).",
                    "enum": [
                      "quilr",
                      "body"
                    ]
                  },
                  "header": {
                    "default": "X-Quilr-Signature",
                    "type": "string"
                  },
                  "prefix": {
                    "type": "string"
                  },
                  "secret": {
                    "type": "string"
                  },
                  "timestamp_header": {
                    "type": "string"
                  }
                },
                "required": [
                  "secret"
                ],
                "type": "object"
              },
              "url": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "match": {
            "properties": {
              "api_families": {
                "items": {
                  "enum": [
                    "openai.chat_completions",
                    "openai.responses",
                    "anthropic.messages",
                    "gemini.generate_content",
                    "bedrock.converse",
                    "bedrock.invoke"
                  ]
                },
                "type": "array"
              },
              "requested_models": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "mode": {
            "description": "pre_call and post_call only. observe logs decisions and never blocks.",
            "enum": [
              "enforce",
              "observe"
            ]
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "properties": {
              "app_tags": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "apps": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "users": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "secrets": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Write-only. Reads return ******** ; sending ******** keeps the stored value.",
            "type": "object"
          },
          "send": {
            "properties": {
              "body": {
                "enum": [
                  "as_received",
                  "none"
                ]
              },
              "exclude": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "include": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "max_body_bytes": {
                "maximum": 4194304,
                "minimum": 1024,
                "type": "integer"
              },
              "on_oversize": {
                "enum": [
                  "send_without_body",
                  "skip_hook",
                  "apply_on_failure"
                ]
              },
              "preset": {
                "enum": [
                  "minimal",
                  "standard",
                  "full_export",
                  "empty"
                ]
              },
              "request_headers": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "response_body": {
                "description": "post_call (default true) and on_complete (default false) only: send the response the client receives, as delivered (quilr envelope key response_body, or {\"$raw\": \"response_body\"} in a template). Non-streaming requests only; streams carry response_body_omitted: \"stream\".",
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "stage": {
            "enum": [
              "pre_call",
              "post_call",
              "on_complete"
            ]
          },
          "stream_mode": {
            "default": "skip",
            "description": "post_call only. Streaming requests never run post_call hooks (buffering a stream is a later phase).",
            "enum": [
              "skip"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "stage"
        ],
        "type": "object"
      },
      "ControlsItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "type": [
              "object",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsLimitExemptions": {
        "additionalProperties": false,
        "description": "Exempts the scoped requests from rate limits only (kinds is always [rate]; budget exemptions use the budgets API).",
        "example": {
          "expires_at": "2026-12-01T00:00:00Z",
          "quotas": "all",
          "reason": "incident on call",
          "scope": {
            "users": [
              "oncall@example.com"
            ]
          }
        },
        "properties": {
          "expires_at": {
            "description": "Must be in the future.",
            "format": "date-time",
            "type": "string"
          },
          "families": {
            "items": {
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
              "type": "string"
            },
            "maxItems": 64,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "kinds": {
            "default": [
              "rate"
            ],
            "items": {
              "enum": [
                "rate"
              ]
            },
            "type": "array"
          },
          "quotas": {
            "oneOf": [
              {
                "const": "all"
              },
              {
                "items": {
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              }
            ]
          },
          "reason": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          }
        },
        "required": [
          "quotas",
          "reason"
        ],
        "type": "object"
      },
      "ControlsLimitExemptionsItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsLimitExemptionsView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsLimitExemptionsList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsLimitExemptionsView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsLimitExemptionsPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsLimitExemptions: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsLimitExemptions.",
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "description": "Must be in the future.",
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "families": {
            "anyOf": [
              {
                "items": {
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              },
              {
                "type": "null"
              }
            ]
          },
          "kinds": {
            "anyOf": [
              {
                "default": [
                  "rate"
                ],
                "items": {
                  "enum": [
                    "rate"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "quotas": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "maxLength": 300,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsLimitExemptionsView": {
        "description": "A limit exemption as read: the resource plus read-only fields.",
        "properties": {
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "description": "Must be in the future.",
            "format": "date-time",
            "type": "string"
          },
          "families": {
            "items": {
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
              "type": "string"
            },
            "maxItems": 64,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "id": {
            "type": "string"
          },
          "kinds": {
            "default": [
              "rate"
            ],
            "items": {
              "enum": [
                "rate"
              ]
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "quotas": {
            "oneOf": [
              {
                "const": "all"
              },
              {
                "items": {
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              }
            ]
          },
          "read_only": {
            "type": "boolean"
          },
          "reason": {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "quotas",
          "reason"
        ],
        "type": "object"
      },
      "ControlsLimitResponses": {
        "additionalProperties": false,
        "anyOf": [
          {
            "required": [
              "message"
            ]
          },
          {
            "required": [
              "url"
            ]
          },
          {
            "required": [
              "retry"
            ]
          }
        ],
        "description": "The response sent when a limit refuses a request. Two different responses must pin scope.apps to lists with no app in common (else 422 limit_response_conflict).",
        "example": {
          "message": "You reached {limit}; it resets {reset}.",
          "retry": "default",
          "scope": {
            "apps": [
              "Support"
            ]
          },
          "url": "https://help.example.com/limits"
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "message": {
            "description": "May use {budget}, {limit} and {reset}.",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "retry": {
            "enum": [
              "default",
              "never"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "url": {
            "format": "uri",
            "maxLength": 2048,
            "pattern": "^https://",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ControlsLimitResponsesItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsLimitResponsesView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsLimitResponsesList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsLimitResponsesView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsLimitResponsesPatch": {
        "description": "JSON merge patch of ControlsLimitResponses: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsLimitResponses."
      },
      "ControlsLimitResponsesView": {
        "anyOf": [
          {
            "required": [
              "message"
            ]
          },
          {
            "required": [
              "url"
            ]
          },
          {
            "required": [
              "retry"
            ]
          }
        ],
        "description": "A limit response as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "message": {
            "description": "May use {budget}, {limit} and {reset}.",
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "retry": {
            "enum": [
              "default",
              "never"
            ]
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "url": {
            "format": "uri",
            "maxLength": 2048,
            "pattern": "^https://",
            "type": "string"
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsModelAccess": {
        "example": {
          "allow": [
            "gpt-4.1"
          ],
          "deny": [
            "gpt-4o"
          ],
          "scope": {
            "apps": [
              "support-bot"
            ]
          }
        },
        "properties": {
          "allow": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "deny": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "type": "string"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsModelAccessItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsModelAccessView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsModelAccessList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsModelAccessView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsModelAccessPatch": {
        "description": "JSON merge patch of ControlsModelAccess: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsModelAccess.",
        "properties": {
          "allow": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "deny": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty lists do not restrict.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsModelAccessView": {
        "description": "A model access rule as read: the resource plus read-only fields.",
        "properties": {
          "allow": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "deny": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsModelLimits": {
        "additionalProperties": false,
        "description": "Per-request guards for individual models (provider_label scopes one to a provider). Window limits per model are rate limits with group_by [\"model\"].",
        "example": {
          "limits": [
            {
              "max_tokens_per_request": 4000,
              "model": "gpt-4o"
            },
            {
              "model": "claude-sonnet-4",
              "provider_label": "bedrock-main",
              "timeout_s": 120
            }
          ]
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "limits": {
            "items": {
              "additionalProperties": false,
              "anyOf": [
                {
                  "required": [
                    "max_tokens_per_request"
                  ]
                },
                {
                  "required": [
                    "timeout_s"
                  ]
                }
              ],
              "properties": {
                "max_tokens_per_request": {
                  "description": "Ceiling on the request's estimated input tokens (the client max_tokens is not added); over it is 400 max_tokens_per_request_exceeded.",
                  "minimum": 1,
                  "type": "integer"
                },
                "model": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "provider_label": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "timeout_s": {
                  "description": "Seconds, at most 3 decimals.",
                  "exclusiveMinimum": 0,
                  "multipleOf": 0.001,
                  "type": "number"
                }
              },
              "required": [
                "model"
              ],
              "type": "object"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          }
        },
        "required": [
          "limits"
        ],
        "type": "object"
      },
      "ControlsModelLimitsItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsModelLimitsView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsModelLimitsList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsModelLimitsView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsModelLimitsPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsModelLimits: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsModelLimits.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "limits": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": false,
                  "anyOf": [
                    {
                      "required": [
                        "max_tokens_per_request"
                      ]
                    },
                    {
                      "required": [
                        "timeout_s"
                      ]
                    }
                  ],
                  "properties": {
                    "max_tokens_per_request": {
                      "description": "Ceiling on the request's estimated input tokens (the client max_tokens is not added); over it is 400 max_tokens_per_request_exceeded.",
                      "minimum": 1,
                      "type": "integer"
                    },
                    "model": {
                      "maxLength": 256,
                      "minLength": 1,
                      "type": "string"
                    },
                    "provider_label": {
                      "maxLength": 256,
                      "minLength": 1,
                      "type": "string"
                    },
                    "timeout_s": {
                      "description": "Seconds, at most 3 decimals.",
                      "exclusiveMinimum": 0,
                      "multipleOf": 0.001,
                      "type": "number"
                    }
                  },
                  "required": [
                    "model"
                  ],
                  "type": "object"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsModelLimitsView": {
        "description": "A model limit as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "limits": {
            "items": {
              "additionalProperties": false,
              "anyOf": [
                {
                  "required": [
                    "max_tokens_per_request"
                  ]
                },
                {
                  "required": [
                    "timeout_s"
                  ]
                }
              ],
              "properties": {
                "max_tokens_per_request": {
                  "description": "Ceiling on the request's estimated input tokens (the client max_tokens is not added); over it is 400 max_tokens_per_request_exceeded.",
                  "minimum": 1,
                  "type": "integer"
                },
                "model": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "provider_label": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "timeout_s": {
                  "description": "Seconds, at most 3 decimals.",
                  "exclusiveMinimum": 0,
                  "multipleOf": 0.001,
                  "type": "number"
                }
              },
              "required": [
                "model"
              ],
              "type": "object"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "limits"
        ],
        "type": "object"
      },
      "ControlsModelVisibility": {
        "additionalProperties": false,
        "description": "What model lists show (never what can be called). hide_all and hide_aliases accept only true; reveal_hidden exempts a scope; show_only and hide grants add up across every matching control and console rule. Gateway-feature controls take precedence over console policy rules wherever they match, except console policies above priority 999 and console policies at 950 to 999 that predate the controls and are unchanged (both listed in overridden_by); console rules still apply elsewhere.",
        "example": {
          "scope": {
            "smart_groups": [
              "contractors"
            ]
          },
          "settings": {
            "hide_aliases": true,
            "show_only": [
              {
                "models": [
                  "gpt-4.1*"
                ],
                "providers": [
                  "openai"
                ]
              }
            ]
          }
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "hide": {
                "items": {
                  "additionalProperties": false,
                  "minProperties": 1,
                  "properties": {
                    "labels": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    },
                    "models": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    },
                    "providers": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    }
                  },
                  "type": "object"
                },
                "maxItems": 16,
                "minItems": 1,
                "type": "array"
              },
              "hide_aliases": {
                "const": true
              },
              "hide_all": {
                "const": true
              },
              "reveal_hidden": {
                "enum": [
                  "always",
                  "on_request",
                  "never"
                ]
              },
              "show_only": {
                "items": {
                  "additionalProperties": false,
                  "minProperties": 1,
                  "properties": {
                    "labels": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    },
                    "models": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    },
                    "providers": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    }
                  },
                  "type": "object"
                },
                "maxItems": 16,
                "minItems": 1,
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsModelVisibilityItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsModelVisibilityView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsModelVisibilityList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsModelVisibilityView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsModelVisibilityPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsModelVisibility: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsModelVisibility.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "default": 0,
                "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
                "maximum": 49,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Omitted settings are not set by this control.",
                "properties": {
                  "hide": {
                    "anyOf": [
                      {
                        "items": {
                          "additionalProperties": false,
                          "minProperties": 1,
                          "properties": {
                            "labels": {
                              "items": {
                                "maxLength": 256,
                                "minLength": 1,
                                "type": "string"
                              },
                              "maxItems": 128,
                              "minItems": 1,
                              "type": "array",
                              "uniqueItems": true
                            },
                            "models": {
                              "items": {
                                "maxLength": 256,
                                "minLength": 1,
                                "type": "string"
                              },
                              "maxItems": 128,
                              "minItems": 1,
                              "type": "array",
                              "uniqueItems": true
                            },
                            "providers": {
                              "items": {
                                "maxLength": 256,
                                "minLength": 1,
                                "type": "string"
                              },
                              "maxItems": 128,
                              "minItems": 1,
                              "type": "array",
                              "uniqueItems": true
                            }
                          },
                          "type": "object"
                        },
                        "maxItems": 16,
                        "minItems": 1,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hide_aliases": {
                    "anyOf": [
                      {
                        "const": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "hide_all": {
                    "anyOf": [
                      {
                        "const": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reveal_hidden": {
                    "anyOf": [
                      {
                        "enum": [
                          "always",
                          "on_request",
                          "never"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "show_only": {
                    "anyOf": [
                      {
                        "items": {
                          "additionalProperties": false,
                          "minProperties": 1,
                          "properties": {
                            "labels": {
                              "items": {
                                "maxLength": 256,
                                "minLength": 1,
                                "type": "string"
                              },
                              "maxItems": 128,
                              "minItems": 1,
                              "type": "array",
                              "uniqueItems": true
                            },
                            "models": {
                              "items": {
                                "maxLength": 256,
                                "minLength": 1,
                                "type": "string"
                              },
                              "maxItems": 128,
                              "minItems": 1,
                              "type": "array",
                              "uniqueItems": true
                            },
                            "providers": {
                              "items": {
                                "maxLength": 256,
                                "minLength": 1,
                                "type": "string"
                              },
                              "maxItems": 128,
                              "minItems": 1,
                              "type": "array",
                              "uniqueItems": true
                            }
                          },
                          "type": "object"
                        },
                        "maxItems": 16,
                        "minItems": 1,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsModelVisibilityView": {
        "description": "A model visibility setting as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "overridden_by": {
            "description": "Console policy rules that take precedence over this control where both apply.",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "overrides": {
            "description": "Console policy rules this control takes precedence over where both apply and both set one of its settings (union settings merge and are not listed).",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "hide": {
                "items": {
                  "additionalProperties": false,
                  "minProperties": 1,
                  "properties": {
                    "labels": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    },
                    "models": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    },
                    "providers": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    }
                  },
                  "type": "object"
                },
                "maxItems": 16,
                "minItems": 1,
                "type": "array"
              },
              "hide_aliases": {
                "const": true
              },
              "hide_all": {
                "const": true
              },
              "reveal_hidden": {
                "enum": [
                  "always",
                  "on_request",
                  "never"
                ]
              },
              "show_only": {
                "items": {
                  "additionalProperties": false,
                  "minProperties": 1,
                  "properties": {
                    "labels": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    },
                    "models": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    },
                    "providers": {
                      "items": {
                        "maxLength": 256,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 128,
                      "minItems": 1,
                      "type": "array",
                      "uniqueItems": true
                    }
                  },
                  "type": "object"
                },
                "maxItems": 16,
                "minItems": 1,
                "type": "array"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsPromptEnforcement": {
        "additionalProperties": false,
        "description": "Prompt store enforcement: require_system_from_store and the universal system prompt. Use prompt_id (a stored prompt) for prompts you edit often: editing the stored prompt needs no control change. Gateway-feature controls take precedence over console policy rules wherever they match, except console policies above priority 999 and console policies at 950 to 999 that predate the controls and are unchanged (both listed in overridden_by); console rules still apply elsewhere.",
        "example": {
          "scope": {
            "apps": [
              "support-bot"
            ]
          },
          "settings": {
            "require_system_from_store": true,
            "universal_system_prompt": {
              "enabled": true,
              "prompt_id": "support-guidelines"
            }
          }
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "require_system_from_store": {
                "type": "boolean"
              },
              "universal_system_prompt": {
                "additionalProperties": false,
                "properties": {
                  "content": {
                    "maxLength": 8192,
                    "minLength": 1,
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "prompt_id": {
                    "minLength": 1,
                    "pattern": "^[a-zA-Z0-9_-]+$",
                    "type": "string"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsPromptEnforcementItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsPromptEnforcementView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsPromptEnforcementList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsPromptEnforcementView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsPromptEnforcementPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsPromptEnforcement: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsPromptEnforcement.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "default": 0,
                "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
                "maximum": 49,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Omitted settings are not set by this control.",
                "properties": {
                  "require_system_from_store": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "universal_system_prompt": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "content": {
                            "anyOf": [
                              {
                                "maxLength": 8192,
                                "minLength": 1,
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "enabled": {
                            "anyOf": [
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "prompt_id": {
                            "anyOf": [
                              {
                                "minLength": 1,
                                "pattern": "^[a-zA-Z0-9_-]+$",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsPromptEnforcementView": {
        "description": "A prompt enforcement setting as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "overridden_by": {
            "description": "Console policy rules that take precedence over this control where both apply.",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "overrides": {
            "description": "Console policy rules this control takes precedence over where both apply and both set one of its settings (union settings merge and are not listed).",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "require_system_from_store": {
                "type": "boolean"
              },
              "universal_system_prompt": {
                "additionalProperties": false,
                "properties": {
                  "content": {
                    "maxLength": 8192,
                    "minLength": 1,
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "prompt_id": {
                    "minLength": 1,
                    "pattern": "^[a-zA-Z0-9_-]+$",
                    "type": "string"
                  }
                },
                "required": [
                  "enabled"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsPropagation": {
        "properties": {
          "pins": {
            "type": "object"
          },
          "poll_seconds": {
            "type": "integer"
          },
          "session_pins": {
            "description": "kept: existing conversations keep their pinned target and only new conversations use the new routing; dropped (repin=drop): pins of the affected apps were invalidated.",
            "enum": [
              "kept",
              "dropped"
            ]
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ControlsRateLimits": {
        "additionalProperties": false,
        "description": "A rate limit. Its quota id rl_<id> is customer-visible (the x-quilr-quota-id header of a refused request). metric, group_by and window are the counter's identity: they are ForceNew (changing them is 422 identity_field_immutable; create a rate limit with a new id).",
        "example": {
          "adjustments": {
            "ceiling": 1200,
            "max_duration": "7d"
          },
          "alerts": [
            {
              "at_pct": 80
            }
          ],
          "group_by": [
            "user"
          ],
          "label": "Support per-user RPM",
          "limit": 600,
          "metric": "requests",
          "mode": "enforce",
          "scope": {
            "apps": [
              "Support"
            ]
          },
          "window": {
            "kind": "rolling",
            "unit": "minute"
          }
        },
        "properties": {
          "adjustments": {
            "additionalProperties": false,
            "description": "Required for temporary raises (grants).",
            "properties": {
              "auto_approve": {
                "additionalProperties": false,
                "properties": {
                  "max_count": {
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "per": {
                    "enum": [
                      "day",
                      "week",
                      "month"
                    ],
                    "type": "string"
                  },
                  "smart_groups": {
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array",
                    "uniqueItems": true
                  },
                  "up_to_pct": {
                    "maximum": 1000,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "up_to_pct"
                ],
                "type": "object"
              },
              "auto_raise": {
                "additionalProperties": false,
                "properties": {
                  "add_pct": {
                    "maximum": 1000,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "at_pct": {
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "max_count": {
                    "default": 1,
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "smart_groups": {
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array",
                    "uniqueItems": true
                  }
                },
                "required": [
                  "enabled",
                  "add_pct"
                ],
                "type": "object"
              },
              "ceiling": {
                "minimum": 0,
                "type": "number"
              },
              "max_duration": {
                "default": "366d",
                "pattern": "^([1-9][0-9]{0,4}(h|d)|unlimited)$",
                "type": "string"
              },
              "overflow": {
                "additionalProperties": false,
                "properties": {
                  "add_pct": {
                    "maximum": 1000,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "add_pct"
                ],
                "type": "object"
              },
              "requestable": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "ceiling"
            ],
            "type": "object"
          },
          "alerts": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "at_pct": {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "at_pct"
              ],
              "type": "object"
            },
            "maxItems": 5,
            "type": "array"
          },
          "counter_scope": {
            "description": "per_server: each gateway server counts and enforces the limit on its own (default); shared: all servers count together (Valkey counter store).",
            "enum": [
              "per_server",
              "shared"
            ],
            "readOnly": true
          },
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "family": {
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
            "type": "string"
          },
          "group_by": {
            "default": [],
            "description": "One counter per distinct combination; [] = one shared counter.",
            "items": {
              "description": "A QuilrQL field name, or an alias (agent = request.metadata.agent_id, agent_run = request.metadata.agent_run_id, app = application.group_key, app_key = application.key_id, application.name = application.group_key, conversation = request.metadata.conversation_id, method = application.method_key, method_type = application.method_type, model = gateway.actual_model, provider = gateway.actual_provider.name, provider_label = gateway.actual_provider.label, smart_group = user.active_smart_group, tenant = tenant.id, user = user.email, user_id = user.id). Aliases are translated; responses return field names.",
              "enum": [
                "tenant.id",
                "user.id",
                "user.email",
                "user.active_smart_group",
                "application.key_id",
                "application.group_key",
                "application.method_key",
                "application.method_type",
                "gateway.actual_provider.name",
                "gateway.actual_provider.label",
                "gateway.actual_model",
                "request.metadata.conversation_id",
                "request.metadata.agent_id",
                "request.metadata.agent_run_id",
                "agent",
                "agent_run",
                "app",
                "app_key",
                "application.name",
                "conversation",
                "method",
                "method_type",
                "model",
                "provider",
                "provider_label",
                "smart_group",
                "tenant",
                "user",
                "user_id"
              ],
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true,
            "x-aliases": {
              "agent": "request.metadata.agent_id",
              "agent_run": "request.metadata.agent_run_id",
              "app": "application.group_key",
              "app_key": "application.key_id",
              "application.name": "application.group_key",
              "conversation": "request.metadata.conversation_id",
              "method": "application.method_key",
              "method_type": "application.method_type",
              "model": "gateway.actual_model",
              "provider": "gateway.actual_provider.name",
              "provider_label": "gateway.actual_provider.label",
              "smart_group": "user.active_smart_group",
              "tenant": "tenant.id",
              "user": "user.email",
              "user_id": "user.id"
            },
            "x-force-new": true
          },
          "kind": {
            "const": "rate",
            "readOnly": true
          },
          "label": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "limit": {
            "minimum": 0,
            "type": "integer"
          },
          "metric": {
            "enum": [
              "requests",
              "input_tokens",
              "output_tokens",
              "total_tokens"
            ],
            "x-force-new": true
          },
          "missing_id": {
            "default": "skip",
            "description": "With a conversation, agent or agent_run group_by: skip (default) does not count a request without that id; refuse answers 400 quota_id_required.",
            "enum": [
              "skip",
              "refuse"
            ]
          },
          "mode": {
            "default": "enforce",
            "enum": [
              "enforce",
              "alert",
              "paused"
            ]
          },
          "overrides": {
            "description": "Rate quota ids this one replaces where both apply: managed rate limits (rl_<id>) or console quotas of kind rate. Budgets are 422 override_target_not_allowed.",
            "items": {
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
              "type": "string"
            },
            "maxItems": 16,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "quota_id": {
            "readOnly": true,
            "type": "string"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "window": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "rolling"
                  },
                  "size": {
                    "description": "Window length in units (1 = omitted).",
                    "minimum": 1,
                    "type": "integer"
                  },
                  "unit": {
                    "enum": [
                      "minute",
                      "hour",
                      "day",
                      "week",
                      "month",
                      "year"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "unit"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "calendar"
                  },
                  "timezone": {
                    "default": "UTC",
                    "description": "IANA timezone.",
                    "type": "string"
                  },
                  "unit": {
                    "enum": [
                      "day",
                      "month",
                      "week",
                      "year"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "unit"
                ],
                "type": "object"
              }
            ],
            "x-force-new": true
          }
        },
        "required": [
          "metric",
          "limit",
          "window"
        ],
        "type": "object"
      },
      "ControlsRateLimitsItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsRateLimitsView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRateLimitsList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsRateLimitsView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRateLimitsPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsRateLimits: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsRateLimits.",
        "properties": {
          "adjustments": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Required for temporary raises (grants).",
                "properties": {
                  "auto_approve": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "max_count": {
                            "anyOf": [
                              {
                                "maximum": 100,
                                "minimum": 1,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "per": {
                            "anyOf": [
                              {
                                "enum": [
                                  "day",
                                  "week",
                                  "month"
                                ],
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "smart_groups": {
                            "anyOf": [
                              {
                                "items": {
                                  "minLength": 1,
                                  "type": "string"
                                },
                                "maxItems": 32,
                                "type": "array",
                                "uniqueItems": true
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "up_to_pct": {
                            "anyOf": [
                              {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "auto_raise": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "add_pct": {
                            "anyOf": [
                              {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "at_pct": {
                            "anyOf": [
                              {
                                "maximum": 100,
                                "minimum": 1,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "enabled": {
                            "anyOf": [
                              {
                                "type": "boolean"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "max_count": {
                            "anyOf": [
                              {
                                "default": 1,
                                "maximum": 100,
                                "minimum": 1,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "smart_groups": {
                            "anyOf": [
                              {
                                "items": {
                                  "minLength": 1,
                                  "type": "string"
                                },
                                "maxItems": 32,
                                "type": "array",
                                "uniqueItems": true
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ceiling": {
                    "anyOf": [
                      {
                        "minimum": 0,
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "max_duration": {
                    "anyOf": [
                      {
                        "default": "366d",
                        "pattern": "^([1-9][0-9]{0,4}(h|d)|unlimited)$",
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "overflow": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "add_pct": {
                            "anyOf": [
                              {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "requestable": {
                    "anyOf": [
                      {
                        "default": false,
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "alerts": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "at_pct": {
                      "maximum": 100,
                      "minimum": 1,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "at_pct"
                  ],
                  "type": "object"
                },
                "maxItems": 5,
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "counter_scope": {
            "anyOf": [
              {
                "description": "per_server: each gateway server counts and enforces the limit on its own (default); shared: all servers count together (Valkey counter store).",
                "enum": [
                  "per_server",
                  "shared"
                ],
                "readOnly": true
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "family": {
            "anyOf": [
              {
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "group_by": {
            "anyOf": [
              {
                "default": [],
                "description": "One counter per distinct combination; [] = one shared counter.",
                "items": {
                  "description": "A QuilrQL field name, or an alias (agent = request.metadata.agent_id, agent_run = request.metadata.agent_run_id, app = application.group_key, app_key = application.key_id, application.name = application.group_key, conversation = request.metadata.conversation_id, method = application.method_key, method_type = application.method_type, model = gateway.actual_model, provider = gateway.actual_provider.name, provider_label = gateway.actual_provider.label, smart_group = user.active_smart_group, tenant = tenant.id, user = user.email, user_id = user.id). Aliases are translated; responses return field names.",
                  "enum": [
                    "tenant.id",
                    "user.id",
                    "user.email",
                    "user.active_smart_group",
                    "application.key_id",
                    "application.group_key",
                    "application.method_key",
                    "application.method_type",
                    "gateway.actual_provider.name",
                    "gateway.actual_provider.label",
                    "gateway.actual_model",
                    "request.metadata.conversation_id",
                    "request.metadata.agent_id",
                    "request.metadata.agent_run_id",
                    "agent",
                    "agent_run",
                    "app",
                    "app_key",
                    "application.name",
                    "conversation",
                    "method",
                    "method_type",
                    "model",
                    "provider",
                    "provider_label",
                    "smart_group",
                    "tenant",
                    "user",
                    "user_id"
                  ],
                  "type": "string"
                },
                "type": "array",
                "uniqueItems": true,
                "x-aliases": {
                  "agent": "request.metadata.agent_id",
                  "agent_run": "request.metadata.agent_run_id",
                  "app": "application.group_key",
                  "app_key": "application.key_id",
                  "application.name": "application.group_key",
                  "conversation": "request.metadata.conversation_id",
                  "method": "application.method_key",
                  "method_type": "application.method_type",
                  "model": "gateway.actual_model",
                  "provider": "gateway.actual_provider.name",
                  "provider_label": "gateway.actual_provider.label",
                  "smart_group": "user.active_smart_group",
                  "tenant": "tenant.id",
                  "user": "user.email",
                  "user_id": "user.id"
                },
                "x-force-new": true
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "anyOf": [
              {
                "const": "rate",
                "readOnly": true
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "anyOf": [
              {
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "limit": {
            "anyOf": [
              {
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "metric": {
            "anyOf": [
              {
                "enum": [
                  "requests",
                  "input_tokens",
                  "output_tokens",
                  "total_tokens"
                ],
                "x-force-new": true
              },
              {
                "type": "null"
              }
            ]
          },
          "missing_id": {
            "anyOf": [
              {
                "default": "skip",
                "description": "With a conversation, agent or agent_run group_by: skip (default) does not count a request without that id; refuse answers 400 quota_id_required.",
                "enum": [
                  "skip",
                  "refuse"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "mode": {
            "anyOf": [
              {
                "default": "enforce",
                "enum": [
                  "enforce",
                  "alert",
                  "paused"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "overrides": {
            "anyOf": [
              {
                "description": "Rate quota ids this one replaces where both apply: managed rate limits (rl_<id>) or console quotas of kind rate. Budgets are 422 override_target_not_allowed.",
                "items": {
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
                  "type": "string"
                },
                "maxItems": 16,
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              },
              {
                "type": "null"
              }
            ]
          },
          "quota_id": {
            "anyOf": [
              {
                "readOnly": true,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "window": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsRateLimitsView": {
        "description": "A rate limit as read: the resource plus read-only fields.",
        "properties": {
          "adjustments": {
            "additionalProperties": false,
            "description": "Required for temporary raises (grants).",
            "properties": {
              "auto_approve": {
                "additionalProperties": false,
                "properties": {
                  "max_count": {
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "per": {
                    "enum": [
                      "day",
                      "week",
                      "month"
                    ],
                    "type": "string"
                  },
                  "smart_groups": {
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array",
                    "uniqueItems": true
                  },
                  "up_to_pct": {
                    "maximum": 1000,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "up_to_pct"
                ],
                "type": "object"
              },
              "auto_raise": {
                "additionalProperties": false,
                "properties": {
                  "add_pct": {
                    "maximum": 1000,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "at_pct": {
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "max_count": {
                    "default": 1,
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "smart_groups": {
                    "items": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array",
                    "uniqueItems": true
                  }
                },
                "required": [
                  "enabled",
                  "add_pct"
                ],
                "type": "object"
              },
              "ceiling": {
                "minimum": 0,
                "type": "number"
              },
              "max_duration": {
                "default": "366d",
                "pattern": "^([1-9][0-9]{0,4}(h|d)|unlimited)$",
                "type": "string"
              },
              "overflow": {
                "additionalProperties": false,
                "properties": {
                  "add_pct": {
                    "maximum": 1000,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "add_pct"
                ],
                "type": "object"
              },
              "requestable": {
                "default": false,
                "type": "boolean"
              }
            },
            "required": [
              "ceiling"
            ],
            "type": "object"
          },
          "alerts": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "at_pct": {
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "at_pct"
              ],
              "type": "object"
            },
            "maxItems": 5,
            "type": "array"
          },
          "counter_scope": {
            "description": "per_server: each gateway server counts and enforces the limit on its own (default); shared: all servers count together (Valkey counter store).",
            "enum": [
              "per_server",
              "shared"
            ],
            "readOnly": true
          },
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "family": {
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
            "type": "string"
          },
          "group_by": {
            "default": [],
            "description": "One counter per distinct combination; [] = one shared counter.",
            "items": {
              "description": "A QuilrQL field name, or an alias (agent = request.metadata.agent_id, agent_run = request.metadata.agent_run_id, app = application.group_key, app_key = application.key_id, application.name = application.group_key, conversation = request.metadata.conversation_id, method = application.method_key, method_type = application.method_type, model = gateway.actual_model, provider = gateway.actual_provider.name, provider_label = gateway.actual_provider.label, smart_group = user.active_smart_group, tenant = tenant.id, user = user.email, user_id = user.id). Aliases are translated; responses return field names.",
              "enum": [
                "tenant.id",
                "user.id",
                "user.email",
                "user.active_smart_group",
                "application.key_id",
                "application.group_key",
                "application.method_key",
                "application.method_type",
                "gateway.actual_provider.name",
                "gateway.actual_provider.label",
                "gateway.actual_model",
                "request.metadata.conversation_id",
                "request.metadata.agent_id",
                "request.metadata.agent_run_id",
                "agent",
                "agent_run",
                "app",
                "app_key",
                "application.name",
                "conversation",
                "method",
                "method_type",
                "model",
                "provider",
                "provider_label",
                "smart_group",
                "tenant",
                "user",
                "user_id"
              ],
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true,
            "x-aliases": {
              "agent": "request.metadata.agent_id",
              "agent_run": "request.metadata.agent_run_id",
              "app": "application.group_key",
              "app_key": "application.key_id",
              "application.name": "application.group_key",
              "conversation": "request.metadata.conversation_id",
              "method": "application.method_key",
              "method_type": "application.method_type",
              "model": "gateway.actual_model",
              "provider": "gateway.actual_provider.name",
              "provider_label": "gateway.actual_provider.label",
              "smart_group": "user.active_smart_group",
              "tenant": "tenant.id",
              "user": "user.email",
              "user_id": "user.id"
            },
            "x-force-new": true
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "const": "rate",
            "readOnly": true
          },
          "label": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "limit": {
            "minimum": 0,
            "type": "integer"
          },
          "metric": {
            "enum": [
              "requests",
              "input_tokens",
              "output_tokens",
              "total_tokens"
            ],
            "x-force-new": true
          },
          "missing_id": {
            "default": "skip",
            "description": "With a conversation, agent or agent_run group_by: skip (default) does not count a request without that id; refuse answers 400 quota_id_required.",
            "enum": [
              "skip",
              "refuse"
            ]
          },
          "mode": {
            "default": "enforce",
            "enum": [
              "enforce",
              "alert",
              "paused"
            ]
          },
          "overrides": {
            "description": "Rate quota ids this one replaces where both apply: managed rate limits (rl_<id>) or console quotas of kind rate. Budgets are 422 override_target_not_allowed.",
            "items": {
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
              "type": "string"
            },
            "maxItems": 16,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "quota_id": {
            "readOnly": true,
            "type": "string"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          },
          "window": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "rolling"
                  },
                  "size": {
                    "description": "Window length in units (1 = omitted).",
                    "minimum": 1,
                    "type": "integer"
                  },
                  "unit": {
                    "enum": [
                      "minute",
                      "hour",
                      "day",
                      "week",
                      "month",
                      "year"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "unit"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "const": "calendar"
                  },
                  "timezone": {
                    "default": "UTC",
                    "description": "IANA timezone.",
                    "type": "string"
                  },
                  "unit": {
                    "enum": [
                      "day",
                      "month",
                      "week",
                      "year"
                    ]
                  }
                },
                "required": [
                  "kind",
                  "unit"
                ],
                "type": "object"
              }
            ],
            "x-force-new": true
          }
        },
        "required": [
          "metric",
          "limit",
          "window"
        ],
        "type": "object"
      },
      "ControlsReferences": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "items": {
            "items": {
              "properties": {
                "collection": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fields": {
                  "description": "Where the label is named, following destination and failover-profile refs (for example destination(ref eu-pool).members[0]).",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "id": {
                  "type": "string"
                },
                "policy": {
                  "type": "string"
                },
                "rule_index": {
                  "type": "integer"
                },
                "source": {
                  "enum": [
                    "managed",
                    "console"
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider_label": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRequestGuards": {
        "additionalProperties": false,
        "anyOf": [
          {
            "required": [
              "max_tokens_per_request"
            ]
          },
          {
            "required": [
              "timeout_s"
            ]
          }
        ],
        "description": "Per-request token and timeout guards for the scoped requests; where several apply, the strictest value wins.",
        "example": {
          "max_tokens_per_request": 8000,
          "scope": {
            "smart_groups": [
              "Contractors"
            ]
          },
          "timeout_s": 60
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "max_tokens_per_request": {
            "description": "Ceiling on the request's estimated input tokens (the client max_tokens is not added); over it is 400 max_tokens_per_request_exceeded.",
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "timeout_s": {
            "description": "Seconds, at most 3 decimals.",
            "exclusiveMinimum": 0,
            "multipleOf": 0.001,
            "type": "number"
          }
        },
        "type": "object"
      },
      "ControlsRequestGuardsItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsRequestGuardsView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRequestGuardsList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsRequestGuardsView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRequestGuardsPatch": {
        "description": "JSON merge patch of ControlsRequestGuards: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsRequestGuards."
      },
      "ControlsRequestGuardsView": {
        "anyOf": [
          {
            "required": [
              "max_tokens_per_request"
            ]
          },
          {
            "required": [
              "timeout_s"
            ]
          }
        ],
        "description": "A request guard as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "max_tokens_per_request": {
            "description": "Ceiling on the request's estimated input tokens (the client max_tokens is not added); over it is 400 max_tokens_per_request_exceeded.",
            "minimum": 1,
            "type": "integer"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "timeout_s": {
            "description": "Seconds, at most 3 decimals.",
            "exclusiveMinimum": 0,
            "multipleOf": 0.001,
            "type": "number"
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsResource": {
        "description": "A typed control resource of this collection.",
        "type": "object"
      },
      "ControlsResponseCache": {
        "additionalProperties": false,
        "description": "Turns the response cache on or off for the scoped apps and sets how requests match (exact, normalized or semantic, with a semantic similarity preset). Gateway-feature controls take precedence over console policy rules wherever they match, except console policies above priority 999 and console policies at 950 to 999 that predate the controls and are unchanged (both listed in overridden_by); console rules still apply elsewhere.",
        "example": {
          "scope": {
            "apps": [
              "support-bot"
            ]
          },
          "settings": {
            "enabled": true
          }
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "match": {
                "enum": [
                  "exact",
                  "normalized",
                  "semantic"
                ]
              },
              "similarity": {
                "enum": [
                  "narrow",
                  "balanced",
                  "wider"
                ]
              }
            },
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsResponseCacheItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsResponseCacheView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsResponseCacheList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsResponseCacheView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsResponseCachePatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsResponseCache: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsResponseCache.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "default": 0,
                "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
                "maximum": 49,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Omitted settings are not set by this control.",
                "properties": {
                  "enabled": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "match": {
                    "anyOf": [
                      {
                        "enum": [
                          "exact",
                          "normalized",
                          "semantic"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "similarity": {
                    "anyOf": [
                      {
                        "enum": [
                          "narrow",
                          "balanced",
                          "wider"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsResponseCacheView": {
        "description": "A response cache setting as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "overridden_by": {
            "description": "Console policy rules that take precedence over this control where both apply.",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "overrides": {
            "description": "Console policy rules this control takes precedence over where both apply and both set one of its settings (union settings merge and are not listed).",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "match": {
                "enum": [
                  "exact",
                  "normalized",
                  "semantic"
                ]
              },
              "similarity": {
                "enum": [
                  "narrow",
                  "balanced",
                  "wider"
                ]
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsRestoreRequest": {
        "additionalProperties": false,
        "properties": {
          "domains": {
            "description": "Collections to restore (for example routes, destinations); omitted = every managed-controls collection that differs.",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          },
          "dry_run": {
            "default": false,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ControlsRestoreResponse": {
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "diff": {
            "$ref": "#/components/schemas/ControlsDiff"
          },
          "dry_run": {
            "type": "boolean"
          },
          "operation_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "problems": {
            "items": {
              "properties": {
                "code": {
                  "type": "string"
                },
                "collection": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "message": {
                  "type": "string"
                },
                "op": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "restore": {
            "properties": {
              "domains": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "restore_of": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "results": {
            "type": "array"
          },
          "revision": {
            "type": "integer"
          },
          "warnings": {
            "type": "array"
          },
          "would_publish": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ControlsRevisionList": {
        "properties": {
          "active_revision": {
            "type": "integer"
          },
          "items": {
            "items": {
              "properties": {
                "actor": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "created_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "domains_changed": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "kind": {
                  "enum": [
                    "managed",
                    "console",
                    "budgets",
                    "rollback",
                    "restore",
                    "conversion",
                    "app_creation",
                    "provider_models",
                    "other"
                  ]
                },
                "message": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "operation_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "restore_of": {
                  "type": "integer"
                },
                "revision": {
                  "type": "integer"
                },
                "rollback_of": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "ControlsRevisionResource": {
        "properties": {
          "collection": {
            "type": "string"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "type": "object"
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRevisionStatus": {
        "properties": {
          "active_revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "available": {
            "type": "boolean"
          },
          "complete": {
            "type": "boolean"
          },
          "lagging": {
            "type": "array"
          },
          "processes_on_rev": {
            "type": "integer"
          },
          "processes_reporting": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "scope": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ControlsRoutes": {
        "example": {
          "description": "EU staff smart alias",
          "destination": {
            "ref": "eu-pool"
          },
          "failover": {
            "ref": "standard"
          },
          "match": {
            "requested_models": [
              "smart"
            ]
          },
          "mode": "active",
          "rank": 120,
          "scope": {
            "apps": [
              "support-bot"
            ],
            "smart_groups": [
              "eu-staff"
            ]
          },
          "session": {
            "route_decision": "per_conversation"
          },
          "surface_family": "chat_completion"
        },
        "properties": {
          "conditions": {
            "additionalProperties": false,
            "description": "Content conditions, ANDed with scope, match and surface_family. A conditioned route still only selects a destination (and its failover); every condition fails open: when a check cannot run, the route does not match and the request routes normally.",
            "properties": {
              "budget": {
                "additionalProperties": false,
                "description": "Matches once the requester has used at least this percent of the budget (its effective limit, grants included), e.g. move people to a cheaper route at 80%. Read before routing on every request; unknown (no such budget, a budget counted per model or provider, no subject): no match.",
                "properties": {
                  "budget_id": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "used_pct_at_least": {
                    "exclusiveMinimum": 0,
                    "maximum": 1000,
                    "type": "number"
                  }
                },
                "required": [
                  "budget_id",
                  "used_pct_at_least"
                ],
                "type": "object"
              },
              "complexity": {
                "description": "Complexity level: from complexity-levels levels (latest user message), else word-count thresholds over all user-message text of the request. The route decision defaults to escalate.",
                "items": {
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ]
                },
                "maxItems": 2,
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              },
              "context_tokens": {
                "additionalProperties": false,
                "description": "Estimated request size in tokens (all messages), inclusive bounds.",
                "minProperties": 1,
                "properties": {
                  "max": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "min": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "data_types": {
                "description": "Matches when the latest user message contains any of these data types (policy data-type names); scanned on every message, never combined with other conditions, no session.route_decision.",
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              },
              "topics": {
                "description": "Matches when the latest user message is about any description (route classifier, once per conversation unless per_message).",
                "items": {
                  "maxLength": 300,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 8,
                "minItems": 1,
                "type": "array"
              }
            },
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "destination": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "ref"
                ],
                "type": "object"
              },
              {
                "oneOf": [
                  {
                    "description": "Weights total 100.",
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "members": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "model": {
                              "type": "string"
                            },
                            "provider_label": {
                              "type": "string"
                            },
                            "weight": {
                              "exclusiveMinimum": 0,
                              "maximum": 100,
                              "type": "number"
                            }
                          },
                          "required": [
                            "provider_label",
                            "model",
                            "weight"
                          ],
                          "type": "object"
                        },
                        "maxItems": 64,
                        "minItems": 1,
                        "type": "array"
                      },
                      "mode": {
                        "enum": [
                          "request_count",
                          "token"
                        ]
                      },
                      "type": {
                        "const": "weighted"
                      }
                    },
                    "required": [
                      "type",
                      "members"
                    ],
                    "type": "object"
                  },
                  {
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "targets": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "model": {
                              "type": "string"
                            },
                            "provider_label": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "provider_label",
                            "model"
                          ],
                          "type": "object"
                        },
                        "maxItems": 64,
                        "minItems": 1,
                        "type": "array"
                      },
                      "type": {
                        "const": "ordered"
                      }
                    },
                    "required": [
                      "type",
                      "targets"
                    ],
                    "type": "object"
                  }
                ]
              }
            ]
          },
          "enabled": {
            "description": "Alias of mode: false = disabled, true re-enables a disabled route as active. Sent together with mode, the two must agree.",
            "type": "boolean"
          },
          "failover": {
            "description": "The route's whole failover object; omitted = the matching failover rule, else the tenant default.",
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "ref"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "A failover object: how the gateway retries and where it may move a failed request.",
                "properties": {
                  "attempt_timeout_ms": {
                    "maximum": 300000,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "candidate_scope": {
                    "description": "Alias of scope (the candidate tier); returned on reads.",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "capabilities": {
                    "type": "object"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "fallbacks": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "provider_label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "provider_label",
                        "model"
                      ],
                      "type": "object"
                    },
                    "maxItems": 8,
                    "type": "array"
                  },
                  "max_attempts": {
                    "maximum": 3,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "on": {
                    "items": {
                      "enum": [
                        "timeout",
                        "connection",
                        "rate_limit",
                        "server_error",
                        "auth",
                        "model_not_found",
                        "context_length",
                        "content_filter"
                      ]
                    },
                    "type": "array"
                  },
                  "preference": {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array"
                  },
                  "same_target_retries": {
                    "maximum": 2,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "scope": {
                    "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "total_timeout_ms": {
                    "maximum": 600000,
                    "minimum": 1000,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            ]
          },
          "match": {
            "additionalProperties": false,
            "properties": {
              "requested_models": {
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "type": "array"
              }
            },
            "type": "object"
          },
          "mode": {
            "enum": [
              "active",
              "observe",
              "disabled"
            ]
          },
          "rank": {
            "description": "Order among overlapping managed routes and failover rules (higher wins; console policies with a higher priority than managed controls override them); omitted = max(overlapping) + 10, returned with rank_source assigned.",
            "maximum": 9999,
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "session": {
            "properties": {
              "route_decision": {
                "description": "per_conversation (default; a complexity route defaults to escalate), per_message, or escalate (complexity routes only: the conversation keeps its highest level). Not on data-type routes.",
                "enum": [
                  "per_conversation",
                  "per_message",
                  "escalate"
                ]
              }
            },
            "type": "object"
          },
          "surface_family": {
            "description": "The client API family the route serves; required for weighted destinations. A list makes one rule per family, each limited to that family's client API (chat_completion and anthropic_messages cannot share a list).",
            "oneOf": [
              {
                "enum": [
                  "chat_completion",
                  "anthropic_messages",
                  "vertex_ai",
                  "responses",
                  "realtime",
                  "bedrock_runtime"
                ]
              },
              {
                "items": {
                  "enum": [
                    "chat_completion",
                    "anthropic_messages",
                    "vertex_ai",
                    "responses",
                    "realtime",
                    "bedrock_runtime"
                  ]
                },
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              }
            ]
          }
        },
        "required": [
          "destination"
        ],
        "type": "object"
      },
      "ControlsRoutesItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsRoutesView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRoutesList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsRoutesView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRoutesPatch": {
        "description": "JSON merge patch of ControlsRoutes: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsRoutes.",
        "properties": {
          "conditions": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Content conditions, ANDed with scope, match and surface_family. A conditioned route still only selects a destination (and its failover); every condition fails open: when a check cannot run, the route does not match and the request routes normally.",
                "properties": {
                  "budget": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "description": "Matches once the requester has used at least this percent of the budget (its effective limit, grants included), e.g. move people to a cheaper route at 80%. Read before routing on every request; unknown (no such budget, a budget counted per model or provider, no subject): no match.",
                        "properties": {
                          "budget_id": {
                            "anyOf": [
                              {
                                "maxLength": 128,
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "used_pct_at_least": {
                            "anyOf": [
                              {
                                "exclusiveMinimum": 0,
                                "maximum": 1000,
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "complexity": {
                    "anyOf": [
                      {
                        "description": "Complexity level: from complexity-levels levels (latest user message), else word-count thresholds over all user-message text of the request. The route decision defaults to escalate.",
                        "items": {
                          "enum": [
                            "low",
                            "medium",
                            "high"
                          ]
                        },
                        "maxItems": 2,
                        "minItems": 1,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "context_tokens": {
                    "anyOf": [
                      {
                        "additionalProperties": false,
                        "description": "Estimated request size in tokens (all messages), inclusive bounds.",
                        "properties": {
                          "max": {
                            "anyOf": [
                              {
                                "minimum": 0,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "min": {
                            "anyOf": [
                              {
                                "minimum": 0,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "data_types": {
                    "anyOf": [
                      {
                        "description": "Matches when the latest user message contains any of these data types (policy data-type names); scanned on every message, never combined with other conditions, no session.route_decision.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 64,
                        "minItems": 1,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "topics": {
                    "anyOf": [
                      {
                        "description": "Matches when the latest user message is about any description (route classifier, once per conversation unless per_message).",
                        "items": {
                          "maxLength": 300,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 8,
                        "minItems": 1,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "destination": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "anyOf": [
              {
                "description": "Alias of mode: false = disabled, true re-enables a disabled route as active. Sent together with mode, the two must agree.",
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "failover": {
            "anyOf": [
              {
                "description": "The route's whole failover object; omitted = the matching failover rule, else the tenant default."
              },
              {
                "type": "null"
              }
            ]
          },
          "match": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "requested_models": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 64,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "mode": {
            "anyOf": [
              {
                "enum": [
                  "active",
                  "observe",
                  "disabled"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "description": "Order among overlapping managed routes and failover rules (higher wins; console policies with a higher priority than managed controls override them); omitted = max(overlapping) + 10, returned with rank_source assigned.",
                "maximum": 9999,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty lists do not restrict.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "session": {
            "anyOf": [
              {
                "properties": {
                  "route_decision": {
                    "anyOf": [
                      {
                        "description": "per_conversation (default; a complexity route defaults to escalate), per_message, or escalate (complexity routes only: the conversation keeps its highest level). Not on data-type routes.",
                        "enum": [
                          "per_conversation",
                          "per_message",
                          "escalate"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "surface_family": {
            "anyOf": [
              {
                "description": "The client API family the route serves; required for weighted destinations. A list makes one rule per family, each limited to that family's client API (chat_completion and anthropic_messages cannot share a list)."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsRoutesSetMode": {
        "properties": {
          "mode": {
            "enum": [
              "active",
              "observe",
              "disabled"
            ]
          }
        },
        "required": [
          "mode"
        ],
        "type": "object"
      },
      "ControlsRoutesView": {
        "description": "A route as read: the resource plus read-only fields.",
        "properties": {
          "conditions": {
            "additionalProperties": false,
            "description": "Content conditions, ANDed with scope, match and surface_family. A conditioned route still only selects a destination (and its failover); every condition fails open: when a check cannot run, the route does not match and the request routes normally.",
            "properties": {
              "budget": {
                "additionalProperties": false,
                "description": "Matches once the requester has used at least this percent of the budget (its effective limit, grants included), e.g. move people to a cheaper route at 80%. Read before routing on every request; unknown (no such budget, a budget counted per model or provider, no subject): no match.",
                "properties": {
                  "budget_id": {
                    "maxLength": 128,
                    "type": "string"
                  },
                  "used_pct_at_least": {
                    "exclusiveMinimum": 0,
                    "maximum": 1000,
                    "type": "number"
                  }
                },
                "required": [
                  "budget_id",
                  "used_pct_at_least"
                ],
                "type": "object"
              },
              "complexity": {
                "description": "Complexity level: from complexity-levels levels (latest user message), else word-count thresholds over all user-message text of the request. The route decision defaults to escalate.",
                "items": {
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ]
                },
                "maxItems": 2,
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              },
              "context_tokens": {
                "additionalProperties": false,
                "description": "Estimated request size in tokens (all messages), inclusive bounds.",
                "minProperties": 1,
                "properties": {
                  "max": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "min": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "data_types": {
                "description": "Matches when the latest user message contains any of these data types (policy data-type names); scanned on every message, never combined with other conditions, no session.route_decision.",
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              },
              "topics": {
                "description": "Matches when the latest user message is about any description (route classifier, once per conversation unless per_message).",
                "items": {
                  "maxLength": 300,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 8,
                "minItems": 1,
                "type": "array"
              }
            },
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "destination": {
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "ref"
                ],
                "type": "object"
              },
              {
                "oneOf": [
                  {
                    "description": "Weights total 100.",
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "members": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "model": {
                              "type": "string"
                            },
                            "provider_label": {
                              "type": "string"
                            },
                            "weight": {
                              "exclusiveMinimum": 0,
                              "maximum": 100,
                              "type": "number"
                            }
                          },
                          "required": [
                            "provider_label",
                            "model",
                            "weight"
                          ],
                          "type": "object"
                        },
                        "maxItems": 64,
                        "minItems": 1,
                        "type": "array"
                      },
                      "mode": {
                        "enum": [
                          "request_count",
                          "token"
                        ]
                      },
                      "type": {
                        "const": "weighted"
                      }
                    },
                    "required": [
                      "type",
                      "members"
                    ],
                    "type": "object"
                  },
                  {
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "targets": {
                        "items": {
                          "additionalProperties": false,
                          "properties": {
                            "model": {
                              "type": "string"
                            },
                            "provider_label": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "provider_label",
                            "model"
                          ],
                          "type": "object"
                        },
                        "maxItems": 64,
                        "minItems": 1,
                        "type": "array"
                      },
                      "type": {
                        "const": "ordered"
                      }
                    },
                    "required": [
                      "type",
                      "targets"
                    ],
                    "type": "object"
                  }
                ]
              }
            ]
          },
          "enabled": {
            "description": "Alias of mode: false = disabled, true re-enables a disabled route as active. Sent together with mode, the two must agree.",
            "type": "boolean"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "failover": {
            "description": "The route's whole failover object; omitted = the matching failover rule, else the tenant default.",
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "ref": {
                    "type": "string"
                  }
                },
                "required": [
                  "ref"
                ],
                "type": "object"
              },
              {
                "additionalProperties": false,
                "description": "A failover object: how the gateway retries and where it may move a failed request.",
                "properties": {
                  "attempt_timeout_ms": {
                    "maximum": 300000,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "candidate_scope": {
                    "description": "Alias of scope (the candidate tier); returned on reads.",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "capabilities": {
                    "type": "object"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "fallbacks": {
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "model": {
                          "type": "string"
                        },
                        "provider_label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "provider_label",
                        "model"
                      ],
                      "type": "object"
                    },
                    "maxItems": 8,
                    "type": "array"
                  },
                  "max_attempts": {
                    "maximum": 3,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "on": {
                    "items": {
                      "enum": [
                        "timeout",
                        "connection",
                        "rate_limit",
                        "server_error",
                        "auth",
                        "model_not_found",
                        "context_length",
                        "content_filter"
                      ]
                    },
                    "type": "array"
                  },
                  "preference": {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 32,
                    "type": "array"
                  },
                  "same_target_retries": {
                    "maximum": 2,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "scope": {
                    "description": "Candidate tier: how far failover may look for another target (not the resource scope).",
                    "enum": [
                      "route",
                      "same_model",
                      "app"
                    ]
                  },
                  "total_timeout_ms": {
                    "maximum": 600000,
                    "minimum": 1000,
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "match": {
            "additionalProperties": false,
            "properties": {
              "requested_models": {
                "items": {
                  "type": "string"
                },
                "maxItems": 64,
                "type": "array"
              }
            },
            "type": "object"
          },
          "mode": {
            "enum": [
              "active",
              "observe",
              "disabled"
            ]
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "description": "Order among overlapping managed routes and failover rules (higher wins; console policies with a higher priority than managed controls override them); omitted = max(overlapping) + 10, returned with rank_source assigned.",
            "maximum": 9999,
            "minimum": 1,
            "type": "integer"
          },
          "rank_source": {
            "enum": [
              "explicit",
              "assigned"
            ]
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rule_indexes": {
            "description": "surface_family lists: one rendered rule per family.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "session": {
            "properties": {
              "route_decision": {
                "description": "per_conversation (default; a complexity route defaults to escalate), per_message, or escalate (complexity routes only: the conversation keeps its highest level). Not on data-type routes.",
                "enum": [
                  "per_conversation",
                  "per_message",
                  "escalate"
                ]
              }
            },
            "type": "object"
          },
          "shadowed_by": {
            "description": "Managed routes with a higher rank and console rules above the band (or at it with a higher rank) that win where they overlap; full = this route never routes.",
            "items": {
              "properties": {
                "coverage": {
                  "enum": [
                    "full",
                    "partial"
                  ]
                },
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "route_id": {
                  "type": "string"
                },
                "rule_index": {
                  "type": "integer"
                },
                "source": {
                  "enum": [
                    "managed",
                    "console"
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "surface_family": {
            "description": "The client API family the route serves; required for weighted destinations. A list makes one rule per family, each limited to that family's client API (chat_completion and anthropic_messages cannot share a list).",
            "oneOf": [
              {
                "enum": [
                  "chat_completion",
                  "anthropic_messages",
                  "vertex_ai",
                  "responses",
                  "realtime",
                  "bedrock_runtime"
                ]
              },
              {
                "items": {
                  "enum": [
                    "chat_completion",
                    "anthropic_messages",
                    "vertex_ai",
                    "responses",
                    "realtime",
                    "bedrock_runtime"
                  ]
                },
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              }
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "destination"
        ],
        "type": "object"
      },
      "ControlsRoutingConstraints": {
        "description": "Accumulates with every matching rule (console rules included); no rank.",
        "example": {
          "description": "EU residency",
          "match": [
            {
              "in": [
                "eu"
              ],
              "tag": "provider.geo"
            }
          ],
          "providers": {
            "not_in": [
              "openai-direct"
            ]
          },
          "require": [
            {
              "name": "context_at_least",
              "tokens": 128000
            }
          ],
          "scope": {
            "smart_groups": [
              "eu-staff"
            ]
          }
        },
        "properties": {
          "description": {
            "type": "string"
          },
          "match": {
            "description": "Tag checks, ANDed; tag plus exactly one operator.",
            "items": {
              "maxProperties": 2,
              "minProperties": 2,
              "properties": {
                "equals": {
                  "type": [
                    "string",
                    "number",
                    "boolean"
                  ]
                },
                "exists": {
                  "type": "boolean"
                },
                "in": {
                  "items": {
                    "type": [
                      "string",
                      "number",
                      "boolean"
                    ]
                  },
                  "type": "array"
                },
                "not_in": {
                  "items": {
                    "type": [
                      "string",
                      "number",
                      "boolean"
                    ]
                  },
                  "type": "array"
                },
                "tag": {
                  "description": "provider.<key> or model.<key>, e.g. provider.geo",
                  "pattern": "^(provider|model)\\.[^ ]{1,64}$",
                  "type": "string"
                }
              },
              "required": [
                "tag"
              ],
              "type": "object"
            },
            "minItems": 1,
            "type": "array"
          },
          "on_check_failure": {
            "enum": [
              "route",
              "block"
            ]
          },
          "providers": {
            "additionalProperties": false,
            "description": "Exactly one of in / not_in (provider labels).",
            "maxProperties": 1,
            "minProperties": 1,
            "properties": {
              "in": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "not_in": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "require": {
            "description": "Capability requirements, unioned across rules.",
            "items": {
              "properties": {
                "name": {
                  "description": "A capability, e.g. context_at_least",
                  "type": "string"
                },
                "tokens": {
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "name"
              ],
              "type": "object"
            },
            "minItems": 1,
            "type": "array"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "when": {
            "properties": {
              "data_types": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsRoutingConstraintsItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsRoutingConstraintsView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRoutingConstraintsList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsRoutingConstraintsView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsRoutingConstraintsPatch": {
        "description": "JSON merge patch of ControlsRoutingConstraints: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsRoutingConstraints.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "match": {
            "anyOf": [
              {
                "description": "Tag checks, ANDed; tag plus exactly one operator.",
                "items": {
                  "maxProperties": 2,
                  "minProperties": 2,
                  "properties": {
                    "equals": {
                      "type": [
                        "string",
                        "number",
                        "boolean"
                      ]
                    },
                    "exists": {
                      "type": "boolean"
                    },
                    "in": {
                      "items": {
                        "type": [
                          "string",
                          "number",
                          "boolean"
                        ]
                      },
                      "type": "array"
                    },
                    "not_in": {
                      "items": {
                        "type": [
                          "string",
                          "number",
                          "boolean"
                        ]
                      },
                      "type": "array"
                    },
                    "tag": {
                      "description": "provider.<key> or model.<key>, e.g. provider.geo",
                      "pattern": "^(provider|model)\\.[^ ]{1,64}$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "tag"
                  ],
                  "type": "object"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "on_check_failure": {
            "anyOf": [
              {
                "enum": [
                  "route",
                  "block"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "providers": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Exactly one of in / not_in (provider labels).",
                "maxProperties": 1,
                "properties": {
                  "in": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "not_in": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "require": {
            "anyOf": [
              {
                "description": "Capability requirements, unioned across rules.",
                "items": {
                  "properties": {
                    "name": {
                      "description": "A capability, e.g. context_at_least",
                      "type": "string"
                    },
                    "tokens": {
                      "minimum": 1,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": "object"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty lists do not restrict.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "when": {
            "anyOf": [
              {
                "properties": {
                  "data_types": {
                    "anyOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsRoutingConstraintsView": {
        "description": "A routing constraint as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "match": {
            "description": "Tag checks, ANDed; tag plus exactly one operator.",
            "items": {
              "maxProperties": 2,
              "minProperties": 2,
              "properties": {
                "equals": {
                  "type": [
                    "string",
                    "number",
                    "boolean"
                  ]
                },
                "exists": {
                  "type": "boolean"
                },
                "in": {
                  "items": {
                    "type": [
                      "string",
                      "number",
                      "boolean"
                    ]
                  },
                  "type": "array"
                },
                "not_in": {
                  "items": {
                    "type": [
                      "string",
                      "number",
                      "boolean"
                    ]
                  },
                  "type": "array"
                },
                "tag": {
                  "description": "provider.<key> or model.<key>, e.g. provider.geo",
                  "pattern": "^(provider|model)\\.[^ ]{1,64}$",
                  "type": "string"
                }
              },
              "required": [
                "tag"
              ],
              "type": "object"
            },
            "minItems": 1,
            "type": "array"
          },
          "on_check_failure": {
            "enum": [
              "route",
              "block"
            ]
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "providers": {
            "additionalProperties": false,
            "description": "Exactly one of in / not_in (provider labels).",
            "maxProperties": 1,
            "minProperties": 1,
            "properties": {
              "in": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "not_in": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "read_only": {
            "type": "boolean"
          },
          "require": {
            "description": "Capability requirements, unioned across rules.",
            "items": {
              "properties": {
                "name": {
                  "description": "A capability, e.g. context_at_least",
                  "type": "string"
                },
                "tokens": {
                  "minimum": 1,
                  "type": "integer"
                }
              },
              "required": [
                "name"
              ],
              "type": "object"
            },
            "minItems": 1,
            "type": "array"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty lists do not restrict.",
            "properties": {
              "app_tags": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "apps": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "smart_groups": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              },
              "users": {
                "items": {
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          },
          "when": {
            "properties": {
              "data_types": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ControlsTokenSaving": {
        "additionalProperties": false,
        "description": "Request-body token saving methods for the scoped requests (true turns a method on, false off). Gateway-feature controls take precedence over console policy rules wherever they match, except console policies above priority 999 and console policies at 950 to 999 that predate the controls and are unchanged (both listed in overridden_by); console rules still apply elsewhere.",
        "example": {
          "rank": 10,
          "scope": {
            "apps": [
              "support-bot"
            ]
          },
          "settings": {
            "json_minification": true,
            "tool_output_cleanup": true
          }
        },
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "base64_blob_elision": {
                "type": "boolean"
              },
              "html_to_text": {
                "type": "boolean"
              },
              "json_minification": {
                "type": "boolean"
              },
              "markdown_to_text": {
                "type": "boolean"
              },
              "smart_json_compression": {
                "type": "boolean"
              },
              "text_compression": {
                "type": "boolean"
              },
              "tool_output_cleanup": {
                "type": "boolean"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsTokenSavingItem": {
        "properties": {
          "default": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "resource": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ControlsTokenSavingView"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsTokenSavingList": {
        "properties": {
          "etag": {
            "type": "string"
          },
          "filters": {
            "type": "object"
          },
          "items": {
            "description": "Managed resources, then read-only console rules (source console).",
            "items": {
              "$ref": "#/components/schemas/ControlsTokenSavingView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Bound to revision: 409 collection_changed when the policy changed between pages.",
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ControlsTokenSavingPatch": {
        "additionalProperties": false,
        "description": "JSON merge patch of ControlsTokenSaving: send only the fields to change; null removes a field (nested objects merge, lists are replaced). The merged resource must be a valid ControlsTokenSaving.",
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rank": {
            "anyOf": [
              {
                "default": 0,
                "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
                "maximum": 49,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "scope": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
                "properties": {
                  "app_tags": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "apps": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_groups": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "users": {
                    "anyOf": [
                      {
                        "items": {
                          "maxLength": 256,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array",
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "settings": {
            "anyOf": [
              {
                "additionalProperties": false,
                "description": "Omitted settings are not set by this control.",
                "properties": {
                  "base64_blob_elision": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "html_to_text": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "json_minification": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "markdown_to_text": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "smart_json_compression": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "text_compression": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tool_output_cleanup": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "ControlsTokenSavingView": {
        "description": "A token saving setting as read: the resource plus read-only fields.",
        "properties": {
          "description": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "overridden_by": {
            "description": "Console policy rules that take precedence over this control where both apply.",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "overrides": {
            "description": "Console policy rules this control takes precedence over where both apply and both set one of its settings (union settings merge and are not listed).",
            "items": {
              "properties": {
                "policy": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "rank": {
                  "type": "integer"
                },
                "rule_index": {
                  "type": "integer"
                },
                "settings": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "policy": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "rank": {
            "default": 0,
            "description": "Orders overlapping controls of this collection: the higher rank wins. Two overlapping controls with the same rank and different values are 422 feature_conflict.",
            "maximum": 49,
            "minimum": 0,
            "type": "integer"
          },
          "read_only": {
            "type": "boolean"
          },
          "rule_index": {
            "type": [
              "integer",
              "null"
            ]
          },
          "scope": {
            "additionalProperties": false,
            "description": "Every non-empty list must match (AND); empty or omitted lists do not restrict. Returned with every field present.",
            "properties": {
              "app_tags": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "apps": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "smart_groups": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              },
              "users": {
                "items": {
                  "maxLength": 256,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 100,
                "type": "array",
                "uniqueItems": true
              }
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": false,
            "description": "Omitted settings are not set by this control.",
            "minProperties": 1,
            "properties": {
              "base64_blob_elision": {
                "type": "boolean"
              },
              "html_to_text": {
                "type": "boolean"
              },
              "json_minification": {
                "type": "boolean"
              },
              "markdown_to_text": {
                "type": "boolean"
              },
              "smart_json_compression": {
                "type": "boolean"
              },
              "text_compression": {
                "type": "boolean"
              },
              "tool_output_cleanup": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "source": {
            "enum": [
              "managed",
              "console"
            ]
          },
          "view": {
            "description": "Console rows: condition, scope and effects (read-only).",
            "type": "object"
          }
        },
        "required": [
          "settings"
        ],
        "type": "object"
      },
      "ControlsWarning": {
        "properties": {
          "code": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ControlsWriteResponse": {
        "properties": {
          "blocking": {
            "description": "Dry runs: the error diagnostics that stop the publish (empty when would_publish is true or nothing changed).",
            "type": "array"
          },
          "changed": {
            "type": "boolean"
          },
          "deleted": {
            "type": "boolean"
          },
          "diagnostics": {
            "type": "array"
          },
          "diff": {
            "$ref": "#/components/schemas/ControlsDiff"
          },
          "dry_run": {
            "type": "boolean"
          },
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "impact": {
            "properties": {
              "apps": {
                "oneOf": [
                  {
                    "const": "*"
                  },
                  {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                ]
              },
              "models": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "pins": {
                "description": "Routing changes: the apps whose session pins repin=drop would drop (\"*\" = every app; needs repin_scope=tenant).",
                "properties": {
                  "apps": {
                    "oneOf": [
                      {
                        "const": "*"
                      },
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    ]
                  }
                },
                "type": "object"
              },
              "routes": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "routes_without_candidates": {
                "type": "array"
              }
            },
            "type": "object"
          },
          "operation_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "propagation": {
            "$ref": "#/components/schemas/ControlsPropagation"
          },
          "replayed": {
            "type": "boolean"
          },
          "reset": {
            "type": "boolean"
          },
          "resource": {
            "type": "object"
          },
          "revision": {
            "type": "integer"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/ControlsWarning"
            },
            "type": "array"
          },
          "would_publish": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Conversion": {
        "additionalProperties": false,
        "properties": {
          "provider_labels": {
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "routing": {
            "additionalProperties": false,
            "properties": {
              "custom_routing": {
                "items": {
                  "$ref": "#/components/schemas/ContextRoute"
                },
                "type": "array"
              },
              "routing_groups": {
                "items": {
                  "$ref": "#/components/schemas/RoutingGroup"
                },
                "type": "array"
              },
              "routing_thresholds": {
                "additionalProperties": false,
                "description": "Word-count boundaries of context routes: 0 <= low_max_words <= medium_max_words.",
                "properties": {
                  "low_max_words": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "medium_max_words": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "low_max_words",
                  "medium_max_words"
                ],
                "type": "object"
              },
              "token_based_routing_groups": {
                "items": {
                  "$ref": "#/components/schemas/RoutingGroup"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "provider_labels"
        ],
        "type": "object"
      },
      "CustomDefinition": {
        "additionalProperties": true,
        "properties": {
          "definition_id": {
            "description": "Stable ID (same as edm_id): the path id and the definition_id in app detection.custom_definitions.",
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "edm_id": {
            "description": "Stable ID; use it as definition_id in app settings.",
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "globally_enabled": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "edm_id"
        ],
        "type": "object"
      },
      "CustomDefinitionList": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CustomDefinition"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "CustomDefinitionResponse": {
        "additionalProperties": true,
        "properties": {
          "definition": {
            "$ref": "#/components/schemas/CustomDefinition"
          }
        },
        "required": [
          "definition"
        ],
        "type": "object"
      },
      "CustomSelection": {
        "additionalProperties": false,
        "description": "Selects an existing custom definition. Definitions themselves (patterns, exact data, examples) cannot be authored through this API.",
        "properties": {
          "action": {
            "description": "Adversarial detections have no redactable spans; actions they cannot apply are rejected.",
            "enum": [
              "monitor",
              "partial-redact",
              "tokenize",
              "redact",
              "block"
            ],
            "type": "string"
          },
          "definition_id": {
            "description": "Stable ID from GET /custom-definitions.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "scope": {
            "enum": [
              "request",
              "response",
              "both"
            ],
            "type": "string"
          },
          "sensitivity": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          }
        },
        "required": [
          "definition_id"
        ],
        "type": "object"
      },
      "Empty": {
        "additionalProperties": false,
        "properties": {},
        "type": "object"
      },
      "Error": {
        "additionalProperties": true,
        "properties": {
          "error": {
            "additionalProperties": true,
            "properties": {
              "code": {
                "description": "Stable machine-readable code.",
                "type": "string"
              },
              "fields": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "message": {
                "type": "string"
              },
              "operation_id": {
                "description": "Present when an operation can be recovered.",
                "type": "string"
              },
              "required_scopes": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "type": "object"
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "request_id"
        ],
        "type": "object"
      },
      "ExplainRule": {
        "additionalProperties": true,
        "description": "A policy rule that decided part of this request.",
        "properties": {
          "control": {
            "additionalProperties": true,
            "description": "For managed rules: the control that decided.",
            "properties": {
              "collection": {
                "description": "The /controls collection, such as routes or failover-rules.",
                "type": "string"
              },
              "id": {
                "description": "The control's id. Absent when only the collection is known.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "managed": {
            "description": "The rule belongs to a typed control (routes, limits, budgets) rather than a policy you wrote.",
            "type": "boolean"
          },
          "policy": {
            "description": "Name of your policy that holds the rule. Absent for controls managed through this API or the console (managed: true).",
            "type": "string"
          },
          "route_id": {
            "description": "Opaque route id, the value clients see in the x-quilr-route response header. Present for routing rules.",
            "type": "string"
          },
          "rule_index": {
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "FailoverSummary": {
        "description": "The console failover summary.",
        "type": "object"
      },
      "FeatureMetricsRow": {
        "description": "One aggregate. Holds `period_start` when granularity is not total and one key per group_by dimension.",
        "properties": {
          "app": {
            "description": "App name.",
            "type": [
              "string",
              "null"
            ]
          },
          "failover": {
            "description": "Gateway retries and failover.",
            "properties": {
              "exhausted": {
                "description": "Requests that failed after every eligible attempt.",
                "minimum": 0,
                "type": "integer"
              },
              "recovered": {
                "description": "Requests whose first attempt failed and a later one served.",
                "minimum": 0,
                "type": "integer"
              },
              "requests_moved": {
                "description": "Requests moved to another target.",
                "minimum": 0,
                "type": "integer"
              },
              "requests_retried": {
                "description": "Requests retried on the same target.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "requests_retried",
              "requests_moved",
              "recovered",
              "exhausted"
            ],
            "type": "object"
          },
          "model": {
            "description": "Served model.",
            "type": [
              "string",
              "null"
            ]
          },
          "period_start": {
            "description": "Start of the period, UTC: a date (YYYY-MM-DD; weeks start Monday) for day, week and month, or an RFC 3339 timestamp (YYYY-MM-DDTHH:00:00Z) for hour; absent when granularity is total.",
            "type": "string"
          },
          "prompt_cache": {
            "description": "The provider's own prompt caching.",
            "properties": {
              "cache_write_tokens": {
                "description": "Input tokens written to the provider's prompt cache.",
                "minimum": 0,
                "type": "integer"
              },
              "cached_input_pct": {
                "description": "cached_input_tokens / input_tokens.",
                "maximum": 100,
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "cached_input_tokens": {
                "description": "Input tokens read from the provider's prompt cache.",
                "minimum": 0,
                "type": "integer"
              },
              "input_tokens": {
                "description": "Input tokens the provider reported.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "input_tokens",
              "cached_input_tokens",
              "cache_write_tokens",
              "cached_input_pct"
            ],
            "type": "object"
          },
          "provider": {
            "description": "Provider name as configured.",
            "type": [
              "string",
              "null"
            ]
          },
          "requests": {
            "description": "Requests in this row.",
            "minimum": 0,
            "type": "integer"
          },
          "response_cache": {
            "description": "The gateway response cache (only apps with it enabled have hits, misses or bypasses). Counted from coverage.response_cache_from; null when the whole range is before it.",
            "properties": {
              "bypassed": {
                "description": "Response cache on but not used for the request (for example streaming, or the client asked for no cache).",
                "minimum": 0,
                "type": "integer"
              },
              "hit_rate_pct": {
                "description": "hits / (hits + misses); null without lookups.",
                "maximum": 100,
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "hits": {
                "description": "Answered from the gateway's response cache.",
                "minimum": 0,
                "type": "integer"
              },
              "misses": {
                "description": "Looked up, not found, sent to the provider.",
                "minimum": 0,
                "type": "integer"
              },
              "saved_cost_usd": {
                "description": "Cost of the original responses that hits reused, in USD.",
                "minimum": 0,
                "type": "number"
              },
              "saved_input_tokens": {
                "description": "Input tokens hits did not send to the provider.",
                "minimum": 0,
                "type": "integer"
              },
              "saved_output_tokens": {
                "description": "Output tokens hits did not generate.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "hits",
              "misses",
              "bypassed",
              "hit_rate_pct",
              "saved_input_tokens",
              "saved_output_tokens",
              "saved_cost_usd"
            ],
            "type": [
              "object",
              "null"
            ]
          },
          "status_classes": {
            "description": "Requests by HTTP status class returned to the client; `none` when no status was recorded (for example a dropped connection).",
            "properties": {
              "2xx": {
                "minimum": 0,
                "type": "integer"
              },
              "3xx": {
                "minimum": 0,
                "type": "integer"
              },
              "4xx": {
                "minimum": 0,
                "type": "integer"
              },
              "5xx": {
                "minimum": 0,
                "type": "integer"
              },
              "none": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "2xx",
              "3xx",
              "4xx",
              "5xx",
              "none"
            ],
            "type": "object"
          },
          "streaming": {
            "properties": {
              "requests": {
                "description": "Streaming requests.",
                "minimum": 0,
                "type": "integer"
              },
              "share_pct": {
                "description": "Streaming share of requests; null without requests.",
                "maximum": 100,
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "required": [
              "requests",
              "share_pct"
            ],
            "type": "object"
          },
          "surface": {
            "description": "API surface (for example chat).",
            "type": [
              "string",
              "null"
            ]
          },
          "token_saving": {
            "description": "Gateway token saving.",
            "properties": {
              "by_method": {
                "description": "Tokens removed per method.",
                "properties": {
                  "base64_blob_elision": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "html_to_text": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "json_minification": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "markdown_to_text": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "smart_json_compression": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "text_compression": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "tool_output_cleanup": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "smart_json_compression",
                  "html_to_text",
                  "markdown_to_text",
                  "text_compression",
                  "json_minification",
                  "tool_output_cleanup",
                  "base64_blob_elision"
                ],
                "type": "object"
              },
              "requests": {
                "description": "Requests the gateway shrank before sending.",
                "minimum": 0,
                "type": "integer"
              },
              "tokens_saved": {
                "description": "Input tokens removed, all methods.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "requests",
              "tokens_saved",
              "by_method"
            ],
            "type": "object"
          }
        },
        "required": [
          "requests",
          "streaming",
          "status_classes",
          "response_cache",
          "token_saving",
          "prompt_cache",
          "failover"
        ],
        "type": "object"
      },
      "FeatureMetricsSummary": {
        "properties": {
          "coverage": {
            "properties": {
              "response_cache_from": {
                "description": "Response cache metrics count requests from this time on; earlier requests did not record them. null while the start is still being established: counts then cover only requests that recorded them.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "response_cache_from"
            ],
            "type": "object"
          },
          "data_through": {
            "description": "Effective exclusive end of the data counted: the requested `to`, or the time of the read when `to` is omitted. Requests are written a few seconds to minutes after they finish, so the most recent ones can be missing.",
            "format": "date-time",
            "type": "string"
          },
          "filters": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "from": {
            "description": "Inclusive start.",
            "format": "date-time",
            "type": "string"
          },
          "generated_at": {
            "description": "When the data behind this response was read from storage (UTC). Results are cached, so this can be up to 60 seconds before the response.",
            "format": "date-time",
            "type": "string"
          },
          "granularity": {
            "enum": [
              "total",
              "month",
              "week",
              "day",
              "hour"
            ]
          },
          "group_by": {
            "items": {
              "enum": [
                "app",
                "model",
                "provider",
                "surface"
              ]
            },
            "maxItems": 2,
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/FeatureMetricsRow"
            },
            "type": "array"
          },
          "timezone": {
            "const": "UTC"
          },
          "to": {
            "description": "Exclusive end; null for now.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "totals": {
            "$ref": "#/components/schemas/FeatureMetricsTotals"
          },
          "truncated": {
            "description": "More than 5000 rows matched.",
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "to",
          "granularity",
          "timezone",
          "group_by",
          "coverage",
          "totals",
          "rows",
          "next_cursor",
          "truncated",
          "generated_at",
          "data_through"
        ],
        "type": "object"
      },
      "FeatureMetricsTotals": {
        "properties": {
          "failover": {
            "description": "Gateway retries and failover.",
            "properties": {
              "exhausted": {
                "description": "Requests that failed after every eligible attempt.",
                "minimum": 0,
                "type": "integer"
              },
              "recovered": {
                "description": "Requests whose first attempt failed and a later one served.",
                "minimum": 0,
                "type": "integer"
              },
              "requests_moved": {
                "description": "Requests moved to another target.",
                "minimum": 0,
                "type": "integer"
              },
              "requests_retried": {
                "description": "Requests retried on the same target.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "requests_retried",
              "requests_moved",
              "recovered",
              "exhausted"
            ],
            "type": "object"
          },
          "prompt_cache": {
            "description": "The provider's own prompt caching.",
            "properties": {
              "cache_write_tokens": {
                "description": "Input tokens written to the provider's prompt cache.",
                "minimum": 0,
                "type": "integer"
              },
              "cached_input_pct": {
                "description": "cached_input_tokens / input_tokens.",
                "maximum": 100,
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "cached_input_tokens": {
                "description": "Input tokens read from the provider's prompt cache.",
                "minimum": 0,
                "type": "integer"
              },
              "input_tokens": {
                "description": "Input tokens the provider reported.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "input_tokens",
              "cached_input_tokens",
              "cache_write_tokens",
              "cached_input_pct"
            ],
            "type": "object"
          },
          "requests": {
            "description": "Requests in this row.",
            "minimum": 0,
            "type": "integer"
          },
          "response_cache": {
            "description": "The gateway response cache (only apps with it enabled have hits, misses or bypasses). Counted from coverage.response_cache_from; null when the whole range is before it.",
            "properties": {
              "bypassed": {
                "description": "Response cache on but not used for the request (for example streaming, or the client asked for no cache).",
                "minimum": 0,
                "type": "integer"
              },
              "hit_rate_pct": {
                "description": "hits / (hits + misses); null without lookups.",
                "maximum": 100,
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "hits": {
                "description": "Answered from the gateway's response cache.",
                "minimum": 0,
                "type": "integer"
              },
              "misses": {
                "description": "Looked up, not found, sent to the provider.",
                "minimum": 0,
                "type": "integer"
              },
              "saved_cost_usd": {
                "description": "Cost of the original responses that hits reused, in USD.",
                "minimum": 0,
                "type": "number"
              },
              "saved_input_tokens": {
                "description": "Input tokens hits did not send to the provider.",
                "minimum": 0,
                "type": "integer"
              },
              "saved_output_tokens": {
                "description": "Output tokens hits did not generate.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "hits",
              "misses",
              "bypassed",
              "hit_rate_pct",
              "saved_input_tokens",
              "saved_output_tokens",
              "saved_cost_usd"
            ],
            "type": [
              "object",
              "null"
            ]
          },
          "status_classes": {
            "description": "Requests by HTTP status class returned to the client; `none` when no status was recorded (for example a dropped connection).",
            "properties": {
              "2xx": {
                "minimum": 0,
                "type": "integer"
              },
              "3xx": {
                "minimum": 0,
                "type": "integer"
              },
              "4xx": {
                "minimum": 0,
                "type": "integer"
              },
              "5xx": {
                "minimum": 0,
                "type": "integer"
              },
              "none": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "2xx",
              "3xx",
              "4xx",
              "5xx",
              "none"
            ],
            "type": "object"
          },
          "streaming": {
            "properties": {
              "requests": {
                "description": "Streaming requests.",
                "minimum": 0,
                "type": "integer"
              },
              "share_pct": {
                "description": "Streaming share of requests; null without requests.",
                "maximum": 100,
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "required": [
              "requests",
              "share_pct"
            ],
            "type": "object"
          },
          "token_saving": {
            "description": "Gateway token saving.",
            "properties": {
              "by_method": {
                "description": "Tokens removed per method.",
                "properties": {
                  "base64_blob_elision": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "html_to_text": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "json_minification": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "markdown_to_text": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "smart_json_compression": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "text_compression": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "tool_output_cleanup": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "required": [
                  "smart_json_compression",
                  "html_to_text",
                  "markdown_to_text",
                  "text_compression",
                  "json_minification",
                  "tool_output_cleanup",
                  "base64_blob_elision"
                ],
                "type": "object"
              },
              "requests": {
                "description": "Requests the gateway shrank before sending.",
                "minimum": 0,
                "type": "integer"
              },
              "tokens_saved": {
                "description": "Input tokens removed, all methods.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "requests",
              "tokens_saved",
              "by_method"
            ],
            "type": "object"
          },
          "top_error_codes": {
            "description": "The most frequent error codes of failed requests, most frequent first. `none`: a failed request without a code; `other`: a code that is not a plain identifier.",
            "items": {
              "properties": {
                "code": {
                  "type": "string"
                },
                "requests": {
                  "minimum": 0,
                  "type": "integer"
                }
              },
              "required": [
                "code",
                "requests"
              ],
              "type": "object"
            },
            "maxItems": 20,
            "type": "array"
          }
        },
        "required": [
          "requests",
          "streaming",
          "status_classes",
          "response_cache",
          "token_saving",
          "prompt_cache",
          "failover",
          "top_error_codes"
        ],
        "type": "object"
      },
      "GatewayKey": {
        "additionalProperties": true,
        "properties": {
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "fingerprint": {
            "description": "First 12 hex characters of the key's SHA-256.",
            "type": "string"
          },
          "key_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "secret": {
            "description": "Only on issuance and explicit reveal of an active key.",
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "expired",
              "revoked"
            ],
            "type": "string"
          },
          "usage": {
            "description": "Only on reads (list and get). Null only when usage is temporarily unavailable. Results can be up to 60 seconds old.",
            "properties": {
              "last_used_at": {
                "description": "Most recent request in the last 90 days; null if none.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "requests_30d": {
                "description": "Requests in the last 30 days; 0 when there were none.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "type": [
              "object",
              "null"
            ]
          }
        },
        "required": [
          "key_id",
          "name",
          "status",
          "expires_at",
          "fingerprint"
        ],
        "type": "object"
      },
      "GatewayKeyCreate": {
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "description": "Future RFC 3339 time with a timezone; null never expires.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "GatewayKeyIssued": {
        "additionalProperties": true,
        "properties": {
          "key": {
            "$ref": "#/components/schemas/GatewayKey"
          },
          "operation_id": {
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "type": "object"
      },
      "GatewayKeyList": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/GatewayKey"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "GatewayKeyPatch": {
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "expires_at": {
            "description": "Future RFC 3339 time with a timezone; null never expires.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      },
      "GatewayKeyResponse": {
        "additionalProperties": true,
        "properties": {
          "key": {
            "$ref": "#/components/schemas/GatewayKey"
          },
          "version": {
            "description": "Opaque resource version. Send its quoted value in If-Match.",
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "type": "object"
      },
      "GatewayUser": {
        "properties": {
          "all_apps": {
            "description": "Every app is listed for this person in the console, because of an all-apps assignment or because no app-specific assignment names them.",
            "type": "boolean"
          },
          "apps": {
            "description": "Apps granted to this person specifically: allowed-user lists, self-service access or an active personal key. An app saved without a name is listed as \"Unnamed app\".",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cost_usd_30d": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Logged cost in the last 30 days; null when usage is unavailable."
          },
          "department": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "directory_groups": {
            "description": "Identity-provider groups from your directory.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "email": {
            "description": "Lower-cased identity email.",
            "type": "string"
          },
          "last_active_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Latest gateway request or personal-key use."
          },
          "requests_30d": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Served requests in the last 30 days; 0 without traffic; null when usage is unavailable."
          },
          "self_service_keys": {
            "description": "Active personal keys.",
            "type": "integer"
          },
          "smart_groups": {
            "description": "Enabled smart groups this person belongs to, strongest first (lowest priority number).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "source": {
            "description": "directory: in your synced identity directory. configured: named in gateway configuration (allowed users, smart groups, self-service access or personal keys) but not in the directory. traffic: known only from gateway requests.",
            "enum": [
              "directory",
              "configured",
              "traffic"
            ]
          },
          "sources": {
            "description": "Where the gateway knows this person from: directory (your synced identity directory), app_access_list (an app's allowed users, or a per-person app assignment), smart_group (a member of an enabled smart group), self_service_access (named in an app's self-service access rules), self_service_key (owns a personal key) and traffic (has made gateway requests).",
            "items": {
              "enum": [
                "directory",
                "app_access_list",
                "smart_group",
                "self_service_access",
                "self_service_key",
                "traffic"
              ]
            },
            "type": "array"
          }
        },
        "required": [
          "email",
          "source",
          "sources"
        ],
        "type": "object"
      },
      "GatewayUserAppAccess": {
        "properties": {
          "app": {
            "description": "App name; \"Unnamed app\" for an app saved without a name (no management link is given for it).",
            "type": "string"
          },
          "domain_allowed": {
            "description": "false: the app accepts only other email domains, so requests with this identity are refused.",
            "type": "boolean"
          },
          "granted_by": {
            "items": {
              "properties": {
                "key_ids": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "kind": {
                  "description": "all_apps_assignment: assigned to every app. app_allowed_users: listed in the app's allowed users. default_visibility: no app-specific assignment, so every app is listed for this person. self_service: self-service access to the app (role and via say how). self_service_key: owns an active personal key for the app.",
                  "enum": [
                    "all_apps_assignment",
                    "app_allowed_users",
                    "default_visibility",
                    "self_service",
                    "self_service_key"
                  ]
                },
                "role": {
                  "description": "self_service only: the role that grants access (requesters and direct editors can also view).",
                  "enum": [
                    "self_service_viewer",
                    "settings_update_requester",
                    "settings_update_direct"
                  ]
                },
                "smart_groups": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "via": {
                  "description": "self_service only: listed by email, through smart groups, or open to all users.",
                  "enum": [
                    "email",
                    "smart_group",
                    "all_users"
                  ]
                }
              },
              "required": [
                "kind"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "self_service_denied": {
            "description": "A self-service deny rule names this person.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "GatewayUserDetail": {
        "properties": {
          "active_smart_group": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The strongest group (lowest priority number). Kept for compatibility; per-group budgets use group budget sets."
          },
          "all_apps": {
            "type": "boolean"
          },
          "app_access": {
            "items": {
              "$ref": "#/components/schemas/GatewayUserAppAccess"
            },
            "type": "array"
          },
          "directory": {
            "anyOf": [
              {
                "properties": {
                  "alias": {
                    "description": "This address is an alias of another directory entry.",
                    "type": "boolean"
                  },
                  "department": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "groups": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "type": "string"
          },
          "first_seen_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_active_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "links": {
            "properties": {
              "apps": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "budget_subject": {
                "properties": {
                  "kind": {
                    "const": "user"
                  },
                  "path": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "smart_groups": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "self_service_keys": {
            "items": {
              "$ref": "#/components/schemas/GatewayUserKey"
            },
            "type": "array"
          },
          "smart_groups": {
            "items": {
              "properties": {
                "display_name": {
                  "type": "string"
                },
                "group_name": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "source": {
            "description": "directory: in your synced identity directory. configured: named in gateway configuration (allowed users, smart groups, self-service access or personal keys) but not in the directory. traffic: known only from gateway requests.",
            "enum": [
              "directory",
              "configured",
              "traffic"
            ]
          },
          "sources": {
            "description": "Where the gateway knows this person from: directory (your synced identity directory), app_access_list (an app's allowed users, or a per-person app assignment), smart_group (a member of an enabled smart group), self_service_access (named in an app's self-service access rules), self_service_key (owns a personal key) and traffic (has made gateway requests).",
            "items": {
              "enum": [
                "directory",
                "app_access_list",
                "smart_group",
                "self_service_access",
                "self_service_key",
                "traffic"
              ]
            },
            "type": "array"
          },
          "usage": {
            "anyOf": [
              {
                "properties": {
                  "all_time": {
                    "$ref": "#/components/schemas/GatewayUserUsageTotals",
                    "description": "Every recorded request of this person."
                  },
                  "by_app": {
                    "description": "Per-app totals over the last 30 days (the same window as last_30d), busiest first; app is null for an app that no longer exists.",
                    "items": {
                      "properties": {
                        "app": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cost_usd": {
                          "type": "number"
                        },
                        "last_active_at": {
                          "anyOf": [
                            {
                              "format": "date-time",
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "Latest request to the app in the last 30 days."
                        },
                        "requests": {
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "complete": {
                    "description": "false: this person's history exceeded its read limit (5,000 app, model and window groups), so the totals are partial.",
                    "type": "boolean"
                  },
                  "last_30d": {
                    "$ref": "#/components/schemas/GatewayUserUsageTotals",
                    "description": "The last 30 days, ending now."
                  },
                  "top_models": {
                    "description": "Up to 5 most-used models in the last 30 days.",
                    "items": {
                      "properties": {
                        "cost_usd": {
                          "type": "number"
                        },
                        "model": {
                          "type": "string"
                        },
                        "requests": {
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "window_days": {
                    "description": "Length of the recent window, in days (30): last_30d, top_models and by_app cover it.",
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null when request history is unavailable."
          }
        },
        "required": [
          "email",
          "source",
          "sources"
        ],
        "type": "object"
      },
      "GatewayUserKey": {
        "description": "Personal key metadata; the key value is never returned.",
        "properties": {
          "app": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "key_id": {
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          }
        },
        "type": "object"
      },
      "GatewayUserList": {
        "properties": {
          "generated_at": {
            "description": "When the oldest of the data behind this response (configuration and request history) was read (UTC).",
            "format": "date-time",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/GatewayUser"
            },
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "total": {
            "description": "People matching the filters.",
            "type": "integer"
          },
          "truncated": {
            "description": "true: the identity directory or the personal keys exceeded their read limit, so some people or keys may be missing.",
            "type": "boolean"
          },
          "usage": {
            "properties": {
              "available": {
                "description": "false: request history was unavailable, so requests_30d and cost_usd_30d are null.",
                "type": "boolean"
              },
              "complete": {
                "description": "false: the request history exceeded its read limit (200,000 person and app pairs), so usage, last activity and traffic-only people are partial. Also false when usage is unavailable.",
                "type": "boolean"
              },
              "window_days": {
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "GatewayUserResponse": {
        "properties": {
          "generated_at": {
            "description": "When the oldest of the data behind this response (configuration and request history) was read (UTC).",
            "format": "date-time",
            "type": "string"
          },
          "truncated": {
            "description": "true: the identity directory or the personal keys exceeded their read limit, so this person's directory entry or keys may be missing.",
            "type": "boolean"
          },
          "user": {
            "$ref": "#/components/schemas/GatewayUserDetail"
          }
        },
        "required": [
          "user"
        ],
        "type": "object"
      },
      "GatewayUserUsageTotals": {
        "properties": {
          "cost_usd": {
            "description": "Logged cost of priced requests, in US dollars (the background cache-refresh requests the provider bills included).",
            "type": "number"
          },
          "input_tokens": {
            "type": "integer"
          },
          "output_tokens": {
            "type": "integer"
          },
          "requests": {
            "description": "Served requests (rejected requests and background cache-refresh requests excluded).",
            "type": "integer"
          },
          "unpriced_requests": {
            "description": "Served requests with no price, not in cost_usd.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "GroupPolicy": {
        "additionalProperties": false,
        "description": "Detection overrides for members of one smart group.",
        "properties": {
          "actions": {
            "additionalProperties": true,
            "properties": {
              "data_risk_action": {
                "description": "Adversarial detections have no redactable spans; actions they cannot apply are rejected.",
                "enum": [
                  "monitor",
                  "partial-redact",
                  "tokenize",
                  "redact",
                  "block"
                ],
                "type": "string"
              },
              "hallucination_check_action": {
                "enum": [
                  "block",
                  "monitor"
                ],
                "type": "string"
              }
            },
            "type": "object"
          },
          "category_actions": {
            "additionalProperties": {
              "description": "Adversarial detections have no redactable spans; actions they cannot apply are rejected.",
              "enum": [
                "monitor",
                "partial-redact",
                "tokenize",
                "redact",
                "block"
              ],
              "type": "string"
            },
            "type": "object"
          },
          "category_scopes": {
            "additionalProperties": {
              "enum": [
                "request",
                "response",
                "both"
              ],
              "type": "string"
            },
            "type": "object"
          },
          "category_sensitivities": {
            "additionalProperties": {
              "items": {
                "enum": [
                  "low",
                  "medium",
                  "high"
                ],
                "type": "string"
              },
              "type": "array"
            },
            "type": "object"
          },
          "enabled": {
            "type": "boolean"
          },
          "enabled_categories": {
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "Catalog category or subcategory IDs to enabled state.",
            "type": "object"
          },
          "group_name": {
            "type": "string"
          },
          "sub_category_actions": {
            "additionalProperties": {
              "additionalProperties": {
                "description": "Adversarial detections have no redactable spans; actions they cannot apply are rejected.",
                "enum": [
                  "monitor",
                  "partial-redact",
                  "tokenize",
                  "redact",
                  "block"
                ],
                "type": "string"
              },
              "type": "object"
            },
            "type": "object"
          },
          "sub_category_sensitivities": {
            "additionalProperties": {
              "additionalProperties": {
                "enum": [
                  "low",
                  "medium",
                  "high"
                ],
                "type": "string"
              },
              "type": "object"
            },
            "type": "object"
          }
        },
        "required": [
          "group_name"
        ],
        "type": "object"
      },
      "Guardian": {
        "additionalProperties": true,
        "description": "Partial update of Guardian branches; set a branch's enabled to false to turn it off. Model-backed checks follow what the deployment supports.",
        "properties": {
          "coding_helpers": {
            "additionalProperties": true,
            "properties": {
              "dependency_security_check": {
                "type": "boolean"
              },
              "enabled": {
                "type": "boolean"
              },
              "latest_version_suggestions": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "enabled": {
            "type": "boolean"
          },
          "task_adherence": {
            "additionalProperties": true,
            "properties": {
              "action": {
                "enum": [
                  "nudge",
                  "block"
                ],
                "type": "string"
              },
              "agent_purpose": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean"
              },
              "guardian_agent_prompt": {
                "type": "string"
              },
              "sensitivity": {
                "enum": [
                  "low",
                  "medium",
                  "high"
                ],
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "GuardrailActivityRow": {
        "description": "One aggregate. Holds `period_start` when granularity is not total and one key per group_by dimension.",
        "properties": {
          "action": {
            "enum": [
              "blocked",
              "redacted",
              "monitored"
            ]
          },
          "app": {
            "description": "App name.",
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "$ref": "#/components/schemas/GuardrailCategory"
          },
          "detections": {
            "description": "Matching detections: each distinct category, action and direction on a request counts once.",
            "minimum": 0,
            "type": "integer"
          },
          "direction": {
            "description": "request: the prompt sent to the model; response: the model's answer; unknown: an action recorded without a direction.",
            "enum": [
              "request",
              "response",
              "unknown"
            ]
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "period_start": {
            "description": "Start of the period, UTC: a date (YYYY-MM-DD; weeks start Monday) for day, week and month, or an RFC 3339 timestamp (YYYY-MM-DDTHH:00:00Z) for hour; absent when granularity is total.",
            "type": "string"
          },
          "requests_blocked": {
            "description": "Requests with a matching detection that was blocked.",
            "minimum": 0,
            "type": "integer"
          },
          "requests_flagged": {
            "description": "Requests with at least one matching detection that the guardrails acted on (blocked, redacted or monitored). On rows grouped by category, action or direction a request counts once in each row it matches, so those rows do not add up to totals; query without those dimensions for flagged requests per period.",
            "minimum": 0,
            "type": "integer"
          },
          "requests_monitored": {
            "description": "Requests with a matching detection that was allowed and recorded (monitor mode, advisory notes).",
            "minimum": 0,
            "type": "integer"
          },
          "requests_redacted": {
            "description": "Requests with a matching detection that was redacted (masked or partially masked) before it was sent on.",
            "minimum": 0,
            "type": "integer"
          },
          "requests_scanned": {
            "description": "Requests the guardrails checked. Counts every scanned request in the app, user, model and time scope; category, action and direction filters do not narrow it. Null on rows grouped by category, action or direction: those rows count detections, and a scanned request without a detection has no category, action or direction to be grouped under. Read totals.requests_scanned instead.",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "user": {
            "description": "User email; null when the request carried no user identity or its identity was removed by data retention.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "requests_scanned",
          "requests_flagged",
          "requests_blocked",
          "requests_redacted",
          "requests_monitored",
          "detections"
        ],
        "type": "object"
      },
      "GuardrailActivitySummary": {
        "properties": {
          "data_through": {
            "description": "Effective exclusive end of the data counted: the requested `to`, or the time of the read when `to` is omitted. Requests are written a few seconds to minutes after they finish, so the most recent ones can be missing.",
            "format": "date-time",
            "type": "string"
          },
          "filters": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The filters applied, as normalized.",
            "type": "object"
          },
          "from": {
            "description": "Inclusive start; null for all available history.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "generated_at": {
            "description": "When the data behind this response was read from storage (UTC). Results are cached, so this can be up to 60 seconds before the response.",
            "format": "date-time",
            "type": "string"
          },
          "granularity": {
            "enum": [
              "total",
              "month",
              "week",
              "day",
              "hour"
            ]
          },
          "group_by": {
            "items": {
              "enum": [
                "category",
                "action",
                "direction",
                "app",
                "user",
                "model"
              ]
            },
            "maxItems": 2,
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/GuardrailActivityRow"
            },
            "type": "array"
          },
          "timezone": {
            "const": "UTC"
          },
          "to": {
            "description": "Exclusive end; null for now.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "totals": {
            "$ref": "#/components/schemas/GuardrailActivityTotals"
          },
          "truncated": {
            "description": "More than 5000 rows matched; only the first 5000 (in row order) are returned. Narrow the query.",
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "to",
          "granularity",
          "timezone",
          "group_by",
          "totals",
          "rows",
          "next_cursor",
          "truncated",
          "generated_at",
          "data_through"
        ],
        "type": "object"
      },
      "GuardrailActivityTotals": {
        "properties": {
          "detections": {
            "description": "Matching detections: each distinct category, action and direction on a request counts once.",
            "minimum": 0,
            "type": "integer"
          },
          "requests_blocked": {
            "description": "Requests with a matching detection that was blocked.",
            "minimum": 0,
            "type": "integer"
          },
          "requests_flagged": {
            "description": "Requests with at least one matching detection that the guardrails acted on (blocked, redacted or monitored). On rows grouped by category, action or direction a request counts once in each row it matches, so those rows do not add up to totals; query without those dimensions for flagged requests per period.",
            "minimum": 0,
            "type": "integer"
          },
          "requests_monitored": {
            "description": "Requests with a matching detection that was allowed and recorded (monitor mode, advisory notes).",
            "minimum": 0,
            "type": "integer"
          },
          "requests_redacted": {
            "description": "Requests with a matching detection that was redacted (masked or partially masked) before it was sent on.",
            "minimum": 0,
            "type": "integer"
          },
          "requests_scanned": {
            "description": "Requests the guardrails checked in the app, user, model and time scope.",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "requests_scanned",
          "requests_flagged",
          "requests_blocked",
          "requests_redacted",
          "requests_monitored",
          "detections"
        ],
        "type": "object"
      },
      "GuardrailCategory": {
        "properties": {
          "id": {
            "description": "Category id as used in app settings and policies; a custom definition's id; a redaction type (for example EMAIL); `unattributed` for an action recorded without a category.",
            "type": "string"
          },
          "name": {
            "description": "Display name shown in the console: the category name, a custom definition's name, or for a redaction type its data-risk subcategory name (for example Email Address).",
            "type": "string"
          },
          "type": {
            "enum": [
              "data_risk",
              "adversarial",
              "custom",
              "insider_risk",
              "hallucination",
              "guardian",
              "policy",
              "other"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "type"
        ],
        "type": "object"
      },
      "HookFieldCatalog": {
        "properties": {
          "fields": {
            "items": {
              "properties": {
                "description": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "path_safe": {
                  "type": "boolean"
                },
                "presets": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "sensitive": {
                  "type": "boolean"
                },
                "single_value": {
                  "type": "boolean"
                },
                "stages": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "presets": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "HookPreview": {
        "properties": {
          "api_family": {
            "type": "string"
          },
          "call": {
            "properties": {
              "body": {},
              "body_bytes": {
                "type": "integer"
              },
              "headers": {
                "type": "object"
              },
              "method": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "stage": {
            "type": "string"
          },
          "warnings": {
            "items": {
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "HookPreviewRequest": {
        "properties": {
          "api_family": {
            "type": "string"
          },
          "hook": {
            "$ref": "#/components/schemas/ControlsHooks"
          },
          "sample_body": {
            "description": "Client body to use instead of the family's sample."
          },
          "sample_response_body": {
            "description": "Response body to use instead of the family's sample (post_call / on_complete with send.response_body)."
          }
        },
        "required": [
          "hook"
        ],
        "type": "object"
      },
      "HookStats": {
        "properties": {
          "breaker_open": {
            "description": "Across this server's processes; null when the breaker state cannot be read.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "export": {
            "type": [
              "object",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "HookTestRequest": {
        "properties": {
          "api_family": {
            "type": "string"
          },
          "sample_body": {},
          "sample_response_body": {}
        },
        "type": "object"
      },
      "HookTestResult": {
        "properties": {
          "api_family": {
            "type": "string"
          },
          "decision": {
            "type": [
              "string",
              "null"
            ]
          },
          "effective": {
            "description": "What live traffic would get: on_failure applies on a failed call, and observe mode always continues (applied allow). Absent for on_complete.",
            "properties": {
              "applied": {
                "enum": [
                  "allow",
                  "flag",
                  "block"
                ]
              },
              "status": {
                "enum": [
                  "ok",
                  "failed_open",
                  "failed_closed"
                ]
              }
            },
            "type": "object"
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "labels": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "latency_ms": {
            "type": "number"
          },
          "metadata": {},
          "mode": {
            "enum": [
              "enforce",
              "observe"
            ],
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "type": "string"
          },
          "user_message": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "IncidentAction": {
        "additionalProperties": false,
        "properties": {
          "apps": {
            "description": "Every app now and later (\"*\"), or these apps (names, case-insensitive).",
            "oneOf": [
              {
                "const": "*"
              },
              {
                "items": {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              }
            ]
          },
          "model": {
            "description": "With provider_label: only this model of it.",
            "maxLength": 200,
            "type": [
              "string",
              "null"
            ]
          },
          "provider_label": {
            "description": "Narrows the action to targets with this provider label in the selected apps; omitted: every target of the selected apps.",
            "maxLength": 200,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "apps"
        ],
        "type": "object"
      },
      "IncidentActionResult": {
        "properties": {
          "action": {
            "enum": [
              "reset_cooldowns",
              "drop_pins"
            ]
          },
          "applies_to": {
            "type": "string"
          },
          "apps": {
            "description": "Every app now and later (\"*\"), or these apps (names, case-insensitive).",
            "oneOf": [
              {
                "const": "*"
              },
              {
                "items": {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              }
            ]
          },
          "changed": {
            "type": "boolean"
          },
          "generations": {
            "$ref": "#/components/schemas/IncidentGenerations"
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "operation_id": {
            "type": "string"
          },
          "propagation": {
            "$ref": "#/components/schemas/IncidentPropagation"
          },
          "provider_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "record_version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "IncidentGenerations": {
        "properties": {
          "app_health_generations": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "app_pin_generations": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "health_generation": {
            "type": "integer"
          },
          "pin_generation": {
            "type": "integer"
          },
          "target_health_generations": {
            "items": {
              "properties": {
                "app": {
                  "type": "string"
                },
                "generation": {
                  "type": "integer"
                },
                "model": {
                  "type": "string"
                },
                "provider_label": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "target_pin_generations": {
            "items": {
              "properties": {
                "app": {
                  "type": "string"
                },
                "generation": {
                  "type": "integer"
                },
                "model": {
                  "type": "string"
                },
                "provider_label": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "IncidentMarkDown": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "actor": {
            "type": [
              "string",
              "null"
            ]
          },
          "apps": {
            "description": "Every app now and later (\"*\"), or these apps (names, case-insensitive).",
            "oneOf": [
              {
                "const": "*"
              },
              {
                "items": {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              }
            ]
          },
          "expires_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "expires_in": {
            "description": "Seconds until it expires.",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider_label": {
            "type": "string"
          },
          "read_only": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          },
          "set_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "description": "tenant: set through this API; app: a console per-app mark-down (failover_overrides.down), listed read-only.",
            "enum": [
              "tenant",
              "app"
            ]
          },
          "ticket": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "description": "ETag value (quoted in the ETag header).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "IncidentMarkDownDeleted": {
        "properties": {
          "deleted": {
            "const": true
          },
          "id": {
            "type": "string"
          },
          "mark_down": {
            "$ref": "#/components/schemas/IncidentMarkDown"
          },
          "propagation": {
            "$ref": "#/components/schemas/IncidentPropagation"
          }
        },
        "type": "object"
      },
      "IncidentMarkDownList": {
        "properties": {
          "generations": {
            "$ref": "#/components/schemas/IncidentGenerations"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/IncidentMarkDown"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "record_version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "IncidentMarkDownPreview": {
        "properties": {
          "apps_affected": {
            "items": {
              "properties": {
                "app": {
                  "type": "string"
                },
                "matching_routes": {
                  "type": "integer"
                },
                "policy_authority": {
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "fallback_destinations": {
            "items": {
              "properties": {
                "app": {
                  "type": "string"
                },
                "fallback": {
                  "type": "object"
                },
                "kind": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "primary": {
                  "type": "object"
                },
                "reason": {
                  "type": "string"
                },
                "route_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "surface": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "health_scope": {
            "type": "string"
          },
          "mark_down": {
            "type": "object"
          },
          "not_computed": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "routes_losing_all_candidates": {
            "items": {
              "properties": {
                "app": {
                  "type": "string"
                },
                "fallback": {
                  "type": "object"
                },
                "kind": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "primary": {
                  "type": "object"
                },
                "reason": {
                  "type": "string"
                },
                "route_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "surface": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "IncidentMarkDownPreviewRequest": {
        "additionalProperties": false,
        "properties": {
          "apps": {
            "description": "Every app now and later (\"*\"), or these apps (names, case-insensitive).",
            "oneOf": [
              {
                "const": "*"
              },
              {
                "items": {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              }
            ]
          },
          "expires_at": {
            "description": "RFC 3339 time with a timezone, or epoch seconds; in the future and at most 72 hours ahead. Required unless expires_in_seconds is sent.",
            "oneOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "expires_in_seconds": {
            "description": "Alternative to expires_at (not both): seconds from now, at most 72 hours.",
            "exclusiveMinimum": 0,
            "maximum": 259200,
            "type": "number"
          },
          "model": {
            "description": "Only this model of the provider; null marks every model.",
            "maxLength": 200,
            "type": [
              "string",
              "null"
            ]
          },
          "provider_label": {
            "description": "A tenant provider label or a provider label of an app.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "reason": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "ticket": {
            "maxLength": 200,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "provider_label",
          "apps",
          "reason"
        ],
        "type": "object"
      },
      "IncidentMarkDownPut": {
        "additionalProperties": false,
        "properties": {
          "apps": {
            "description": "Every app now and later (\"*\"), or these apps (names, case-insensitive).",
            "oneOf": [
              {
                "const": "*"
              },
              {
                "items": {
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 64,
                "minItems": 1,
                "type": "array"
              }
            ]
          },
          "expires_at": {
            "description": "RFC 3339 time with a timezone, or epoch seconds; in the future and at most 72 hours ahead. Required unless expires_in_seconds is sent.",
            "oneOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "expires_in_seconds": {
            "description": "Alternative to expires_at (not both): seconds from now, at most 72 hours.",
            "exclusiveMinimum": 0,
            "maximum": 259200,
            "type": "number"
          },
          "model": {
            "description": "Only this model of the provider; null marks every model.",
            "maxLength": 200,
            "type": [
              "string",
              "null"
            ]
          },
          "provider_label": {
            "description": "A tenant provider label or a provider label of an app.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "reason": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "ticket": {
            "maxLength": 200,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "provider_label",
          "apps",
          "reason"
        ],
        "type": "object"
      },
      "IncidentMarkDownResponse": {
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "etag": {
            "type": "string"
          },
          "mark_down": {
            "$ref": "#/components/schemas/IncidentMarkDown"
          },
          "previous_version": {
            "type": "string"
          },
          "propagation": {
            "$ref": "#/components/schemas/IncidentPropagation"
          },
          "replayed": {
            "description": "A retry with the Idempotency-Key of the PUT that set this mark-down.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "IncidentPropagation": {
        "properties": {
          "applied_on_this_server": {
            "type": "boolean"
          },
          "nodes": {
            "type": "string"
          },
          "poll_seconds": {
            "type": "integer"
          },
          "record_version": {
            "type": "integer"
          },
          "session_pins": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "written": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "IncidentStatus": {
        "properties": {
          "current_record_version": {
            "type": "integer"
          },
          "fleet": {
            "properties": {
              "applied_everywhere_by": {
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "bound_seconds": {
                "type": "integer"
              },
              "confirmed": {
                "const": false
              },
              "note": {
                "type": "string"
              },
              "scope": {
                "const": "this_server"
              }
            },
            "type": "object"
          },
          "record_version": {
            "type": "integer"
          },
          "this_server": {
            "properties": {
              "applied": {
                "type": "boolean"
              },
              "host": {
                "type": "string"
              },
              "pid": {
                "type": "integer"
              },
              "process_record_version": {
                "type": "integer"
              },
              "stored_record_version": {
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "JwtAuth": {
        "additionalProperties": false,
        "description": "null, {} or enabled false turns JWT authentication off. Enabling requires non-empty issuer and client ID lists and an RSA public_key_pem. Audience and claim settings keep their stored values when omitted.",
        "properties": {
          "allowed_audiences": {
            "description": "Omitted or null keeps the stored list.",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "allowed_client_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "allowed_issuers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "email_claim": {
            "description": "Claim read first for the user's email.",
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "kid": {
            "default": "default",
            "type": "string"
          },
          "public_key_pem": {
            "description": "RSA public key (PEM). Required when enabling; this API does not fetch JWKS URLs.",
            "type": "string"
          },
          "subject_fallback": {
            "description": "Use the token subject as identity when it has no email.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "verify_audience": {
            "description": "Requires a non-empty allowed_audiences. Omitted keeps the stored value (default false).",
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "LatencyDistribution": {
        "properties": {
          "avg_ms": {
            "description": "Mean; null when count is 0.",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "count": {
            "description": "Requests with a recorded value for this measure.",
            "minimum": 0,
            "type": "integer"
          },
          "histogram": {
            "description": "Exact request counts per bucket of histogram_buckets_ms, in the same order; they add up to count.",
            "items": {
              "minimum": 0,
              "type": "integer"
            },
            "maxItems": 12,
            "minItems": 12,
            "type": "array"
          },
          "max_ms": {
            "description": "Slowest value.",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "p50_ms": {
            "description": "Median (estimated); null when count is 0.",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "p90_ms": {
            "description": "90th percentile (estimated).",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "p95_ms": {
            "description": "95th percentile (estimated).",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "p99_ms": {
            "description": "99th percentile (estimated).",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "count",
          "avg_ms",
          "p50_ms",
          "p90_ms",
          "p95_ms",
          "p99_ms",
          "max_ms",
          "histogram"
        ],
        "type": "object"
      },
      "LatencyMeasures": {
        "properties": {
          "gateway_overhead": {
            "$ref": "#/components/schemas/LatencyDistribution",
            "description": "Time the gateway itself added: request handling and guardrail checks."
          },
          "guardrails": {
            "$ref": "#/components/schemas/LatencyDistribution",
            "description": "Time spent in guardrail checks alone (part of gateway_overhead)."
          },
          "time_to_first_token": {
            "$ref": "#/components/schemas/LatencyDistribution",
            "description": "Streaming requests only: time until the first response chunk reached the client. Always counts successful streams, whatever the outcome filter."
          },
          "total": {
            "$ref": "#/components/schemas/LatencyDistribution",
            "description": "End-to-end time: from the gateway receiving the request to the response finishing (the whole stream for streaming requests)."
          },
          "upstream": {
            "$ref": "#/components/schemas/LatencyDistribution",
            "description": "Time spent waiting on the model provider."
          }
        },
        "required": [
          "total",
          "upstream",
          "gateway_overhead",
          "guardrails",
          "time_to_first_token"
        ],
        "type": "object"
      },
      "LatencyRow": {
        "description": "One aggregate. Holds `period_start` when granularity is not total and one key per group_by dimension.",
        "properties": {
          "app": {
            "description": "App name.",
            "type": [
              "string",
              "null"
            ]
          },
          "latency": {
            "$ref": "#/components/schemas/LatencyMeasures"
          },
          "model": {
            "description": "Served model.",
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "enum": [
              "success",
              "error",
              "blocked"
            ]
          },
          "period_start": {
            "description": "Start of the period, UTC: a date (YYYY-MM-DD; weeks start Monday) for day, week and month, or an RFC 3339 timestamp (YYYY-MM-DDTHH:00:00Z) for hour; absent when granularity is total.",
            "type": "string"
          },
          "provider": {
            "description": "Provider name as configured (or the provider type when no name was recorded).",
            "type": [
              "string",
              "null"
            ]
          },
          "requests": {
            "description": "Requests in this row.",
            "minimum": 0,
            "type": "integer"
          },
          "stream": {
            "type": "boolean"
          },
          "surface": {
            "description": "API surface (for example chat, responses, messages, embeddings).",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "requests",
          "latency"
        ],
        "type": "object"
      },
      "LatencySummary": {
        "properties": {
          "data_through": {
            "description": "Effective exclusive end of the data counted: the requested `to`, or the time of the read when `to` is omitted. Requests are written a few seconds to minutes after they finish, so the most recent ones can be missing.",
            "format": "date-time",
            "type": "string"
          },
          "filters": {
            "description": "The filters applied, as normalized (outcome is always present).",
            "type": "object"
          },
          "from": {
            "description": "Inclusive start.",
            "format": "date-time",
            "type": "string"
          },
          "generated_at": {
            "description": "When the data behind this response was read from storage (UTC). Results are cached, so this can be up to 60 seconds before the response.",
            "format": "date-time",
            "type": "string"
          },
          "granularity": {
            "enum": [
              "total",
              "month",
              "week",
              "day",
              "hour"
            ]
          },
          "group_by": {
            "items": {
              "enum": [
                "app",
                "model",
                "provider",
                "surface",
                "stream",
                "outcome"
              ]
            },
            "maxItems": 2,
            "type": "array"
          },
          "histogram_buckets_ms": {
            "description": "Histogram buckets shared by every distribution: `from` inclusive, `to` exclusive (null: no upper bound), in milliseconds.",
            "items": {
              "properties": {
                "from": {
                  "minimum": 0,
                  "type": "integer"
                },
                "to": {
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              },
              "required": [
                "from",
                "to"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/LatencyRow"
            },
            "type": "array"
          },
          "timezone": {
            "const": "UTC"
          },
          "to": {
            "description": "Exclusive end; null for now.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "totals": {
            "properties": {
              "latency": {
                "$ref": "#/components/schemas/LatencyMeasures"
              },
              "requests": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "requests",
              "latency"
            ],
            "type": "object"
          },
          "truncated": {
            "description": "More than 5000 rows matched; only the first 5000 (in row order) are returned. Narrow the query.",
            "type": "boolean"
          }
        },
        "required": [
          "from",
          "to",
          "granularity",
          "timezone",
          "group_by",
          "histogram_buckets_ms",
          "totals",
          "rows",
          "next_cursor",
          "truncated",
          "generated_at",
          "data_through"
        ],
        "type": "object"
      },
      "LimitsEffective": {
        "description": "Every quota, request guard and model limit that applies to the request, the binding one, exemptions and grants. Query: app, user (email), user_id, model, provider, provider_label, include_usage.",
        "properties": {
          "accounting_error": {
            "type": [
              "object",
              "null"
            ]
          },
          "app_found": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "deprecated_windows": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "exempt": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "grants": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "id_required": {
            "description": "Quotas with missing_id refuse that need a conversation / agent id this preview does not have: {quota_id, field}.",
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "limit_response": {
            "type": [
              "object",
              "string",
              "null"
            ]
          },
          "model_limits": {
            "type": [
              "object",
              "null"
            ]
          },
          "not_covered": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "quotas": {
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "request_guards": {
            "type": "object"
          },
          "revision": {
            "type": "integer"
          },
          "subject": {
            "type": "object"
          },
          "tightest": {
            "type": [
              "object",
              "null"
            ]
          },
          "tightest_tokens_per_request": {
            "type": [
              "integer",
              "null"
            ]
          },
          "unknown_facts": {
            "description": "Fields the active policy reads that this read could not supply (e.g. user.id without user_id); they evaluate as null.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "LimitsErrorCodes": {
        "description": "budget_exemption_not_supported (422): Limit exemptions cover rate quotas only; budget exemptions use the budgets API.; deprecated_field (422): model_limits window keys (rate, input_tokens, output_tokens, concurrency) are deprecated; use a rate limit grouped by model.; duplicate_subject (422): A bulk request names one subject twice.; exemption_expired (422): expires_at is not in the future.; grant_above_ceiling (422): The granted limit exceeds adjustments.ceiling.; grant_not_active (409): The grant is already expired or revoked.; grant_not_found (404): The grant does not exist on this rate limit (a budget's or another rate limit's grant is never reachable here).; grant_too_long (422): The grant outlasts adjustments.max_duration.; identity_field_immutable (422): metric, group_by and window identify a rate limit's counter and are ForceNew: they never change in place (a Terraform-style replace must use a new id). details: fields, recorded_identity, requested_identity.; invalid_cursor (400): The list cursor is not valid.; invalid_grant (422): The grant body is malformed (exactly one of extra/limit; expires_at required).; invalid_quota_adjustments (422): adjustments is malformed or below limit.; invalid_request (400): The request is malformed.; invalid_resource_id (400): The id must start with a letter or digit, use letters, digits, '.', '_', ':' or '-', and be at most 120 characters.; invalid_subject (422): The grant subject or bucket is malformed.; kind_not_supported (422): Spend metrics, lifetime windows and kind budget belong to the budgets API.; limit_response_conflict (422): Two different limit responses (or one and a console policy rule at the same priority as managed controls) could apply to the same request: their scope.apps lists are not provably disjoint. details: id, conflicts.; override_target_not_allowed (422): overrides names a quota that is not a rate quota of this API or the console (a budget, itself, or an unknown id); details.targets [{id, quota_id, reason: budget|self|unknown}].; policy_not_enabled (409): Limits apply only while the LLM Gateway policy engine is enabled.; precondition_required (428): Revoking a grant needs If-Match.; quilrql_invalid (422): The control does not render to a valid policy rule; details.diagnostics.; quota_id_conflict (422): A console policy already defines quota id rl_<id>; details.quota_ids.; quota_id_reused (422): The quota id rl_<id> was published before with another metric/group_by/window (identities are recorded forever); use a new id. details: quota_id, recorded_identity, requested_identity.; rate_limit_not_adjustable (409): The rate limit has no adjustments, so it takes no grants.; rate_limit_not_found (404): No managed rate limit has this id.; subject_not_in_budget (422): The bucket does not match this rate limit's group_by; details.per.; subject_unresolved (422): The subject does not name this rate limit's bucket.; unsupported_fields (422): The resource has fields the domain does not take; details.fields lists them.; validation_failed (422): A field is missing or out of range; details.field names it.; version_conflict (412): If-Match does not match the grant's version.",
        "enum": [
          "budget_exemption_not_supported",
          "deprecated_field",
          "duplicate_subject",
          "exemption_expired",
          "grant_above_ceiling",
          "grant_not_active",
          "grant_not_found",
          "grant_too_long",
          "identity_field_immutable",
          "invalid_cursor",
          "invalid_grant",
          "invalid_quota_adjustments",
          "invalid_request",
          "invalid_resource_id",
          "invalid_subject",
          "kind_not_supported",
          "limit_response_conflict",
          "override_target_not_allowed",
          "policy_not_enabled",
          "precondition_required",
          "quilrql_invalid",
          "quota_id_conflict",
          "quota_id_reused",
          "rate_limit_not_adjustable",
          "rate_limit_not_found",
          "subject_not_in_budget",
          "subject_unresolved",
          "unsupported_fields",
          "validation_failed",
          "version_conflict"
        ],
        "type": "string"
      },
      "LimitsMigrateLegacy": {
        "additionalProperties": false,
        "properties": {
          "dry_run": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "LimitsMigrateLegacyResult": {
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "diagnostics": {
            "type": "array"
          },
          "diff": {
            "type": "string"
          },
          "dropped": {
            "type": "array"
          },
          "dry_run": {
            "type": "boolean"
          },
          "propagation": {
            "type": "object"
          },
          "quotas": {
            "type": "array"
          },
          "replayed": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer"
          },
          "warnings": {
            "type": "array"
          },
          "would_publish": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ManagementKey": {
        "additionalProperties": true,
        "properties": {
          "created_at": {
            "description": "Unix epoch seconds, potentially fractional.",
            "type": "number"
          },
          "created_by": {
            "type": "string"
          },
          "expires_at": {
            "description": "Unix epoch seconds, potentially fractional.",
            "type": [
              "number",
              "null"
            ]
          },
          "key_id": {
            "type": "string"
          },
          "last_used_at": {
            "description": "Unix epoch seconds, potentially fractional.",
            "type": [
              "number",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "revoked_at": {
            "description": "Unix epoch seconds, potentially fractional.",
            "type": [
              "number",
              "null"
            ]
          },
          "scopes": {
            "items": {
              "enum": [
                "budgets:grant",
                "budgets:policy",
                "budgets:read",
                "config:write",
                "credentials:read",
                "credentials:write",
                "hooks:write",
                "incidents:read",
                "incidents:write",
                "keys:write",
                "limits:grant",
                "limits:read",
                "limits:write",
                "providers:write",
                "read",
                "routing:constraints",
                "routing:read",
                "routing:write"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "secret": {
            "description": "Issuance response (and its idempotent replay) only.",
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "expired",
              "revoked"
            ],
            "type": "string"
          },
          "tenant": {
            "type": "string"
          },
          "version": {
            "description": "Opaque resource version. Send its quoted value in If-Match.",
            "type": "string"
          }
        },
        "required": [
          "key_id",
          "tenant",
          "name",
          "scopes",
          "status",
          "version"
        ],
        "type": "object"
      },
      "ManagementKeyCreate": {
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "description": "Future RFC 3339 time with a timezone; null never expires.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "scopes": {
            "items": {
              "enum": [
                "budgets:grant",
                "budgets:policy",
                "budgets:read",
                "config:write",
                "credentials:read",
                "credentials:write",
                "hooks:write",
                "incidents:read",
                "incidents:write",
                "keys:write",
                "limits:grant",
                "limits:read",
                "limits:write",
                "providers:write",
                "read",
                "routing:constraints",
                "routing:read",
                "routing:write"
              ]
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "name",
          "scopes"
        ],
        "type": "object"
      },
      "ManagementKeyIssued": {
        "additionalProperties": true,
        "properties": {
          "key": {
            "$ref": "#/components/schemas/ManagementKey"
          },
          "operation_id": {
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "type": "object"
      },
      "ManagementKeyList": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ManagementKey"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "ManagementKeyPatch": {
        "additionalProperties": false,
        "properties": {
          "expires_at": {
            "description": "Future RFC 3339 time with a timezone; null never expires.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "scopes": {
            "items": {
              "enum": [
                "budgets:grant",
                "budgets:policy",
                "budgets:read",
                "config:write",
                "credentials:read",
                "credentials:write",
                "hooks:write",
                "incidents:read",
                "incidents:write",
                "keys:write",
                "limits:grant",
                "limits:read",
                "limits:write",
                "providers:write",
                "read",
                "routing:constraints",
                "routing:read",
                "routing:write"
              ]
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "type": "object"
      },
      "ManagementKeyResponse": {
        "additionalProperties": true,
        "properties": {
          "key": {
            "$ref": "#/components/schemas/ManagementKey"
          }
        },
        "required": [
          "key"
        ],
        "type": "object"
      },
      "ModelCost": {
        "additionalProperties": false,
        "properties": {
          "audio_input_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "audio_input_per_second": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "audio_input_per_second_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "audio_output_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "audio_output_per_second": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "audio_output_per_second_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "batch_multiplier": {
            "exclusiveMinimum": 0,
            "maximum": 1,
            "type": [
              "number",
              "null"
            ]
          },
          "cache_per_1m": {
            "deprecated": true,
            "description": "Deprecated alias of cache_read_per_1m. Requests may send it (must equal cache_read_per_1m when both are sent); responses echo it equal to cache_read_per_1m whenever that is set, and it is never stored.",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "cache_read_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "cache_write_1h_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "cache_write_5m_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "cache_write_default_ttl": {
            "enum": [
              "5m",
              "1h",
              "unpriced",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "cache_write_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "code_execution_per_hour": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "container_per_session": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "document_image_input_per_image": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "document_image_input_per_image_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "file_search_per_1k": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "grounding_per_1k": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "image_input_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "image_input_per_image": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "image_input_per_image_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "image_output_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "image_output_per_image": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "image_output_per_image_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "input_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "input_per_1m_characters": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "input_per_1m_characters_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "output_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "pages_per_1k": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "pages_per_1k_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "reasoning_per_1m": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "regional_multipliers": {
            "additionalProperties": false,
            "properties": {
              "data_residency": {
                "exclusiveMinimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "geo": {
                "exclusiveMinimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "regional": {
                "exclusiveMinimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "us_only": {
                "exclusiveMinimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "requests_per_1k": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "requests_per_1k_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "search_units_per_1k": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "search_units_per_1k_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "service_tier_multipliers": {
            "additionalProperties": false,
            "properties": {
              "fast": {
                "exclusiveMinimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "flex": {
                "exclusiveMinimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "priority": {
                "exclusiveMinimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "text_input_per_request": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "text_input_per_request_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "tiers": {
            "items": {
              "additionalProperties": false,
              "minProperties": 2,
              "properties": {
                "above_input_tokens": {
                  "maximum": 9007199254740991,
                  "minimum": 0,
                  "type": "integer"
                },
                "audio_input_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "audio_output_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "cache_per_1m": {
                  "deprecated": true,
                  "description": "Deprecated alias of cache_read_per_1m. Requests may send it (must equal cache_read_per_1m when both are sent); responses echo it equal to cache_read_per_1m whenever that is set, and it is never stored.",
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "cache_read_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "cache_write_1h_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "cache_write_5m_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "cache_write_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "image_input_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "image_output_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "input_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "output_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "reasoning_per_1m": {
                  "minimum": 0,
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "required": [
                "above_input_tokens"
              ],
              "type": "object"
            },
            "maxItems": 8,
            "type": [
              "array",
              "null"
            ]
          },
          "video_input_per_second": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "video_input_per_second_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "video_output_per_second": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "video_output_per_second_by": {
            "additionalProperties": {
              "minimum": 0,
              "type": "number"
            },
            "maxProperties": 64,
            "propertyNames": {
              "pattern": "^[a-z0-9][a-z0-9._-]{0,31}(/[a-z0-9][a-z0-9._-]{0,31})?$"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "web_fetch_per_1k": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "web_search_per_1k": {
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "input_per_1m",
          "output_per_1m"
        ],
        "type": "object"
      },
      "ModelLimit": {
        "additionalProperties": true,
        "properties": {
          "concurrency_per_minute": {
            "description": "Request admissions per 60 seconds.",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "model": {
            "description": "Exact configured model identifier.",
            "maxLength": 512,
            "minLength": 1,
            "type": "string"
          },
          "provider_label": {
            "description": "Exact shared-provider label.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "rate_limit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RateLimit"
              },
              {
                "type": "null"
              }
            ]
          },
          "timeout": {
            "description": "Seconds.",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "token_limits": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TokenLimits"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "provider_label",
          "model"
        ],
        "type": "object"
      },
      "ModelMetadata": {
        "additionalProperties": false,
        "properties": {
          "caching": {
            "additionalProperties": false,
            "properties": {
              "min_cacheable_tokens": {
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "support": {
                "enum": [
                  "supported",
                  "unsupported",
                  "conditional",
                  "unknown",
                  null
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "supported_ttls": {
                "items": {
                  "maxLength": 64,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 16,
                "type": [
                  "array",
                  "null"
                ],
                "uniqueItems": true
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "capabilities": {
            "additionalProperties": false,
            "properties": {
              "supports_json_mode": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "supports_json_schema": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "supports_parallel_tool_calls": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "supports_streaming": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "supports_tool_calling": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "input_formats": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 32,
            "type": [
              "array",
              "null"
            ],
            "uniqueItems": true
          },
          "input_modalities": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 32,
            "type": [
              "array",
              "null"
            ],
            "uniqueItems": true
          },
          "lifecycle": {
            "additionalProperties": false,
            "properties": {
              "retirement_date": {
                "format": "date",
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "enum": [
                  "unknown",
                  "preview",
                  "stable",
                  "deprecated",
                  "retired",
                  null
                ],
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "limits": {
            "additionalProperties": false,
            "properties": {
              "context_window_tokens": {
                "maximum": 9007199254740991,
                "minimum": 1,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "max_input_tokens": {
                "maximum": 9007199254740991,
                "minimum": 1,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "max_output_tokens": {
                "maximum": 9007199254740991,
                "minimum": 1,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "max_reasoning_tokens": {
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "output_formats": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 32,
            "type": [
              "array",
              "null"
            ],
            "uniqueItems": true
          },
          "output_modalities": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 32,
            "type": [
              "array",
              "null"
            ],
            "uniqueItems": true
          },
          "provenance": {
            "additionalProperties": false,
            "properties": {
              "last_verified_at": {
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "enum": [
                  "manual",
                  "provider_api",
                  "catalog",
                  null
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "source_url": {
                "maxLength": 2048,
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_at": {
                "format": "date-time",
                "readOnly": true,
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "reasoning_tokens_in_output_budget": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "supported_reasoning_efforts": {
            "items": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 16,
            "type": [
              "array",
              "null"
            ],
            "uniqueItems": true
          },
          "tags": {
            "additionalProperties": {
              "oneOf": [
                {
                  "maxLength": 512,
                  "type": "string"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "number"
                },
                {
                  "items": {
                    "maxLength": 512,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "At most 64 active tags including the canonical identity preset, plus 1024 stored null clears. Null custom tags are hidden from public views; canonical_model:null resets the identity to its catalog default or model ID.",
            "maxProperties": 1088,
            "propertyNames": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            },
            "type": [
              "object",
              "null"
            ],
            "x-maxActiveProperties": 64,
            "x-maxNullProperties": 1024
          },
          "temperature": {
            "additionalProperties": false,
            "properties": {
              "conditions": {
                "maxLength": 1024,
                "type": [
                  "string",
                  "null"
                ],
                "x-multiline": true
              },
              "default": {
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "max": {
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "min": {
                "minimum": 0,
                "type": [
                  "number",
                  "null"
                ]
              },
              "support": {
                "enum": [
                  "supported",
                  "unsupported",
                  "conditional",
                  "unknown",
                  null
                ],
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "upstream_limits": {
            "additionalProperties": false,
            "properties": {
              "input_tpm": {
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "max_inflight_requests": {
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "output_tpm": {
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "rpm": {
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "shared_quota_pool_ids": {
                "items": {
                  "maxLength": 128,
                  "minLength": 1,
                  "type": "string"
                },
                "maxItems": 32,
                "type": [
                  "array",
                  "null"
                ],
                "uniqueItems": true
              },
              "total_tpm": {
                "maximum": 9007199254740991,
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          }
        },
        "type": [
          "object",
          "null"
        ]
      },
      "OpenApiDocument": {
        "additionalProperties": true,
        "description": "This OpenAPI 3.1 document.",
        "type": "object"
      },
      "OperationStatus": {
        "additionalProperties": true,
        "properties": {
          "created_at": {
            "description": "Unix epoch seconds, potentially fractional.",
            "type": "number"
          },
          "operation_id": {
            "type": "string"
          },
          "state": {
            "type": "string"
          }
        },
        "required": [
          "operation_id",
          "state",
          "created_at"
        ],
        "type": "object"
      },
      "OutboundIpsResponse": {
        "additionalProperties": true,
        "properties": {
          "outbound_ips": {
            "additionalProperties": true,
            "properties": {
              "applies_within_seconds": {
                "description": "A change reaches every server in the region within this many seconds.",
                "type": "integer"
              },
              "available": {
                "description": "false where this gateway can't call out from the chosen region's outbound IPs: the setting is stored but changes nothing.",
                "type": "boolean"
              },
              "enabled": {
                "description": "true: every provider without a use_outbound_ips setting of its own calls out from the Quilr outbound IPs. false or null: those providers are called directly.",
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "region": {
                "description": "The region whose Quilr outbound IPs are used; null: the gateway's own region.",
                "enum": [
                  "us",
                  "eu",
                  "in",
                  null
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "regions": {
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "available": {
                      "type": "boolean"
                    },
                    "code": {
                      "type": "string"
                    },
                    "ips": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "name",
                    "ips",
                    "available"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "updated_at": {
                "description": "When the setting was last changed.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_by": {
                "description": "Who changed it last.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "enabled",
              "region",
              "regions",
              "available",
              "applies_within_seconds"
            ],
            "type": "object"
          }
        },
        "required": [
          "outbound_ips"
        ],
        "type": "object"
      },
      "OutboundIpsUpdate": {
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "description": "true: every provider without a use_outbound_ips setting of its own calls out from the Quilr outbound IPs. false or null: those providers are called directly.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "region": {
            "description": "The region whose Quilr outbound IPs are used; null: the gateway's own region.",
            "enum": [
              "us",
              "eu",
              "in",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "PolicyAuthority": {
        "additionalProperties": true,
        "properties": {
          "active_checksum": {
            "type": [
              "string",
              "null"
            ]
          },
          "active_revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "enabled": {
            "description": "Whether QuilrQL governs this tenant.",
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Prompt": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "PromptList": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "content": {
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "prompt_id": {
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "description": "Opaque resource version. Send its quoted value in If-Match.",
            "type": "string"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "PromptRecord": {
        "additionalProperties": true,
        "properties": {
          "content": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PromptResponse": {
        "additionalProperties": true,
        "properties": {
          "prompt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PromptRecord"
              },
              {
                "type": "null"
              }
            ]
          },
          "prompt_id": {
            "type": "string"
          },
          "version": {
            "description": "Opaque resource version. Send its quoted value in If-Match.",
            "type": "string"
          }
        },
        "required": [
          "prompt_id",
          "prompt",
          "version"
        ],
        "type": "object"
      },
      "Provider": {
        "additionalProperties": false,
        "description": "Shared-provider configuration. Saves never call the upstream; use the test and available-models operations to check settings.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "label": {
            "description": "Tenant-unique display name; immutable.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "model_costs": {
            "additionalProperties": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ModelCost"
                },
                {
                  "type": "null"
                }
              ]
            },
            "maxProperties": 1000,
            "type": "object"
          },
          "model_metadata": {
            "additionalProperties": {
              "additionalProperties": false,
              "properties": {
                "caching": {
                  "additionalProperties": false,
                  "properties": {
                    "min_cacheable_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "support": {
                      "enum": [
                        "supported",
                        "unsupported",
                        "conditional",
                        "unknown",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "supported_ttls": {
                      "items": {
                        "maxLength": 64,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 16,
                      "type": [
                        "array",
                        "null"
                      ],
                      "uniqueItems": true
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "capabilities": {
                  "additionalProperties": false,
                  "properties": {
                    "supports_json_mode": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_json_schema": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_parallel_tool_calls": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_streaming": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_tool_calling": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "input_formats": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "input_modalities": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "lifecycle": {
                  "additionalProperties": false,
                  "properties": {
                    "retirement_date": {
                      "format": "date",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "enum": [
                        "unknown",
                        "preview",
                        "stable",
                        "deprecated",
                        "retired",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "limits": {
                  "additionalProperties": false,
                  "properties": {
                    "context_window_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_input_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_output_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_reasoning_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "output_formats": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "output_modalities": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "provenance": {
                  "additionalProperties": false,
                  "properties": {
                    "last_verified_at": {
                      "format": "date-time",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "enum": [
                        "manual",
                        "provider_api",
                        "catalog",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source_url": {
                      "maxLength": 2048,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updated_at": {
                      "format": "date-time",
                      "readOnly": true,
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "reasoning_tokens_in_output_budget": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "supported_reasoning_efforts": {
                  "items": {
                    "maxLength": 64,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 16,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "tags": {
                  "additionalProperties": {
                    "oneOf": [
                      {
                        "maxLength": 512,
                        "type": "string"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "items": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 32,
                        "type": [
                          "array",
                          "null"
                        ],
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": "At most 64 active tags including the canonical identity preset, plus 1024 stored null clears. Null custom tags are hidden from public views; canonical_model:null resets the identity to its catalog default or model ID.",
                  "maxProperties": 1088,
                  "propertyNames": {
                    "maxLength": 64,
                    "minLength": 1,
                    "type": "string"
                  },
                  "type": [
                    "object",
                    "null"
                  ],
                  "x-maxActiveProperties": 64,
                  "x-maxNullProperties": 1024
                },
                "temperature": {
                  "additionalProperties": false,
                  "properties": {
                    "conditions": {
                      "maxLength": 1024,
                      "type": [
                        "string",
                        "null"
                      ],
                      "x-multiline": true
                    },
                    "default": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "max": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "min": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "support": {
                      "enum": [
                        "supported",
                        "unsupported",
                        "conditional",
                        "unknown",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "upstream_limits": {
                  "additionalProperties": false,
                  "properties": {
                    "input_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_inflight_requests": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "output_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "rpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "shared_quota_pool_ids": {
                      "items": {
                        "maxLength": 128,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 32,
                      "type": [
                        "array",
                        "null"
                      ],
                      "uniqueItems": true
                    },
                    "total_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "description": "Model facts keyed by selected ID. Absent fields inherit compatible catalog defaults; nested nulls remain unknown. A null model item resets its saved overrides to the catalog.",
            "maxProperties": 1000,
            "propertyNames": {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "model_metadata_reset": {
            "additionalProperties": {
              "items": {
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 64,
              "type": "array"
            },
            "description": "Dotted metadata paths per selected model whose stored override is removed, so the catalog default shows through again. Distinct from null (= unknown).",
            "maxProperties": 1000,
            "type": "object"
          },
          "provider_name": {
            "description": "Provider type; immutable.",
            "enum": [
              "openai",
              "azureopenai",
              "general",
              "anthropic",
              "anthropic_messages",
              "anthropic_messages_bedrock",
              "anthropic_messages_azure",
              "deepseek",
              "vertex_ai",
              "gemini_chatcompletions",
              "oracle",
              "openai_responses",
              "openai_responses_azure",
              "oracle_responses",
              "openai_assistants",
              "openai_assistants_azure",
              "openai_realtime",
              "openai_realtime_azure",
              "bedrock",
              "bedrock_embeddings",
              "cohere_rerank",
              "bedrock_rerank",
              "jina_rerank",
              "voyage_rerank",
              "general_rerank",
              "sarvam",
              "mistral",
              "xai",
              "xai_responses",
              "cerebras",
              "typesafe",
              "groq",
              "perplexity",
              "cohere"
            ],
            "type": "string"
          },
          "provider_settings": {
            "$ref": "#/components/schemas/ProviderSettings"
          },
          "selected_models": {
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "tags": {
            "$ref": "#/components/schemas/ProviderTags"
          },
          "tags_reset": {
            "description": "Return provider tag presets to their derived/default values. geo is derived at read time from the region (us|eu|uk|ca|apac|jp|au|in|sa|me|global); tags.geo: null instead clears it to unknown and stops derivation. Reads add tag_sources {provider, models} naming each tag's source (derived|manual|catalog).",
            "items": {
              "enum": [
                "region",
                "service_tier",
                "geo"
              ]
            },
            "type": "array",
            "uniqueItems": true
          },
          "upstream_limits": {
            "$ref": "#/components/schemas/UpstreamLimits"
          }
        },
        "type": "object"
      },
      "ProviderAvailableModels": {
        "additionalProperties": false,
        "properties": {
          "provider_settings": {
            "description": "Draft settings, validated like a provider save. On a stored provider they merge onto the saved settings; a blank secret keeps the stored value. Never persisted.",
            "propertyNames": {
              "enum": [
                "anthropic_version",
                "api_key",
                "auth_type",
                "aws_access_key",
                "aws_auth_mode",
                "aws_bedrock_api_key",
                "aws_bedrock_chat_api",
                "aws_bedrock_endpoint",
                "aws_bedrock_openai_path",
                "aws_external_id",
                "aws_region",
                "aws_role_arn",
                "aws_role_session_name",
                "aws_secret_key",
                "aws_session_duration_seconds",
                "aws_session_token",
                "azure_api_version",
                "azure_auth_header",
                "azure_endpoint",
                "base_url",
                "gcp_project_id",
                "gcp_region",
                "gpu_connector_id",
                "oci_compartment_id",
                "oci_fingerprint",
                "oci_private_key",
                "oci_private_key_passphrase",
                "oci_project_id",
                "oci_region",
                "oci_session_token",
                "oci_tenancy_id",
                "oci_user_id",
                "preferred_upstream_api",
                "remote_connector_id",
                "service_account_json",
                "upstream_apis"
              ]
            },
            "type": "object",
            "writeOnly": true
          },
          "validate": {
            "default": false,
            "description": "Also probe every listed model (slower; can incur upstream usage).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ProviderCreate": {
        "additionalProperties": false,
        "description": "Shared-provider configuration. Saves never call the upstream; use the test and available-models operations to check settings.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "label": {
            "description": "Tenant-unique display name; immutable.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "model_costs": {
            "additionalProperties": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ModelCost"
                },
                {
                  "type": "null"
                }
              ]
            },
            "maxProperties": 1000,
            "type": "object"
          },
          "model_metadata": {
            "additionalProperties": {
              "additionalProperties": false,
              "properties": {
                "caching": {
                  "additionalProperties": false,
                  "properties": {
                    "min_cacheable_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "support": {
                      "enum": [
                        "supported",
                        "unsupported",
                        "conditional",
                        "unknown",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "supported_ttls": {
                      "items": {
                        "maxLength": 64,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 16,
                      "type": [
                        "array",
                        "null"
                      ],
                      "uniqueItems": true
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "capabilities": {
                  "additionalProperties": false,
                  "properties": {
                    "supports_json_mode": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_json_schema": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_parallel_tool_calls": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_streaming": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_tool_calling": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "input_formats": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "input_modalities": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "lifecycle": {
                  "additionalProperties": false,
                  "properties": {
                    "retirement_date": {
                      "format": "date",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "enum": [
                        "unknown",
                        "preview",
                        "stable",
                        "deprecated",
                        "retired",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "limits": {
                  "additionalProperties": false,
                  "properties": {
                    "context_window_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_input_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_output_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_reasoning_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "output_formats": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "output_modalities": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "provenance": {
                  "additionalProperties": false,
                  "properties": {
                    "last_verified_at": {
                      "format": "date-time",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "enum": [
                        "manual",
                        "provider_api",
                        "catalog",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source_url": {
                      "maxLength": 2048,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updated_at": {
                      "format": "date-time",
                      "readOnly": true,
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "reasoning_tokens_in_output_budget": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "supported_reasoning_efforts": {
                  "items": {
                    "maxLength": 64,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 16,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "tags": {
                  "additionalProperties": {
                    "oneOf": [
                      {
                        "maxLength": 512,
                        "type": "string"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "items": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 32,
                        "type": [
                          "array",
                          "null"
                        ],
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": "At most 64 active tags including the canonical identity preset, plus 1024 stored null clears. Null custom tags are hidden from public views; canonical_model:null resets the identity to its catalog default or model ID.",
                  "maxProperties": 1088,
                  "propertyNames": {
                    "maxLength": 64,
                    "minLength": 1,
                    "type": "string"
                  },
                  "type": [
                    "object",
                    "null"
                  ],
                  "x-maxActiveProperties": 64,
                  "x-maxNullProperties": 1024
                },
                "temperature": {
                  "additionalProperties": false,
                  "properties": {
                    "conditions": {
                      "maxLength": 1024,
                      "type": [
                        "string",
                        "null"
                      ],
                      "x-multiline": true
                    },
                    "default": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "max": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "min": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "support": {
                      "enum": [
                        "supported",
                        "unsupported",
                        "conditional",
                        "unknown",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "upstream_limits": {
                  "additionalProperties": false,
                  "properties": {
                    "input_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_inflight_requests": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "output_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "rpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "shared_quota_pool_ids": {
                      "items": {
                        "maxLength": 128,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 32,
                      "type": [
                        "array",
                        "null"
                      ],
                      "uniqueItems": true
                    },
                    "total_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "description": "Model facts keyed by selected ID. Absent fields inherit compatible catalog defaults; nested nulls remain unknown. A null model item resets its saved overrides to the catalog.",
            "maxProperties": 1000,
            "propertyNames": {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "model_metadata_reset": {
            "additionalProperties": {
              "items": {
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 64,
              "type": "array"
            },
            "description": "Dotted metadata paths per selected model whose stored override is removed, so the catalog default shows through again. Distinct from null (= unknown).",
            "maxProperties": 1000,
            "type": "object"
          },
          "provider_name": {
            "description": "Provider type; immutable.",
            "enum": [
              "openai",
              "azureopenai",
              "general",
              "anthropic",
              "anthropic_messages",
              "anthropic_messages_bedrock",
              "anthropic_messages_azure",
              "deepseek",
              "vertex_ai",
              "gemini_chatcompletions",
              "oracle",
              "openai_responses",
              "openai_responses_azure",
              "oracle_responses",
              "openai_assistants",
              "openai_assistants_azure",
              "openai_realtime",
              "openai_realtime_azure",
              "bedrock",
              "bedrock_embeddings",
              "cohere_rerank",
              "bedrock_rerank",
              "jina_rerank",
              "voyage_rerank",
              "general_rerank",
              "sarvam",
              "mistral",
              "xai",
              "xai_responses",
              "cerebras",
              "typesafe",
              "groq",
              "perplexity",
              "cohere"
            ],
            "type": "string"
          },
          "provider_settings": {
            "$ref": "#/components/schemas/ProviderSettings"
          },
          "selected_models": {
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "tags": {
            "$ref": "#/components/schemas/ProviderTags"
          },
          "tags_reset": {
            "description": "Return provider tag presets to their derived/default values. geo is derived at read time from the region (us|eu|uk|ca|apac|jp|au|in|sa|me|global); tags.geo: null instead clears it to unknown and stops derivation. Reads add tag_sources {provider, models} naming each tag's source (derived|manual|catalog).",
            "items": {
              "enum": [
                "region",
                "service_tier",
                "geo"
              ]
            },
            "type": "array",
            "uniqueItems": true
          },
          "upstream_limits": {
            "$ref": "#/components/schemas/UpstreamLimits"
          }
        },
        "required": [
          "label",
          "provider_name"
        ],
        "type": "object"
      },
      "ProviderDeleted": {
        "properties": {
          "deleted": {
            "const": true
          },
          "label": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProviderDiscoveryResult": {
        "additionalProperties": false,
        "properties": {
          "discovery": {
            "additionalProperties": false,
            "properties": {
              "based_on_version": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "code": {
                "type": "string"
              },
              "completed_at": {
                "type": "number"
              },
              "count": {
                "type": "integer"
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "latency_ms": {
                "type": "number"
              },
              "message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "models": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "created": {
                      "type": "number"
                    },
                    "created_at": {
                      "type": [
                        "number",
                        "string"
                      ]
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "inference_profile": {
                      "type": "boolean"
                    },
                    "inference_profile_type": {
                      "type": "string"
                    },
                    "inference_types": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "input_modalities": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "object": {
                      "type": "string"
                    },
                    "output_modalities": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "owned_by": {
                      "type": "string"
                    },
                    "provider_name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "outcome": {
                "enum": [
                  "passed",
                  "failed",
                  "timeout",
                  "skipped",
                  "unsupported",
                  "manual_entry"
                ]
              },
              "provider_name": {
                "type": "string"
              },
              "validation_completed": {
                "description": "Every listed model was probed (models_validated or no_models_passed_validation).",
                "type": "boolean"
              },
              "validation_requested": {
                "type": "boolean"
              },
              "validation_results": {
                "description": "Only when validate is true; partial after a timeout.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "model": {
                      "type": "string"
                    },
                    "outcome": {
                      "enum": [
                        "passed",
                        "failed",
                        "skipped"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "warnings": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "request_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProviderDraftAvailableModels": {
        "additionalProperties": false,
        "properties": {
          "provider_name": {
            "type": "string"
          },
          "provider_settings": {
            "description": "Draft settings, validated like a provider save. On a stored provider they merge onto the saved settings; a blank secret keeps the stored value. Never persisted.",
            "propertyNames": {
              "enum": [
                "anthropic_version",
                "api_key",
                "auth_type",
                "aws_access_key",
                "aws_auth_mode",
                "aws_bedrock_api_key",
                "aws_bedrock_chat_api",
                "aws_bedrock_endpoint",
                "aws_bedrock_openai_path",
                "aws_external_id",
                "aws_region",
                "aws_role_arn",
                "aws_role_session_name",
                "aws_secret_key",
                "aws_session_duration_seconds",
                "aws_session_token",
                "azure_api_version",
                "azure_auth_header",
                "azure_endpoint",
                "base_url",
                "gcp_project_id",
                "gcp_region",
                "gpu_connector_id",
                "oci_compartment_id",
                "oci_fingerprint",
                "oci_private_key",
                "oci_private_key_passphrase",
                "oci_project_id",
                "oci_region",
                "oci_session_token",
                "oci_tenancy_id",
                "oci_user_id",
                "preferred_upstream_api",
                "remote_connector_id",
                "service_account_json",
                "upstream_apis"
              ]
            },
            "type": "object",
            "writeOnly": true
          },
          "validate": {
            "default": false,
            "description": "Also probe every listed model (slower; can incur upstream usage).",
            "type": "boolean"
          }
        },
        "required": [
          "provider_name"
        ],
        "type": "object"
      },
      "ProviderDraftTestSettings": {
        "additionalProperties": false,
        "properties": {
          "models": {
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 10,
            "type": "array",
            "uniqueItems": true
          },
          "provider_name": {
            "type": "string"
          },
          "provider_settings": {
            "description": "Draft settings, validated like a provider save. On a stored provider they merge onto the saved settings; a blank secret keeps the stored value. Never persisted.",
            "propertyNames": {
              "enum": [
                "anthropic_version",
                "api_key",
                "auth_type",
                "aws_access_key",
                "aws_auth_mode",
                "aws_bedrock_api_key",
                "aws_bedrock_chat_api",
                "aws_bedrock_endpoint",
                "aws_bedrock_openai_path",
                "aws_external_id",
                "aws_region",
                "aws_role_arn",
                "aws_role_session_name",
                "aws_secret_key",
                "aws_session_duration_seconds",
                "aws_session_token",
                "azure_api_version",
                "azure_auth_header",
                "azure_endpoint",
                "base_url",
                "gcp_project_id",
                "gcp_region",
                "gpu_connector_id",
                "oci_compartment_id",
                "oci_fingerprint",
                "oci_private_key",
                "oci_private_key_passphrase",
                "oci_project_id",
                "oci_region",
                "oci_session_token",
                "oci_tenancy_id",
                "oci_user_id",
                "preferred_upstream_api",
                "remote_connector_id",
                "service_account_json",
                "upstream_apis"
              ]
            },
            "type": "object",
            "writeOnly": true
          }
        },
        "required": [
          "provider_name"
        ],
        "type": "object"
      },
      "ProviderHealth": {
        "additionalProperties": true,
        "properties": {
          "filters": {
            "additionalProperties": true,
            "properties": {
              "app": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "provider": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "generated_at": {
            "description": "When the traffic outcomes were read from storage (UTC; cached up to 60 seconds). routing_state is read at response time.",
            "format": "date-time",
            "type": "string"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/ProviderHealthProvider"
            },
            "type": "array"
          },
          "routing_state_scope": {
            "additionalProperties": true,
            "properties": {
              "apps_attempted": {
                "description": "Apps whose routing state was requested (at most 25, within 5 seconds).",
                "type": "integer"
              },
              "apps_evaluated": {
                "description": "Apps whose routing state was read.",
                "type": "integer"
              },
              "apps_failed": {
                "description": "Attempted apps whose routing state could not be read.",
                "type": "integer"
              },
              "apps_total": {
                "description": "Apps in scope.",
                "type": "integer"
              },
              "complete": {
                "description": "True only when every app's routing state was read. When false, targets without a state read from some app report `unknown`.",
                "type": "boolean"
              },
              "note": {
                "type": "string"
              },
              "scope": {
                "const": "this_server"
              }
            },
            "type": "object"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "truncated": {
            "description": "More than 500 provider and model pairs had traffic; the busiest are returned. Filter to see the rest.",
            "type": "boolean"
          },
          "window": {
            "enum": [
              "1h",
              "24h",
              "7d",
              "30d",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "from",
          "to",
          "providers",
          "routing_state_scope",
          "generated_at"
        ],
        "type": "object"
      },
      "ProviderHealthModel": {
        "additionalProperties": true,
        "properties": {
          "errors": {
            "additionalProperties": true,
            "description": "Failed requests by failure class, the same classes request explanations use: rate_limited (429 rate limits), timeout_or_connection (timeouts and unreachable upstreams), upstream_5xx (other provider server errors), auth_or_permission (401 and 403), client_4xx (other 4xx: invalid request, unknown model, context length, content filter) or other.",
            "properties": {
              "auth_or_permission": {
                "description": "401 and 403.",
                "type": "integer"
              },
              "client_4xx": {
                "description": "Other 4xx (invalid request, unknown model, context length, content filter).",
                "type": "integer"
              },
              "other": {
                "description": "Failures no class above covers.",
                "type": "integer"
              },
              "rate_limited": {
                "description": "429 responses.",
                "type": "integer"
              },
              "timeout_or_connection": {
                "description": "Timeouts and unreachable upstreams.",
                "type": "integer"
              },
              "upstream_5xx": {
                "description": "Other provider server errors.",
                "type": "integer"
              }
            },
            "required": [
              "rate_limited",
              "timeout_or_connection",
              "upstream_5xx",
              "auth_or_permission",
              "client_4xx",
              "other"
            ],
            "type": "object"
          },
          "failovers_away": {
            "description": "Attempts on this target that failed and moved the request to another target (the request then counts under the target that served it).",
            "type": "integer"
          },
          "failures": {
            "description": "Of those, requests that ended in an error status.",
            "type": "integer"
          },
          "last_request_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "latency_ms": {
            "additionalProperties": true,
            "description": "Upstream latency of successful requests.",
            "properties": {
              "p50": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "p95": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "model": {
            "type": "string"
          },
          "requests": {
            "description": "Served requests whose final attempt used this target.",
            "type": "integer"
          },
          "routing_state": {
            "additionalProperties": true,
            "properties": {
              "mark_downs": {
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "apps": {
                      "oneOf": [
                        {
                          "const": "*"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      ]
                    },
                    "expires_at": {
                      "format": "date-time",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "enum": [
                        "tenant",
                        "app"
                      ]
                    },
                    "ticket": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "state": {
                "description": "healthy; unknown (this server's routing state could not be read for the target because some apps' routing previews failed or were not reached; see routing_state_scope); half_open (a probe request is allowed); cooling_down (paused after rate limiting); circuit_open (skipped after repeated failures); marked_down (an admin mark-down applies).",
                "enum": [
                  "healthy",
                  "unknown",
                  "half_open",
                  "cooling_down",
                  "circuit_open",
                  "marked_down"
                ]
              },
              "until": {
                "description": "When the cooldown or open circuit is due to end.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "state",
              "mark_downs"
            ],
            "type": "object"
          },
          "success_rate_pct": {
            "description": "100 x (requests - failures) / requests; null without traffic.",
            "type": [
              "number",
              "null"
            ]
          },
          "time_to_first_token_ms": {
            "additionalProperties": true,
            "description": "Successful streamed requests only.",
            "properties": {
              "p50": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "p95": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "streamed_requests": {
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "model",
          "requests",
          "success_rate_pct",
          "errors",
          "routing_state"
        ],
        "type": "object"
      },
      "ProviderHealthProvider": {
        "additionalProperties": true,
        "properties": {
          "configured": {
            "description": "False for a label seen only in traffic (renamed or deleted since).",
            "type": "boolean"
          },
          "errors": {
            "additionalProperties": true,
            "description": "Failed requests by failure class, the same classes request explanations use: rate_limited (429 rate limits), timeout_or_connection (timeouts and unreachable upstreams), upstream_5xx (other provider server errors), auth_or_permission (401 and 403), client_4xx (other 4xx: invalid request, unknown model, context length, content filter) or other.",
            "properties": {
              "auth_or_permission": {
                "description": "401 and 403.",
                "type": "integer"
              },
              "client_4xx": {
                "description": "Other 4xx (invalid request, unknown model, context length, content filter).",
                "type": "integer"
              },
              "other": {
                "description": "Failures no class above covers.",
                "type": "integer"
              },
              "rate_limited": {
                "description": "429 responses.",
                "type": "integer"
              },
              "timeout_or_connection": {
                "description": "Timeouts and unreachable upstreams.",
                "type": "integer"
              },
              "upstream_5xx": {
                "description": "Other provider server errors.",
                "type": "integer"
              }
            },
            "required": [
              "rate_limited",
              "timeout_or_connection",
              "upstream_5xx",
              "auth_or_permission",
              "client_4xx",
              "other"
            ],
            "type": "object"
          },
          "failovers_away": {
            "description": "Attempts on this target that failed and moved the request to another target (the request then counts under the target that served it).",
            "type": "integer"
          },
          "failures": {
            "description": "Of those, requests that ended in an error status.",
            "type": "integer"
          },
          "latency_ms": {
            "additionalProperties": true,
            "description": "Percentiles do not add up across models: set only when the provider has one model; read the models otherwise.",
            "properties": {
              "p50": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "p95": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "models": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "errors": {
                  "additionalProperties": true,
                  "description": "Failed requests by failure class, the same classes request explanations use: rate_limited (429 rate limits), timeout_or_connection (timeouts and unreachable upstreams), upstream_5xx (other provider server errors), auth_or_permission (401 and 403), client_4xx (other 4xx: invalid request, unknown model, context length, content filter) or other.",
                  "properties": {
                    "auth_or_permission": {
                      "description": "401 and 403.",
                      "type": "integer"
                    },
                    "client_4xx": {
                      "description": "Other 4xx (invalid request, unknown model, context length, content filter).",
                      "type": "integer"
                    },
                    "other": {
                      "description": "Failures no class above covers.",
                      "type": "integer"
                    },
                    "rate_limited": {
                      "description": "429 responses.",
                      "type": "integer"
                    },
                    "timeout_or_connection": {
                      "description": "Timeouts and unreachable upstreams.",
                      "type": "integer"
                    },
                    "upstream_5xx": {
                      "description": "Other provider server errors.",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "rate_limited",
                    "timeout_or_connection",
                    "upstream_5xx",
                    "auth_or_permission",
                    "client_4xx",
                    "other"
                  ],
                  "type": "object"
                },
                "failovers_away": {
                  "description": "Attempts on this target that failed and moved the request to another target (the request then counts under the target that served it).",
                  "type": "integer"
                },
                "failures": {
                  "description": "Of those, requests that ended in an error status.",
                  "type": "integer"
                },
                "last_request_at": {
                  "format": "date-time",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "latency_ms": {
                  "additionalProperties": true,
                  "description": "Upstream latency of successful requests.",
                  "properties": {
                    "p50": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "p95": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                },
                "model": {
                  "type": "string"
                },
                "requests": {
                  "description": "Served requests whose final attempt used this target.",
                  "type": "integer"
                },
                "routing_state": {
                  "additionalProperties": true,
                  "properties": {
                    "mark_downs": {
                      "items": {
                        "additionalProperties": true,
                        "properties": {
                          "apps": {
                            "oneOf": [
                              {
                                "const": "*"
                              },
                              {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              }
                            ]
                          },
                          "expires_at": {
                            "format": "date-time",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "id": {
                            "type": "string"
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "enum": [
                              "tenant",
                              "app"
                            ]
                          },
                          "ticket": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "state": {
                      "description": "healthy; unknown (this server's routing state could not be read for the target because some apps' routing previews failed or were not reached; see routing_state_scope); half_open (a probe request is allowed); cooling_down (paused after rate limiting); circuit_open (skipped after repeated failures); marked_down (an admin mark-down applies).",
                      "enum": [
                        "healthy",
                        "unknown",
                        "half_open",
                        "cooling_down",
                        "circuit_open",
                        "marked_down"
                      ]
                    },
                    "until": {
                      "description": "When the cooldown or open circuit is due to end.",
                      "format": "date-time",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "state",
                    "mark_downs"
                  ],
                  "type": "object"
                },
                "success_rate_pct": {
                  "description": "100 x (requests - failures) / requests; null without traffic.",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "time_to_first_token_ms": {
                  "additionalProperties": true,
                  "description": "Successful streamed requests only.",
                  "properties": {
                    "p50": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "p95": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "streamed_requests": {
                      "type": "integer"
                    }
                  },
                  "type": "object"
                }
              },
              "required": [
                "model",
                "requests",
                "success_rate_pct",
                "errors",
                "routing_state"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "provider_label": {
            "type": "string"
          },
          "provider_name": {
            "description": "Provider type.",
            "type": [
              "string",
              "null"
            ]
          },
          "requests": {
            "description": "Served requests whose final attempt used this target.",
            "type": "integer"
          },
          "routing_state": {
            "additionalProperties": true,
            "description": "The worst model state; mark_downs lists provider-wide mark-downs.",
            "properties": {
              "mark_downs": {
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "apps": {
                      "oneOf": [
                        {
                          "const": "*"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      ]
                    },
                    "expires_at": {
                      "format": "date-time",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "enum": [
                        "tenant",
                        "app"
                      ]
                    },
                    "ticket": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "state": {
                "description": "healthy; unknown (this server's routing state could not be read for the target because some apps' routing previews failed or were not reached; see routing_state_scope); half_open (a probe request is allowed); cooling_down (paused after rate limiting); circuit_open (skipped after repeated failures); marked_down (an admin mark-down applies).",
                "enum": [
                  "healthy",
                  "unknown",
                  "half_open",
                  "cooling_down",
                  "circuit_open",
                  "marked_down"
                ]
              }
            },
            "required": [
              "state"
            ],
            "type": "object"
          },
          "success_rate_pct": {
            "description": "100 x (requests - failures) / requests; null without traffic.",
            "type": [
              "number",
              "null"
            ]
          },
          "time_to_first_token_ms": {
            "additionalProperties": true,
            "description": "Successful streamed requests only.",
            "properties": {
              "p50": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "p95": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "streamed_requests": {
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "provider_label",
          "requests",
          "success_rate_pct",
          "errors",
          "routing_state",
          "models"
        ],
        "type": "object"
      },
      "ProviderList": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProviderView"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "ProviderModelReviewAppDecision": {
        "additionalProperties": false,
        "properties": {
          "app_name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "models": {
            "items": {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 1000,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "status": {
            "description": "approved: add to the app provider's model list (a new app configuration version) and close the review. rejected / pending as for shared providers.",
            "enum": [
              "approved",
              "rejected",
              "pending"
            ]
          }
        },
        "required": [
          "app_name",
          "status",
          "models"
        ],
        "type": "object"
      },
      "ProviderModelReviewDecision": {
        "additionalProperties": false,
        "properties": {
          "model_costs": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Optional prices for approved models, as on PATCH /providers/{label}.",
            "maxProperties": 1000,
            "type": "object"
          },
          "models": {
            "items": {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 1000,
            "minItems": 1,
            "type": "array",
            "uniqueItems": true
          },
          "status": {
            "description": "approved: add to the provider's model list and close the review (from pending or rejected). rejected: reject a pending model. pending: restore a rejected model.",
            "enum": [
              "approved",
              "rejected",
              "pending"
            ]
          }
        },
        "required": [
          "status",
          "models"
        ],
        "type": "object"
      },
      "ProviderModelReviewDecisionResult": {
        "additionalProperties": true,
        "properties": {
          "added_to_model_list": {
            "description": "Models newly added to the model list (approved only); models already listed are not repeated.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "app_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string"
          },
          "models": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "operation_id": {
            "type": "string"
          },
          "provider_version": {
            "description": "The shared provider's version after an approval (If-Match for the next PATCH).",
            "type": "string"
          },
          "status": {
            "enum": [
              "approved",
              "rejected",
              "pending"
            ]
          }
        },
        "required": [
          "operation_id",
          "label",
          "status",
          "models",
          "added_to_model_list"
        ],
        "type": "object"
      },
      "ProviderModelReviewItem": {
        "additionalProperties": true,
        "properties": {
          "app_name": {
            "description": "The app holding this provider with its own keys; null for a shared provider.",
            "type": [
              "string",
              "null"
            ]
          },
          "decided_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "decided_by": {
            "description": "Console user email or management key id; null when undecided or added another way.",
            "type": [
              "string",
              "null"
            ]
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_seen_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string"
          },
          "model_id": {
            "type": "string"
          },
          "model_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "provider_name": {
            "type": "string"
          },
          "status": {
            "description": "approved also covers a model added to the model list another way.",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ]
          }
        },
        "required": [
          "label",
          "provider_name",
          "app_name",
          "model_id",
          "status"
        ],
        "type": "object"
      },
      "ProviderModelReviewModel": {
        "additionalProperties": true,
        "properties": {
          "decided_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "decided_by": {
            "description": "Console user email or management key id; null when undecided or added another way.",
            "type": [
              "string",
              "null"
            ]
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_seen_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "model_id": {
            "type": "string"
          },
          "model_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "description": "approved also covers a model added to the model list another way.",
            "enum": [
              "pending",
              "approved",
              "rejected"
            ]
          }
        },
        "required": [
          "model_id",
          "status"
        ],
        "type": "object"
      },
      "ProviderModelReviewPage": {
        "additionalProperties": true,
        "properties": {
          "available": {
            "description": "False where reviews are not managed (then items is empty).",
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProviderModelReviewItem"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "pending_count": {
            "description": "Models waiting for a decision across the matching providers (ignores status).",
            "type": "integer"
          },
          "settings": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ProviderModelReviewSettings"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "available",
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "ProviderModelReviewProvider": {
        "additionalProperties": true,
        "properties": {
          "provider": {
            "additionalProperties": true,
            "properties": {
              "app_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "approved": {
                "items": {
                  "$ref": "#/components/schemas/ProviderModelReviewModel"
                },
                "type": "array"
              },
              "label": {
                "type": "string"
              },
              "last_checked_at": {
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "last_error": {
                "anyOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "code": {
                        "enum": [
                          "auth_failed",
                          "rate_limited",
                          "unreachable",
                          "no_models_listed",
                          "manual_entry_required",
                          "discovery_failed"
                        ]
                      },
                      "message": {
                        "description": "A fixed message for the code.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Why the last model listing failed or was incomplete, as a stable code: auth_failed, rate_limited, unreachable, no_models_listed, manual_entry_required or discovery_failed (anything else). Provider error details are not returned; null when the last listing succeeded."
              },
              "last_success_at": {
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "listing_status": {
                "description": "Outcome of the last model listing. unrestricted: the provider has no model list, serves every model and is not reviewed.",
                "enum": [
                  "ok",
                  "partial",
                  "error",
                  "manual",
                  "unrestricted",
                  "not_checked"
                ]
              },
              "pending": {
                "items": {
                  "$ref": "#/components/schemas/ProviderModelReviewModel"
                },
                "type": "array"
              },
              "pending_count": {
                "type": "integer"
              },
              "provider_name": {
                "type": "string"
              },
              "rejected": {
                "items": {
                  "$ref": "#/components/schemas/ProviderModelReviewModel"
                },
                "type": "array"
              }
            },
            "required": [
              "label",
              "provider_name",
              "listing_status",
              "pending",
              "approved",
              "rejected"
            ],
            "type": "object"
          },
          "settings": {
            "$ref": "#/components/schemas/ProviderModelReviewSettings"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "ProviderModelReviewSettings": {
        "additionalProperties": true,
        "properties": {
          "background_checks": {
            "description": "Whether this deployment runs background checks at all; when false new models appear only after a check from the console.",
            "type": "boolean"
          },
          "check_interval_seconds": {
            "type": "integer"
          },
          "enabled": {
            "description": "The tenant's switch for background checks; off until an admin turns it on in the console.",
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "background_checks"
        ],
        "type": "object"
      },
      "ProviderPatch": {
        "additionalProperties": false,
        "description": "Shared-provider configuration. Saves never call the upstream; use the test and available-models operations to check settings.",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "label": {
            "description": "Tenant-unique display name; immutable.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "model_costs": {
            "additionalProperties": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/ModelCost"
                },
                {
                  "type": "null"
                }
              ]
            },
            "maxProperties": 1000,
            "type": "object"
          },
          "model_metadata": {
            "additionalProperties": {
              "additionalProperties": false,
              "properties": {
                "caching": {
                  "additionalProperties": false,
                  "properties": {
                    "min_cacheable_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "support": {
                      "enum": [
                        "supported",
                        "unsupported",
                        "conditional",
                        "unknown",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "supported_ttls": {
                      "items": {
                        "maxLength": 64,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 16,
                      "type": [
                        "array",
                        "null"
                      ],
                      "uniqueItems": true
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "capabilities": {
                  "additionalProperties": false,
                  "properties": {
                    "supports_json_mode": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_json_schema": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_parallel_tool_calls": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_streaming": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "supports_tool_calling": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "input_formats": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "input_modalities": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "lifecycle": {
                  "additionalProperties": false,
                  "properties": {
                    "retirement_date": {
                      "format": "date",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "enum": [
                        "unknown",
                        "preview",
                        "stable",
                        "deprecated",
                        "retired",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "limits": {
                  "additionalProperties": false,
                  "properties": {
                    "context_window_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_input_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_output_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_reasoning_tokens": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "output_formats": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "output_modalities": {
                  "items": {
                    "maxLength": 128,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 32,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "provenance": {
                  "additionalProperties": false,
                  "properties": {
                    "last_verified_at": {
                      "format": "date-time",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "enum": [
                        "manual",
                        "provider_api",
                        "catalog",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source_url": {
                      "maxLength": 2048,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updated_at": {
                      "format": "date-time",
                      "readOnly": true,
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "reasoning_tokens_in_output_budget": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "supported_reasoning_efforts": {
                  "items": {
                    "maxLength": 64,
                    "minLength": 1,
                    "type": "string"
                  },
                  "maxItems": 16,
                  "type": [
                    "array",
                    "null"
                  ],
                  "uniqueItems": true
                },
                "tags": {
                  "additionalProperties": {
                    "oneOf": [
                      {
                        "maxLength": 512,
                        "type": "string"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "number"
                      },
                      {
                        "items": {
                          "maxLength": 512,
                          "minLength": 1,
                          "type": "string"
                        },
                        "maxItems": 32,
                        "type": [
                          "array",
                          "null"
                        ],
                        "uniqueItems": true
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": "At most 64 active tags including the canonical identity preset, plus 1024 stored null clears. Null custom tags are hidden from public views; canonical_model:null resets the identity to its catalog default or model ID.",
                  "maxProperties": 1088,
                  "propertyNames": {
                    "maxLength": 64,
                    "minLength": 1,
                    "type": "string"
                  },
                  "type": [
                    "object",
                    "null"
                  ],
                  "x-maxActiveProperties": 64,
                  "x-maxNullProperties": 1024
                },
                "temperature": {
                  "additionalProperties": false,
                  "properties": {
                    "conditions": {
                      "maxLength": 1024,
                      "type": [
                        "string",
                        "null"
                      ],
                      "x-multiline": true
                    },
                    "default": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "max": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "min": {
                      "minimum": 0,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "support": {
                      "enum": [
                        "supported",
                        "unsupported",
                        "conditional",
                        "unknown",
                        null
                      ],
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "upstream_limits": {
                  "additionalProperties": false,
                  "properties": {
                    "input_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "max_inflight_requests": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "output_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "rpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "shared_quota_pool_ids": {
                      "items": {
                        "maxLength": 128,
                        "minLength": 1,
                        "type": "string"
                      },
                      "maxItems": 32,
                      "type": [
                        "array",
                        "null"
                      ],
                      "uniqueItems": true
                    },
                    "total_tpm": {
                      "maximum": 9007199254740991,
                      "minimum": 0,
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "type": [
                    "object",
                    "null"
                  ]
                }
              },
              "type": [
                "object",
                "null"
              ]
            },
            "description": "Model facts keyed by selected ID. Absent fields inherit compatible catalog defaults; nested nulls remain unknown. A null model item resets its saved overrides to the catalog.",
            "maxProperties": 1000,
            "propertyNames": {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            },
            "type": [
              "object",
              "null"
            ]
          },
          "model_metadata_reset": {
            "additionalProperties": {
              "items": {
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 64,
              "type": "array"
            },
            "description": "Dotted metadata paths per selected model whose stored override is removed, so the catalog default shows through again. Distinct from null (= unknown).",
            "maxProperties": 1000,
            "type": "object"
          },
          "provider_name": {
            "description": "Provider type; immutable.",
            "enum": [
              "openai",
              "azureopenai",
              "general",
              "anthropic",
              "anthropic_messages",
              "anthropic_messages_bedrock",
              "anthropic_messages_azure",
              "deepseek",
              "vertex_ai",
              "gemini_chatcompletions",
              "oracle",
              "openai_responses",
              "openai_responses_azure",
              "oracle_responses",
              "openai_assistants",
              "openai_assistants_azure",
              "openai_realtime",
              "openai_realtime_azure",
              "bedrock",
              "bedrock_embeddings",
              "cohere_rerank",
              "bedrock_rerank",
              "jina_rerank",
              "voyage_rerank",
              "general_rerank",
              "sarvam",
              "mistral",
              "xai",
              "xai_responses",
              "cerebras",
              "typesafe",
              "groq",
              "perplexity",
              "cohere"
            ],
            "type": "string"
          },
          "provider_settings": {
            "$ref": "#/components/schemas/ProviderSettingsUpdate"
          },
          "selected_models": {
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "tags": {
            "$ref": "#/components/schemas/ProviderTags"
          },
          "tags_reset": {
            "description": "Return provider tag presets to their derived/default values. geo is derived at read time from the region (us|eu|uk|ca|apac|jp|au|in|sa|me|global); tags.geo: null instead clears it to unknown and stops derivation. Reads add tag_sources {provider, models} naming each tag's source (derived|manual|catalog).",
            "items": {
              "enum": [
                "region",
                "service_tier",
                "geo"
              ]
            },
            "type": "array",
            "uniqueItems": true
          },
          "upstream_limits": {
            "$ref": "#/components/schemas/UpstreamLimits"
          }
        },
        "type": "object"
      },
      "ProviderResponse": {
        "additionalProperties": true,
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderView"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "ProviderSettings": {
        "additionalProperties": false,
        "description": "Settings for the chosen provider type; required credentials depend on it and are validated against the merged configuration. Secret values are never returned.",
        "properties": {
          "anthropic_version": {
            "description": "Anthropic API version header.",
            "type": "string"
          },
          "api_key": {
            "description": "Provider API key. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "auth_type": {
            "description": "Authentication mode for providers that support several.",
            "type": "string"
          },
          "aws_access_key": {
            "description": "Secret. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "aws_auth_mode": {
            "description": "static (access keys) or assume_role.",
            "type": "string"
          },
          "aws_bedrock_api_key": {
            "description": "Secret. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "aws_bedrock_chat_api": {
            "type": "string"
          },
          "aws_bedrock_endpoint": {
            "type": "string"
          },
          "aws_bedrock_openai_path": {
            "type": "string"
          },
          "aws_external_id": {
            "description": "Secret. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "aws_region": {
            "type": "string"
          },
          "aws_role_arn": {
            "type": "string"
          },
          "aws_role_session_name": {
            "type": "string"
          },
          "aws_secret_key": {
            "description": "Secret. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "aws_session_duration_seconds": {
            "description": "Assumed-role session length, 900-43200.",
            "maximum": 43200,
            "minimum": 900,
            "type": "integer"
          },
          "aws_session_token": {
            "description": "Secret. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "azure_api_version": {
            "description": "Azure API version.",
            "type": "string"
          },
          "azure_auth_header": {
            "description": "Azure providers: the header the key is sent in. Omit (or api-key) for api-key, authorization_bearer for 'Authorization: Bearer <key>', or a header name such as Ocp-Apim-Subscription-Key (the raw key is sent in it).",
            "type": "string"
          },
          "azure_endpoint": {
            "description": "Azure resource endpoint, or a custom API base ending in /deployments (e.g. an API Management route).",
            "type": "string"
          },
          "base_url": {
            "description": "Endpoint base URL for OpenAI-compatible and self-hosted providers.",
            "type": "string"
          },
          "gcp_project_id": {
            "type": "string"
          },
          "gcp_region": {
            "type": "string"
          },
          "gpu_connector_id": {
            "type": "string"
          },
          "oci_compartment_id": {
            "type": "string"
          },
          "oci_fingerprint": {
            "type": "string"
          },
          "oci_private_key": {
            "description": "Secret. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "oci_private_key_passphrase": {
            "description": "Secret. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "oci_project_id": {
            "type": "string"
          },
          "oci_region": {
            "type": "string"
          },
          "oci_session_token": {
            "description": "Secret. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "oci_tenancy_id": {
            "type": "string"
          },
          "oci_user_id": {
            "type": "string"
          },
          "preferred_upstream_api": {
            "description": "Prefer another endpoint of the client's API family.",
            "type": "string"
          },
          "remote_connector_id": {
            "type": "string"
          },
          "service_account_json": {
            "description": "JSON-encoded Google service account document. Write-only.",
            "minLength": 1,
            "type": "string",
            "writeOnly": true
          },
          "upstream_apis": {
            "description": "Other wire APIs this upstream also serves.",
            "items": {
              "type": "string"
            },
            "maxItems": 16,
            "type": "array"
          },
          "use_outbound_ips": {
            "description": "This provider's own Quilr outbound IP setting: a region code calls it from that region's outbound IPs (listed by GET /outbound-ips), true from the account's region, false calls it directly, null or omitted follows the account-wide setting (/outbound-ips). Refused for a provider linked to a connector, and for one whose endpoint is not a public host over https on port 443.",
            "enum": [
              true,
              false,
              "us",
              "eu",
              "in",
              null
            ],
            "type": [
              "boolean",
              "string",
              "null"
            ]
          }
        },
        "type": "object",
        "writeOnly": true
      },
      "ProviderSettingsUpdate": {
        "additionalProperties": false,
        "description": "Settings for the chosen provider type; required credentials depend on it and are validated against the merged configuration. Secret values are never returned.",
        "properties": {
          "anthropic_version": {
            "description": "Anthropic API version header.",
            "type": "string"
          },
          "api_key": {
            "description": "Provider API key. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "auth_type": {
            "description": "Authentication mode for providers that support several.",
            "type": "string"
          },
          "aws_access_key": {
            "description": "Secret. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "aws_auth_mode": {
            "description": "static (access keys) or assume_role.",
            "type": "string"
          },
          "aws_bedrock_api_key": {
            "description": "Secret. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "aws_bedrock_chat_api": {
            "type": "string"
          },
          "aws_bedrock_endpoint": {
            "type": "string"
          },
          "aws_bedrock_openai_path": {
            "type": "string"
          },
          "aws_external_id": {
            "description": "Secret. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "aws_region": {
            "type": "string"
          },
          "aws_role_arn": {
            "type": "string"
          },
          "aws_role_session_name": {
            "type": "string"
          },
          "aws_secret_key": {
            "description": "Secret. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "aws_session_duration_seconds": {
            "description": "Assumed-role session length, 900-43200.",
            "maximum": 43200,
            "minimum": 900,
            "type": "integer"
          },
          "aws_session_token": {
            "description": "Secret. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "azure_api_version": {
            "description": "Azure API version.",
            "type": "string"
          },
          "azure_auth_header": {
            "description": "Azure providers: the header the key is sent in. Omit (or api-key) for api-key, authorization_bearer for 'Authorization: Bearer <key>', or a header name such as Ocp-Apim-Subscription-Key (the raw key is sent in it).",
            "type": "string"
          },
          "azure_endpoint": {
            "description": "Azure resource endpoint, or a custom API base ending in /deployments (e.g. an API Management route).",
            "type": "string"
          },
          "base_url": {
            "description": "Endpoint base URL for OpenAI-compatible and self-hosted providers.",
            "type": "string"
          },
          "gcp_project_id": {
            "type": "string"
          },
          "gcp_region": {
            "type": "string"
          },
          "gpu_connector_id": {
            "type": "string"
          },
          "oci_compartment_id": {
            "type": "string"
          },
          "oci_fingerprint": {
            "type": "string"
          },
          "oci_private_key": {
            "description": "Secret. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "oci_private_key_passphrase": {
            "description": "Secret. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "oci_project_id": {
            "type": "string"
          },
          "oci_region": {
            "type": "string"
          },
          "oci_session_token": {
            "description": "Secret. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "oci_tenancy_id": {
            "type": "string"
          },
          "oci_user_id": {
            "type": "string"
          },
          "preferred_upstream_api": {
            "description": "Prefer another endpoint of the client's API family.",
            "type": "string"
          },
          "remote_connector_id": {
            "type": "string"
          },
          "service_account_json": {
            "description": "JSON-encoded Google service account document. Write-only; omit or send an empty string to keep the stored value.",
            "type": "string",
            "writeOnly": true
          },
          "upstream_apis": {
            "description": "Other wire APIs this upstream also serves.",
            "items": {
              "type": "string"
            },
            "maxItems": 16,
            "type": "array"
          },
          "use_outbound_ips": {
            "description": "This provider's own Quilr outbound IP setting: a region code calls it from that region's outbound IPs (listed by GET /outbound-ips), true from the account's region, false calls it directly, null or omitted follows the account-wide setting (/outbound-ips). Refused for a provider linked to a connector, and for one whose endpoint is not a public host over https on port 443.",
            "enum": [
              true,
              false,
              "us",
              "eu",
              "in",
              null
            ],
            "type": [
              "boolean",
              "string",
              "null"
            ]
          }
        },
        "type": "object",
        "writeOnly": true
      },
      "ProviderTags": {
        "additionalProperties": {
          "oneOf": [
            {
              "maxLength": 512,
              "type": "string"
            },
            {
              "type": "boolean"
            },
            {
              "type": "number"
            },
            {
              "items": {
                "maxLength": 512,
                "minLength": 1,
                "type": "string"
              },
              "maxItems": 32,
              "type": [
                "array",
                "null"
              ],
              "uniqueItems": true
            },
            {
              "type": "null"
            }
          ]
        },
        "maxProperties": 64,
        "propertyNames": {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        "type": [
          "object",
          "null"
        ]
      },
      "ProviderTest": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "enum": [
              "connection",
              "model"
            ]
          },
          "model": {
            "description": "A selected model; required for kind model.",
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "type": "object"
      },
      "ProviderTestResult": {
        "additionalProperties": true,
        "properties": {
          "test": {
            "additionalProperties": true,
            "properties": {
              "code": {
                "type": "string"
              },
              "completed_at": {
                "description": "Unix epoch seconds, potentially fractional.",
                "type": "number"
              },
              "configuration_version": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "connection",
                  "model"
                ],
                "type": "string"
              },
              "latency_ms": {
                "type": "number"
              },
              "message": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "model": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "models": {
                "description": "Connection tests: one probe per selected model.",
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "latency_ms": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "model": {
                      "type": "string"
                    },
                    "outcome": {
                      "enum": [
                        "passed",
                        "failed",
                        "unsupported"
                      ],
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "models_truncated": {
                "type": "boolean"
              },
              "outcome": {
                "enum": [
                  "passed",
                  "failed",
                  "unsupported"
                ],
                "type": "string"
              },
              "warnings": {
                "description": "model_deprecated when a probe message says the provider deprecated or retired a model.",
                "items": {
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "kind",
              "outcome",
              "code"
            ],
            "type": "object"
          }
        },
        "required": [
          "test"
        ],
        "type": "object"
      },
      "ProviderTestSettings": {
        "additionalProperties": false,
        "properties": {
          "models": {
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 10,
            "type": "array",
            "uniqueItems": true
          },
          "provider_settings": {
            "description": "Draft settings, validated like a provider save. On a stored provider they merge onto the saved settings; a blank secret keeps the stored value. Never persisted.",
            "propertyNames": {
              "enum": [
                "anthropic_version",
                "api_key",
                "auth_type",
                "aws_access_key",
                "aws_auth_mode",
                "aws_bedrock_api_key",
                "aws_bedrock_chat_api",
                "aws_bedrock_endpoint",
                "aws_bedrock_openai_path",
                "aws_external_id",
                "aws_region",
                "aws_role_arn",
                "aws_role_session_name",
                "aws_secret_key",
                "aws_session_duration_seconds",
                "aws_session_token",
                "azure_api_version",
                "azure_auth_header",
                "azure_endpoint",
                "base_url",
                "gcp_project_id",
                "gcp_region",
                "gpu_connector_id",
                "oci_compartment_id",
                "oci_fingerprint",
                "oci_private_key",
                "oci_private_key_passphrase",
                "oci_project_id",
                "oci_region",
                "oci_session_token",
                "oci_tenancy_id",
                "oci_user_id",
                "preferred_upstream_api",
                "remote_connector_id",
                "service_account_json",
                "upstream_apis"
              ]
            },
            "type": "object",
            "writeOnly": true
          }
        },
        "type": "object"
      },
      "ProviderTestSettingsResult": {
        "additionalProperties": false,
        "properties": {
          "request_id": {
            "type": "string"
          },
          "test": {
            "additionalProperties": false,
            "properties": {
              "based_on_version": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "completed_at": {
                "type": "number"
              },
              "connection": {
                "additionalProperties": false,
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "latency_ms": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "message": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "outcome": {
                    "enum": [
                      "passed",
                      "failed",
                      "timeout",
                      "skipped",
                      "unsupported"
                    ]
                  }
                },
                "type": "object"
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "models": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "latency_ms": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "model": {
                      "type": "string"
                    },
                    "outcome": {
                      "enum": [
                        "passed",
                        "failed",
                        "timeout",
                        "skipped",
                        "unsupported"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "models_truncated": {
                "type": "boolean"
              },
              "provider_name": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ProviderView": {
        "additionalProperties": true,
        "properties": {
          "configured_secret_fields": {
            "description": "Names of stored secret settings; values are never returned.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "connection": {
            "description": "Non-secret connection details (endpoint host, region, API version).",
            "type": "object"
          },
          "credential_configured": {
            "type": "boolean"
          },
          "credentials_updated_at": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "is_active": {
            "description": "false once deleted.",
            "type": "boolean"
          },
          "label": {
            "type": "string"
          },
          "model_costs": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "type": "object"
          },
          "model_metadata": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelMetadata"
            },
            "type": "object"
          },
          "provider_id": {
            "type": "string"
          },
          "provider_name": {
            "enum": [
              "openai",
              "azureopenai",
              "general",
              "anthropic",
              "anthropic_messages",
              "anthropic_messages_bedrock",
              "anthropic_messages_azure",
              "deepseek",
              "vertex_ai",
              "gemini_chatcompletions",
              "oracle",
              "openai_responses",
              "openai_responses_azure",
              "oracle_responses",
              "openai_assistants",
              "openai_assistants_azure",
              "openai_realtime",
              "openai_realtime_azure",
              "bedrock",
              "bedrock_embeddings",
              "cohere_rerank",
              "bedrock_rerank",
              "jina_rerank",
              "voyage_rerank",
              "general_rerank",
              "sarvam",
              "mistral",
              "xai",
              "xai_responses",
              "cerebras",
              "typesafe",
              "groq",
              "perplexity",
              "cohere"
            ],
            "type": "string"
          },
          "selected_models": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tags": {
            "$ref": "#/components/schemas/ProviderTags"
          },
          "upstream_limits": {
            "$ref": "#/components/schemas/UpstreamLimits"
          },
          "version": {
            "description": "Opaque resource version. Send its quoted value in If-Match.",
            "type": "string"
          }
        },
        "required": [
          "label",
          "provider_name",
          "version",
          "credential_configured"
        ],
        "type": "object"
      },
      "QuotaPool": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "maxLength": 1000,
            "type": [
              "string",
              "null"
            ]
          },
          "last_verified_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "limits": {
            "$ref": "#/components/schemas/QuotaPoolLimits"
          },
          "members": {
            "$ref": "#/components/schemas/QuotaPoolMembers"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "pool_id": {
            "description": "Immutable. A new id must match ^[a-z0-9][a-z0-9._:-]{0,127}$; an unregistered legacy id already referenced by a provider may be adopted verbatim (no control characters, '/' or surrounding whitespace), so stored ids need not match.",
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "source": {
            "default": "manual",
            "enum": [
              "manual",
              "provider_docs",
              "provider_api"
            ]
          },
          "source_url": {
            "format": "uri",
            "maxLength": 2048,
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "description": "ETag value (quoted in the ETag header).",
            "type": "string"
          }
        },
        "required": [
          "pool_id",
          "name",
          "description",
          "limits",
          "source",
          "source_url",
          "last_verified_at",
          "created_at",
          "updated_at",
          "version",
          "members"
        ],
        "type": "object"
      },
      "QuotaPoolCreate": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "maxLength": 1000,
            "type": [
              "string",
              "null"
            ]
          },
          "last_verified_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "limits": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/QuotaPoolLimits"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "pool_id": {
            "description": "Immutable. A new id must match ^[a-z0-9][a-z0-9._:-]{0,127}$; an unregistered legacy id already referenced by a provider may be adopted verbatim (no control characters, '/' or surrounding whitespace), so stored ids need not match.",
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "source": {
            "default": "manual",
            "enum": [
              "manual",
              "provider_docs",
              "provider_api"
            ]
          },
          "source_url": {
            "format": "uri",
            "maxLength": 2048,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "pool_id",
          "name"
        ],
        "type": "object"
      },
      "QuotaPoolDeleted": {
        "properties": {
          "deleted": {
            "const": true
          },
          "detached": {
            "$ref": "#/components/schemas/QuotaPoolMembers"
          },
          "pool_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuotaPoolLimits": {
        "additionalProperties": false,
        "description": "Descriptive upstream ceilings; null = unknown (never 0). Omitted keys keep their value on PATCH.",
        "properties": {
          "input_tpm": {
            "maximum": 9007199254740991,
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "max_inflight_requests": {
            "maximum": 9007199254740991,
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "output_tpm": {
            "maximum": 9007199254740991,
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "rpd": {
            "maximum": 9007199254740991,
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "rpm": {
            "maximum": 9007199254740991,
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "total_tpm": {
            "maximum": 9007199254740991,
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "QuotaPoolList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/QuotaPool"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "unregistered": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "members": {
                  "$ref": "#/components/schemas/QuotaPoolMembers"
                },
                "pool_id": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "QuotaPoolMembers": {
        "additionalProperties": false,
        "properties": {
          "models": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "model": {
                  "type": "string"
                },
                "provider_label": {
                  "type": "string"
                }
              },
              "required": [
                "provider_label",
                "model"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "providers",
          "models"
        ],
        "type": "object"
      },
      "QuotaPoolPatch": {
        "additionalProperties": false,
        "properties": {
          "description": {
            "maxLength": 1000,
            "type": [
              "string",
              "null"
            ]
          },
          "last_verified_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "limits": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/QuotaPoolLimits"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "pool_id": {
            "description": "Immutable. A new id must match ^[a-z0-9][a-z0-9._:-]{0,127}$; an unregistered legacy id already referenced by a provider may be adopted verbatim (no control characters, '/' or surrounding whitespace), so stored ids need not match.",
            "maxLength": 128,
            "minLength": 1,
            "type": "string"
          },
          "source": {
            "default": "manual",
            "enum": [
              "manual",
              "provider_docs",
              "provider_api"
            ]
          },
          "source_url": {
            "format": "uri",
            "maxLength": 2048,
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "QuotaPoolResponse": {
        "properties": {
          "pool": {
            "$ref": "#/components/schemas/QuotaPool"
          }
        },
        "type": "object"
      },
      "RateLimit": {
        "additionalProperties": true,
        "description": "A count per duration; zero disables the limit.",
        "properties": {
          "duration": {
            "enum": [
              "minute",
              "hour",
              "day"
            ],
            "type": "string"
          },
          "value": {
            "description": "Maximum events in the window; 0 disables.",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "value",
          "duration"
        ],
        "type": "object"
      },
      "RateLimitGrant": {
        "properties": {
          "bucket": {
            "type": "string"
          },
          "etag": {
            "type": "string"
          },
          "expires_at": {
            "description": "null: no end date",
            "type": [
              "string",
              "null"
            ]
          },
          "extra": {
            "description": "Set only on an extra grant",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "limit": {
            "description": "Absolute, or base + extra for an extra grant (follows the base)",
            "type": "integer"
          },
          "quota_id": {
            "type": "string"
          },
          "rate_limit_id": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "description": "active (in effect now), scheduled (starts later), expired, revoked or superseded",
            "type": "string"
          },
          "subject": {
            "additionalProperties": false,
            "description": "The bucket owner, one value per group_by field (aliases user, app, smart_group, key_id, model), or {bucket}.",
            "minProperties": 1,
            "properties": {
              "app": {
                "type": "string"
              },
              "bucket": {
                "type": "string"
              },
              "key_id": {
                "type": "string"
              },
              "members_of": {
                "type": "string"
              },
              "method": {
                "type": "string"
              },
              "method_type": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "provider": {
                "type": "string"
              },
              "provider_label": {
                "type": "string"
              },
              "smart_group": {
                "type": "string"
              },
              "tenant": {
                "type": "string"
              },
              "user": {
                "type": "string"
              },
              "user_id": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "RateLimitGrantCreate": {
        "additionalProperties": false,
        "description": "A temporary raise for one bucket, capped by the rate limit's adjustments. A new grant supersedes only the bucket's grants whose time range overlaps its own; others stay. POST takes an Idempotency-Key; a retry returns the original grant.",
        "example": {
          "expires_at": "2026-11-03T00:00:00Z",
          "extra": 300,
          "reason": "launch week",
          "subject": {
            "user": "alex@example.com"
          }
        },
        "oneOf": [
          {
            "required": [
              "extra"
            ]
          },
          {
            "required": [
              "limit"
            ]
          }
        ],
        "properties": {
          "expires_at": {
            "description": "Required unless the rate limit's adjustments.max_duration is \"unlimited\"; null or omitted then means no end date.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "extra": {
            "description": "Added to the base limit; the grant follows the base (a later base change moves it).",
            "minimum": 0,
            "type": "integer"
          },
          "limit": {
            "description": "Absolute limit.",
            "minimum": 0,
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "starts_at": {
            "format": "date-time",
            "type": "string"
          },
          "subject": {
            "additionalProperties": false,
            "description": "The bucket owner, one value per group_by field (aliases user, app, smart_group, key_id, model), or {bucket}.",
            "minProperties": 1,
            "properties": {
              "app": {
                "type": "string"
              },
              "bucket": {
                "type": "string"
              },
              "key_id": {
                "type": "string"
              },
              "members_of": {
                "type": "string"
              },
              "method": {
                "type": "string"
              },
              "method_type": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "provider": {
                "type": "string"
              },
              "provider_label": {
                "type": "string"
              },
              "smart_group": {
                "type": "string"
              },
              "tenant": {
                "type": "string"
              },
              "user": {
                "type": "string"
              },
              "user_id": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "required": [
          "subject"
        ],
        "type": "object"
      },
      "RateLimitGrantList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "bucket": {
                  "type": "string"
                },
                "etag": {
                  "type": "string"
                },
                "expires_at": {
                  "description": "null: no end date",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "extra": {
                  "description": "Set only on an extra grant",
                  "type": "integer"
                },
                "id": {
                  "type": "string"
                },
                "limit": {
                  "description": "Absolute, or base + extra for an extra grant (follows the base)",
                  "type": "integer"
                },
                "quota_id": {
                  "type": "string"
                },
                "rate_limit_id": {
                  "type": "string"
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "description": "active (in effect now), scheduled (starts later), expired, revoked or superseded",
                  "type": "string"
                },
                "subject": {
                  "additionalProperties": false,
                  "description": "The bucket owner, one value per group_by field (aliases user, app, smart_group, key_id, model), or {bucket}.",
                  "minProperties": 1,
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "bucket": {
                      "type": "string"
                    },
                    "key_id": {
                      "type": "string"
                    },
                    "members_of": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string"
                    },
                    "method_type": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "provider_label": {
                      "type": "string"
                    },
                    "smart_group": {
                      "type": "string"
                    },
                    "tenant": {
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    },
                    "user_id": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "RateLimitGrantResult": {
        "properties": {
          "etag": {
            "type": [
              "string",
              "null"
            ]
          },
          "grant": {
            "properties": {
              "bucket": {
                "type": "string"
              },
              "etag": {
                "type": "string"
              },
              "expires_at": {
                "description": "null: no end date",
                "type": [
                  "string",
                  "null"
                ]
              },
              "extra": {
                "description": "Set only on an extra grant",
                "type": "integer"
              },
              "id": {
                "type": "string"
              },
              "limit": {
                "description": "Absolute, or base + extra for an extra grant (follows the base)",
                "type": "integer"
              },
              "quota_id": {
                "type": "string"
              },
              "rate_limit_id": {
                "type": "string"
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "description": "active (in effect now), scheduled (starts later), expired, revoked or superseded",
                "type": "string"
              },
              "subject": {
                "additionalProperties": false,
                "description": "The bucket owner, one value per group_by field (aliases user, app, smart_group, key_id, model), or {bucket}.",
                "minProperties": 1,
                "properties": {
                  "app": {
                    "type": "string"
                  },
                  "bucket": {
                    "type": "string"
                  },
                  "key_id": {
                    "type": "string"
                  },
                  "members_of": {
                    "type": "string"
                  },
                  "method": {
                    "type": "string"
                  },
                  "method_type": {
                    "type": "string"
                  },
                  "model": {
                    "type": "string"
                  },
                  "provider": {
                    "type": "string"
                  },
                  "provider_label": {
                    "type": "string"
                  },
                  "smart_group": {
                    "type": "string"
                  },
                  "tenant": {
                    "type": "string"
                  },
                  "user": {
                    "type": "string"
                  },
                  "user_id": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "superseded": {
            "oneOf": [
              {
                "properties": {
                  "bucket": {
                    "type": "string"
                  },
                  "etag": {
                    "type": "string"
                  },
                  "expires_at": {
                    "description": "null: no end date",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "extra": {
                    "description": "Set only on an extra grant",
                    "type": "integer"
                  },
                  "id": {
                    "type": "string"
                  },
                  "limit": {
                    "description": "Absolute, or base + extra for an extra grant (follows the base)",
                    "type": "integer"
                  },
                  "quota_id": {
                    "type": "string"
                  },
                  "rate_limit_id": {
                    "type": "string"
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "description": "active (in effect now), scheduled (starts later), expired, revoked or superseded",
                    "type": "string"
                  },
                  "subject": {
                    "additionalProperties": false,
                    "description": "The bucket owner, one value per group_by field (aliases user, app, smart_group, key_id, model), or {bucket}.",
                    "minProperties": 1,
                    "properties": {
                      "app": {
                        "type": "string"
                      },
                      "bucket": {
                        "type": "string"
                      },
                      "key_id": {
                        "type": "string"
                      },
                      "members_of": {
                        "type": "string"
                      },
                      "method": {
                        "type": "string"
                      },
                      "method_type": {
                        "type": "string"
                      },
                      "model": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string"
                      },
                      "provider_label": {
                        "type": "string"
                      },
                      "smart_group": {
                        "type": "string"
                      },
                      "tenant": {
                        "type": "string"
                      },
                      "user": {
                        "type": "string"
                      },
                      "user_id": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "RateLimitUsage": {
        "properties": {
          "buckets": {
            "items": {
              "properties": {
                "base_limit": {
                  "type": "integer"
                },
                "bucket": {
                  "type": "string"
                },
                "grant": {
                  "type": "object"
                },
                "limit": {
                  "type": "integer"
                },
                "remaining": {
                  "type": "integer"
                },
                "reset_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "subject": {
                  "type": "object"
                },
                "used": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "group_by": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "metric": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "observed_at": {
            "type": "string"
          },
          "quota_id": {
            "type": "string"
          },
          "rate_limit_id": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "scope": {
            "description": "Counter scope (regional when the shared counter store is on).",
            "type": "string"
          },
          "window": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "RecoverResult": {
        "additionalProperties": true,
        "description": "A recovered app write returns the saved app; an already complete operation returns only operation_id and state.",
        "properties": {
          "app": {
            "$ref": "#/components/schemas/AppView"
          },
          "operation_id": {
            "type": "string"
          },
          "state": {
            "enum": [
              "complete"
            ],
            "type": "string"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/Warning"
            },
            "type": "array"
          }
        },
        "required": [
          "operation_id",
          "state"
        ],
        "type": "object"
      },
      "RequestExplanation": {
        "additionalProperties": true,
        "properties": {
          "failover": {
            "additionalProperties": true,
            "properties": {
              "attempts": {
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "duration_ms": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "failure_class": {
                      "description": "Why the attempt failed, in the classes GET /provider-health reports: rate_limited (429 rate limits), timeout_or_connection (timeouts and unreachable upstreams), upstream_5xx (other provider server errors), auth_or_permission (401 and 403), client_4xx (other 4xx: invalid request, unknown model, context length, content filter) or other.",
                      "enum": [
                        "rate_limited",
                        "timeout_or_connection",
                        "upstream_5xx",
                        "auth_or_permission",
                        "client_4xx",
                        "other"
                      ]
                    },
                    "index": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "kind": {
                      "description": "What the send returned or was: response, stream, cache_hit (answered from the response cache, nothing sent), or a same-target follow-up send: adaptation (resent with parameters the model accepts), format_retry (resent in another API format), agent_check_retry (resent after an agent check). Absent on attempts that failed or were skipped.",
                      "enum": [
                        "response",
                        "stream",
                        "cache_hit",
                        "adaptation",
                        "format_retry",
                        "agent_check_retry",
                        "other"
                      ]
                    },
                    "model": {
                      "type": "string"
                    },
                    "outcome": {
                      "description": "served, retry (sent again to the same target), failover (moved to another target), final_error (the last attempt failed), skipped (not sent: see skip_reason), cancelled (the client went away), or a follow-up send kind (adaptation, format_retry, agent_check_retry).",
                      "enum": [
                        "served",
                        "retry",
                        "failover",
                        "final_error",
                        "skipped",
                        "cancelled",
                        "adaptation",
                        "format_retry",
                        "agent_check_retry",
                        "other"
                      ]
                    },
                    "provider_label": {
                      "type": "string"
                    },
                    "provider_type": {
                      "type": "string"
                    },
                    "retry_number": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "skip_reason": {
                      "type": "string"
                    },
                    "status_code": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "tier": {
                      "description": "Candidate tier: first (the routed target), route (another member of the route), fallback (an explicit fallback), same_model (the same model on another provider), app (another app target), or other.",
                      "enum": [
                        "first",
                        "route",
                        "fallback",
                        "same_model",
                        "app",
                        "other"
                      ]
                    },
                    "trigger": {
                      "description": "The failover trigger the failure matched (the values a failover profile's on lists), more specific than failure_class.",
                      "enum": [
                        "rate_limit",
                        "timeout",
                        "connection",
                        "server_error",
                        "auth",
                        "model_not_found",
                        "context_length",
                        "content_filter",
                        "other"
                      ]
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "configured_by": {
                "enum": [
                  "policy",
                  "app",
                  "default",
                  "operator_disabled"
                ]
              },
              "exhausted": {
                "type": "boolean"
              },
              "failovers": {
                "minimum": 0,
                "type": "integer"
              },
              "retries": {
                "minimum": 0,
                "type": "integer"
              },
              "sends": {
                "minimum": 0,
                "type": "integer"
              },
              "served_tier": {
                "description": "Tier of the attempt that served the request.",
                "enum": [
                  "first",
                  "route",
                  "fallback",
                  "same_model",
                  "app",
                  "other"
                ]
              }
            },
            "type": "object"
          },
          "gateway_request_id": {
            "description": "The explained request (its x-quilr-request-id). The top-level request_id identifies this management call.",
            "type": "string"
          },
          "guardrails": {
            "additionalProperties": true,
            "description": "Detection categories and actions per direction. Detected values are never returned.",
            "properties": {
              "agent_checks": {
                "additionalProperties": true,
                "properties": {
                  "advisories": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "finding_types": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "nudged": {
                    "type": "boolean"
                  },
                  "request_blocked": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "outcome": {
                "enum": [
                  "blocked",
                  "redacted",
                  "monitored",
                  "none"
                ]
              },
              "request": {
                "additionalProperties": true,
                "properties": {
                  "actions": {
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "action": {
                          "enum": [
                            "blocked",
                            "redacted",
                            "monitored"
                          ]
                        },
                        "categories": {
                          "description": "The same category objects as GET /guardrails/summary.",
                          "items": {
                            "$ref": "#/components/schemas/GuardrailCategory"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "decided_by_rules": {
                    "items": {
                      "$ref": "#/components/schemas/ExplainRule"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              "response": {
                "additionalProperties": true,
                "properties": {
                  "actions": {
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "action": {
                          "enum": [
                            "blocked",
                            "redacted",
                            "monitored"
                          ]
                        },
                        "categories": {
                          "description": "The same category objects as GET /guardrails/summary.",
                          "items": {
                            "$ref": "#/components/schemas/GuardrailCategory"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "decided_by_rules": {
                    "items": {
                      "$ref": "#/components/schemas/ExplainRule"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              "risk_level": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "hooks": {
            "description": "External hooks that ran for the request, in order. A hook block is outcome blocked with request_error.code external_hook_blocked.",
            "items": {
              "additionalProperties": true,
              "properties": {
                "applied": {
                  "description": "What the gateway applied (observe mode: allow).",
                  "enum": [
                    "allow",
                    "flag",
                    "block",
                    "other"
                  ]
                },
                "decision": {
                  "description": "What the hook answered (on_failure on a failure).",
                  "enum": [
                    "allow",
                    "flag",
                    "block",
                    "other"
                  ]
                },
                "error_code": {
                  "type": "string"
                },
                "hook_id": {
                  "type": "string"
                },
                "http_status": {
                  "minimum": 0,
                  "type": "integer"
                },
                "latency_ms": {
                  "type": "number"
                },
                "mode": {
                  "enum": [
                    "enforce",
                    "observe",
                    "other"
                  ]
                },
                "stage": {
                  "enum": [
                    "pre_call",
                    "post_call",
                    "on_complete",
                    "other"
                  ]
                },
                "status": {
                  "description": "ok, failed_open / failed_closed (the hook failed and on_failure applied), skipped.",
                  "enum": [
                    "ok",
                    "failed_open",
                    "failed_closed",
                    "skipped",
                    "other"
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "limits": {
            "additionalProperties": true,
            "properties": {
              "budget_evaluation": {
                "description": "evaluated, or why budgets did not apply: exempt_route, policy_off, not_covered, exempt_rule.",
                "enum": [
                  "evaluated",
                  "exempt_route",
                  "policy_off",
                  "not_covered",
                  "exempt_rule",
                  "other"
                ]
              },
              "charge_status": {
                "description": "complete (charged), deferred (saved and applied shortly) or failed (could not be charged).",
                "enum": [
                  "complete",
                  "deferred",
                  "failed",
                  "other"
                ]
              },
              "charges": {
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "budget_id": {
                      "type": "string"
                    },
                    "charged": {
                      "additionalProperties": true,
                      "properties": {
                        "input_tokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "output_tokens": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "requests": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "spend_usd": {
                          "type": "number"
                        },
                        "total_tokens": {
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "limit_type": {
                      "enum": [
                        "budget",
                        "rate",
                        "other"
                      ]
                    },
                    "mode": {
                      "description": "enforce (refuses requests over the limit), alert (tracked and alerted without refusing) or paused.",
                      "enum": [
                        "enforce",
                        "alert",
                        "paused",
                        "other"
                      ]
                    },
                    "over_limit": {
                      "type": "boolean"
                    },
                    "window": {
                      "description": "The budget window charged, such as calendar:month:2026-11-01T00:00:00Z.",
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "rejection": {
                "additionalProperties": true,
                "properties": {
                  "budget_id": {
                    "type": "string"
                  },
                  "budget_ids": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "check": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "kind": {
                    "enum": [
                      "limit",
                      "preflight"
                    ]
                  },
                  "limit_type": {
                    "description": "budget (spend or token budget), rate (rate limit) or per_request (a request guard or model limit on one request's tokens).",
                    "enum": [
                      "budget",
                      "rate",
                      "per_request",
                      "other"
                    ]
                  },
                  "metric": {
                    "type": "string"
                  },
                  "rule": {
                    "$ref": "#/components/schemas/ExplainRule"
                  },
                  "window": {
                    "additionalProperties": true,
                    "properties": {
                      "kind": {
                        "enum": [
                          "calendar",
                          "rolling",
                          "lifetime",
                          "other"
                        ]
                      },
                      "size": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "unit": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "request_error": {
            "additionalProperties": true,
            "description": "Error code and whether a friendly error message replaced the original message. Original provider messages are never returned.",
            "properties": {
              "code": {
                "type": "string"
              },
              "failure_class": {
                "description": "The failure class of a provider error, as on attempts.",
                "enum": [
                  "rate_limited",
                  "timeout_or_connection",
                  "upstream_5xx",
                  "auth_or_permission",
                  "client_4xx",
                  "other"
                ]
              },
              "friendly_message": {
                "additionalProperties": true,
                "properties": {
                  "mapping_id": {
                    "type": "string"
                  },
                  "policy": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              },
              "friendly_message_applied": {
                "type": "boolean"
              },
              "in_stream": {
                "type": "boolean"
              },
              "raised_by": {
                "enum": [
                  "gateway",
                  "provider"
                ]
              },
              "status_code": {
                "minimum": 0,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "routing": {
            "additionalProperties": true,
            "properties": {
              "candidates_skipped": {
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "model": {
                      "type": "string"
                    },
                    "provider_label": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "constraints": {
                "additionalProperties": true,
                "properties": {
                  "excluded": {
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "key": {
                          "description": "The constraint key that excluded the target; never a tag value.",
                          "type": "string"
                        },
                        "model": {
                          "type": "string"
                        },
                        "provider_label": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "outcome": {
                    "enum": [
                      "ok",
                      "unsatisfied",
                      "check_unavailable",
                      "state_bound_conflict"
                    ]
                  },
                  "rules": {
                    "items": {
                      "$ref": "#/components/schemas/ExplainRule"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              "content": {
                "additionalProperties": true,
                "description": "Content-based routing verdicts. Never includes message text.",
                "properties": {
                  "classification": {
                    "additionalProperties": true,
                    "properties": {
                      "complexity": {
                        "type": "string"
                      },
                      "reused": {
                        "type": "boolean"
                      },
                      "status": {
                        "type": "string"
                      },
                      "topics_matched": {
                        "minimum": 0,
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "complexity": {
                    "additionalProperties": true,
                    "properties": {
                      "current_level": {
                        "type": "string"
                      },
                      "effective_level": {
                        "type": "string"
                      },
                      "escalated": {
                        "type": "boolean"
                      },
                      "stored_level": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "conversation_route": {
                    "additionalProperties": true,
                    "properties": {
                      "frozen": {
                        "type": "boolean"
                      },
                      "kept": {
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  },
                  "data_route": {
                    "additionalProperties": true,
                    "properties": {
                      "applied": {
                        "type": "boolean"
                      },
                      "data_types": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "matched": {
                        "type": "boolean"
                      },
                      "rule": {
                        "$ref": "#/components/schemas/ExplainRule"
                      },
                      "scan_status": {
                        "type": "string"
                      },
                      "sticky": {
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "fallback_reason": {
                "type": "string"
              },
              "observe_only": {
                "items": {
                  "$ref": "#/components/schemas/ExplainRule"
                },
                "type": "array"
              },
              "route_id": {
                "type": "string"
              },
              "routing_group": {
                "type": "string"
              },
              "rule": {
                "$ref": "#/components/schemas/ExplainRule"
              },
              "session": {
                "additionalProperties": true,
                "description": "Conversation pinning: whether an earlier routing decision was reused.",
                "properties": {
                  "age_seconds": {
                    "type": "number"
                  },
                  "invalid_reason": {
                    "type": "string"
                  },
                  "key_source": {
                    "description": "What identified the conversation: previous_response_id, conversation_id (a conversation id header or field), client_session_id (a session, thread or run id the client sent), prompt_cache_key, or conversation_prefix (derived from the start of the conversation).",
                    "enum": [
                      "previous_response_id",
                      "conversation_id",
                      "client_session_id",
                      "prompt_cache_key",
                      "conversation_prefix"
                    ]
                  },
                  "pin_kind": {
                    "description": "failover: the pin moved to this target after a failover. Absent for a normal routing pin.",
                    "enum": [
                      "failover",
                      "other"
                    ]
                  },
                  "pin_target": {
                    "type": "string"
                  },
                  "pinned": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "source": {
                "enum": [
                  "policy_rule",
                  "routing_group",
                  "route_targets",
                  "default",
                  "provider_model_list"
                ]
              },
              "upstream": {
                "additionalProperties": true,
                "properties": {
                  "client_api": {
                    "type": "string"
                  },
                  "fields_dropped": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "mode": {
                    "description": "native (the provider's own API for this format), endpoint_switch (another endpoint of the same provider), adapter (a built-in provider adapter), translate (converted between API formats) or unsupported.",
                    "enum": [
                      "native",
                      "endpoint_switch",
                      "adapter",
                      "translate",
                      "unsupported",
                      "other"
                    ]
                  },
                  "upstream_api": {
                    "type": "string"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "summary": {
            "additionalProperties": true,
            "properties": {
              "app": {
                "type": "string"
              },
              "cost": {
                "additionalProperties": true,
                "properties": {
                  "status": {
                    "description": "priced, partial (some usage had no price) or unpriced.",
                    "enum": [
                      "priced",
                      "partial",
                      "unpriced",
                      "other"
                    ]
                  },
                  "usd": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "type": "object"
              },
              "endpoint": {
                "type": "string"
              },
              "latency_ms": {
                "additionalProperties": true,
                "properties": {
                  "first_token": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "guardrails": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "total": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "upstream": {
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "outcome": {
                "description": "served; blocked (by a guardrail or policy); rate_limited (a gateway rate or token limit); quota_refused (a budget or quota); rejected (a pre-flight policy or access check, or a request over a per-request token limit); error (the provider or gateway failed); client_cancelled (the client disconnected).",
                "enum": [
                  "served",
                  "blocked",
                  "rate_limited",
                  "quota_refused",
                  "rejected",
                  "error",
                  "client_cancelled"
                ]
              },
              "provider_label": {
                "type": "string"
              },
              "request_kind": {
                "description": "client: sent by your client. cache_refresh: one of the background cache-refresh requests the gateway sends to keep a provider prompt cache warm.",
                "enum": [
                  "client",
                  "cache_refresh"
                ]
              },
              "requested_model": {
                "type": "string"
              },
              "response_cache": {
                "additionalProperties": true,
                "properties": {
                  "age_seconds": {
                    "type": "number"
                  },
                  "not_stored": {
                    "description": "On a miss, why the response was not stored, e.g. external_hook_failed_open or dlp_unavailable (a check that did not complete).",
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "status": {
                    "description": "hit (answered from the cache), miss, or bypass (not looked up).",
                    "enum": [
                      "hit",
                      "miss",
                      "bypass",
                      "other"
                    ]
                  }
                },
                "type": "object"
              },
              "served_model": {
                "type": "string"
              },
              "status_code": {
                "minimum": 0,
                "type": "integer"
              },
              "stream": {
                "type": "boolean"
              },
              "surface": {
                "description": "API family of the request: chat_completions, completions, openai_responses, anthropic_messages, vertex_gemini, bedrock_runtime, embeddings, realtime, rerank, assistants, decisions, moderations, images, files, batches, videos, ocr, tts (speech), stt (transcription), sdk, copilot_studio, unknown, or other for a family added later.",
                "enum": [
                  "chat_completions",
                  "completions",
                  "openai_responses",
                  "anthropic_messages",
                  "vertex_gemini",
                  "bedrock_runtime",
                  "embeddings",
                  "realtime",
                  "rerank",
                  "assistants",
                  "decisions",
                  "moderations",
                  "images",
                  "files",
                  "batches",
                  "videos",
                  "ocr",
                  "tts",
                  "stt",
                  "sdk",
                  "copilot_studio",
                  "unknown",
                  "other"
                ],
                "type": "string"
              },
              "tokens": {
                "additionalProperties": true,
                "properties": {
                  "cache_read": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "cache_write": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "input": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "output": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "reasoning": {
                    "minimum": 0,
                    "type": "integer"
                  },
                  "source": {
                    "enum": [
                      "provider",
                      "estimated",
                      "mixed"
                    ]
                  }
                },
                "type": "object"
              },
              "user_email": {
                "description": "Present when the gateway recorded the caller's identity.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "timestamp": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "gateway_request_id",
          "summary",
          "guardrails"
        ],
        "type": "object"
      },
      "RequestList": {
        "properties": {
          "data_through": {
            "description": "Effective exclusive end of the data counted: the requested `to`, or the time of the read when `to` is omitted. Requests are written a few seconds to minutes after they finish, so the most recent ones can be missing.",
            "format": "date-time",
            "type": "string"
          },
          "filters": {
            "description": "The filters applied, as normalized.",
            "type": "object"
          },
          "from": {
            "description": "Inclusive start.",
            "format": "date-time",
            "type": "string"
          },
          "generated_at": {
            "description": "When the data behind this response was read from storage (UTC). Results are cached, so this can be up to 60 seconds before the response.",
            "format": "date-time",
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/RequestListItem"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next (older) page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "description": "Exclusive end; null for now.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "from",
          "to",
          "filters",
          "items",
          "next_cursor",
          "generated_at",
          "data_through"
        ],
        "type": "object"
      },
      "RequestListItem": {
        "properties": {
          "app": {
            "description": "App name.",
            "type": [
              "string",
              "null"
            ]
          },
          "cost_usd": {
            "description": "Recorded cost in USD; null when the request was not priced.",
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "error_code": {
            "description": "Error code of a failed or refused request; `other` when the stored code is not a plain identifier.",
            "type": [
              "string",
              "null"
            ]
          },
          "failover": {
            "properties": {
              "moved": {
                "description": "The request moved to another target.",
                "type": "boolean"
              },
              "sends": {
                "description": "Upstream sends, retries included.",
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "sends",
              "moved"
            ],
            "type": "object"
          },
          "guardrails": {
            "description": "Categories and actions only; detected values are never returned.",
            "properties": {
              "actions": {
                "items": {
                  "enum": [
                    "blocked",
                    "redacted",
                    "monitored"
                  ]
                },
                "type": "array"
              },
              "detections": {
                "items": {
                  "properties": {
                    "action": {
                      "enum": [
                        "blocked",
                        "redacted",
                        "monitored"
                      ]
                    },
                    "category": {
                      "$ref": "#/components/schemas/GuardrailCategory"
                    },
                    "direction": {
                      "enum": [
                        "request",
                        "response",
                        "unknown"
                      ]
                    }
                  },
                  "required": [
                    "category",
                    "action",
                    "direction"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "scanned": {
                "description": "Guardrails checked this request.",
                "type": "boolean"
              }
            },
            "required": [
              "scanned",
              "actions",
              "detections"
            ],
            "type": "object"
          },
          "key_id": {
            "description": "Id of the app gateway key used; null for other credentials and requests before key attribution.",
            "type": [
              "string",
              "null"
            ]
          },
          "latency": {
            "description": "Milliseconds; null when not recorded. time_to_first_token_ms is set for streams only.",
            "properties": {
              "gateway_overhead_ms": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "guardrails_ms": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "time_to_first_token_ms": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "total_ms": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "upstream_ms": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "total_ms",
              "upstream_ms",
              "gateway_overhead_ms",
              "guardrails_ms",
              "time_to_first_token_ms"
            ],
            "type": "object"
          },
          "links": {
            "properties": {
              "explain": {
                "description": "Path of this request's explanation.",
                "type": "string"
              }
            },
            "required": [
              "explain"
            ],
            "type": "object"
          },
          "model": {
            "description": "Model that served the request.",
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "description": "served, blocked (guardrails, access or hooks), error (status 400 or above) or rate_limited (rate limits and quotas).",
            "enum": [
              "served",
              "blocked",
              "error",
              "rate_limited"
            ]
          },
          "provider": {
            "description": "Provider name as configured (else the provider type).",
            "type": [
              "string",
              "null"
            ]
          },
          "provider_type": {
            "description": "Provider type, for example openai or anthropic.",
            "type": [
              "string",
              "null"
            ]
          },
          "request_id": {
            "description": "The x-quilr-request-id the client received.",
            "type": "string"
          },
          "requested_model": {
            "description": "Model the client asked for.",
            "type": [
              "string",
              "null"
            ]
          },
          "response_cache": {
            "description": "Gateway response cache: hit, miss, bypass; null when not used.",
            "enum": [
              "hit",
              "miss",
              "bypass",
              null
            ]
          },
          "status_code": {
            "description": "HTTP status returned to the client.",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "stream": {
            "type": "boolean"
          },
          "surface": {
            "description": "API surface, for example chat, responses or messages.",
            "type": [
              "string",
              "null"
            ]
          },
          "timestamp": {
            "description": "When the request arrived (UTC).",
            "format": "date-time",
            "type": "string"
          },
          "tokens": {
            "properties": {
              "cache_write": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "cached_input": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "input": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "output": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reasoning": {
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "input",
              "output",
              "cached_input",
              "cache_write",
              "reasoning"
            ],
            "type": "object"
          },
          "user": {
            "description": "User email; null without identity or after data retention removed it.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "request_id",
          "timestamp",
          "app",
          "key_id",
          "user",
          "requested_model",
          "model",
          "provider",
          "provider_type",
          "surface",
          "stream",
          "outcome",
          "status_code",
          "error_code",
          "latency",
          "tokens",
          "cost_usd",
          "response_cache",
          "failover",
          "guardrails",
          "links"
        ],
        "type": "object"
      },
      "ResponseCache": {
        "additionalProperties": false,
        "description": "Response cache for non-streaming requests. Partial updates merge. Under QuilrQL the policy decides enabled, match and similarity.",
        "properties": {
          "enabled": {
            "default": false,
            "type": "boolean"
          },
          "flush": {
            "description": "true discards every cached response of the app.",
            "type": "boolean",
            "writeOnly": true
          },
          "match": {
            "default": "exact",
            "description": "exact: same prompt after whitespace cleanup. normalized: also ignores case, repeated spaces, punctuation around words and a fixed set of filler words. semantic: also matches a reworded last user message (chat and Anthropic Messages). Exact and normalized repeats skip every guardrail; a reworded match is served only after request guardrails pass the new prompt and skips the model call and response guardrails. Semantic can answer for a different name, title, username or filename in templated prompts: use it for human-typed FAQ or helpdesk apps, not programmatic pipelines.",
            "enum": [
              "exact",
              "normalized",
              "semantic"
            ]
          },
          "max_size_mb": {
            "default": 32,
            "maximum": 1024,
            "minimum": 1,
            "type": "integer"
          },
          "scope": {
            "default": "app",
            "enum": [
              "app",
              "user"
            ]
          },
          "similarity": {
            "default": "narrow",
            "description": "How close a semantic match must be. Used only when match is semantic.",
            "enum": [
              "narrow",
              "balanced",
              "wider"
            ]
          },
          "ttl_seconds": {
            "default": 86400,
            "maximum": 604800,
            "minimum": 60,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RoutingEffective": {
        "properties": {
          "app": {
            "type": "string"
          },
          "candidates_after_constraints": {
            "type": [
              "array",
              "null"
            ]
          },
          "checksum": {
            "type": [
              "string",
              "null"
            ]
          },
          "constraints_applied": {
            "type": "object"
          },
          "destination": {
            "type": "object"
          },
          "failover": {
            "description": "The resolved failover config (candidate_scope repeats scope).",
            "type": [
              "object",
              "null"
            ]
          },
          "failover_owner": {
            "description": "Who supplied the failover config, from the same evaluation that picked the route.",
            "properties": {
              "kind": {
                "enum": [
                  "route",
                  "failover_rule",
                  "failover_default",
                  "console_rule",
                  "built_in_default",
                  "app",
                  "kill_switch"
                ]
              },
              "managed": {
                "type": "object"
              },
              "policy": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "priority": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "rank": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "rule_index": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "failover_walk": {
            "type": [
              "object",
              "null"
            ]
          },
          "health": {
            "properties": {
              "node": {
                "type": "string"
              },
              "scope": {
                "const": "this_node"
              }
            },
            "type": "object"
          },
          "mark_downs_applied": {
            "type": "array"
          },
          "observing": {
            "items": {
              "properties": {
                "managed": {
                  "properties": {
                    "collection": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "policy": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "priority": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "route_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "rule_index": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "source": {
                  "enum": [
                    "managed",
                    "console",
                    "default"
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "pin": {
            "type": "object"
          },
          "requested_model": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "description": "The policy revision the dry run evaluated.",
            "type": "integer"
          },
          "revision_current": {
            "type": "boolean"
          },
          "route": {
            "properties": {
              "managed": {
                "properties": {
                  "collection": {
                    "type": "string"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "policy": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "priority": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "rank": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "route_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "rule_index": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "source": {
                "enum": [
                  "managed",
                  "console",
                  "default"
                ]
              }
            },
            "type": "object"
          },
          "shadowed": {
            "description": "Rules that also matched but were outranked by the deciding rule.",
            "items": {
              "properties": {
                "managed": {
                  "properties": {
                    "collection": {
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "policy": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "priority": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "route_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "rule_index": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "source": {
                  "enum": [
                    "managed",
                    "console",
                    "default"
                  ]
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "surface": {
            "enum": [
              "chat_completion",
              "responses",
              "vertex_ai",
              "bedrock_runtime"
            ]
          }
        },
        "type": "object"
      },
      "RoutingGroup": {
        "additionalProperties": true,
        "description": "Weights sum to 100. Members may use a different API family; members that cannot serve a request are skipped for it and reported as non-blocking warnings on save. Request-count and token-based groups use separate lists.",
        "properties": {
          "group_kind": {
            "description": "Client API family the group serves.",
            "enum": [
              "chat_completion",
              "anthropic_messages",
              "vertex_ai",
              "responses",
              "realtime",
              "bedrock_runtime"
            ],
            "type": "string"
          },
          "group_name": {
            "type": "string"
          },
          "models": {
            "items": {
              "$ref": "#/components/schemas/RoutingModel"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "group_name",
          "models"
        ],
        "type": "object"
      },
      "RoutingModel": {
        "additionalProperties": true,
        "properties": {
          "credential_source": {
            "description": "Label of a shared provider attached to the app; inline credentials are not accepted.",
            "type": "string"
          },
          "model_name": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "weight": {
            "exclusiveMinimum": 0,
            "type": "number"
          }
        },
        "required": [
          "provider_name",
          "model_name",
          "weight"
        ],
        "type": "object"
      },
      "RoutingSummary": {
        "description": "The console routing summary.",
        "type": "object"
      },
      "RoutingTargetCheckRequest": {
        "properties": {
          "app_name": {
            "type": "string"
          },
          "client_apis": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "targets": {
            "items": {
              "properties": {
                "model": {
                  "type": "string"
                },
                "provider_label": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "maxItems": 200,
            "type": "array"
          }
        },
        "required": [
          "app_name",
          "targets"
        ],
        "type": "object"
      },
      "RoutingTargetCheckResponse": {
        "properties": {
          "app_name": {
            "type": "string"
          },
          "client_apis": {
            "type": "array"
          },
          "results": {
            "type": "array"
          }
        },
        "type": "object"
      },
      "RoutingTestRequest": {
        "properties": {
          "app": {
            "description": "App name (app_name is the deprecated spelling).",
            "type": "string"
          },
          "app_name": {
            "deprecated": true,
            "type": "string"
          },
          "body": {
            "type": "object"
          },
          "follow_ups": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "headers": {
            "type": "object"
          },
          "method_type": {
            "deprecated": true,
            "description": "Older name of surface; chat, responses, vertex and bedrock are accepted as aliases of the families.",
            "enum": [
              "chat",
              "responses",
              "vertex",
              "bedrock",
              "chat_completion",
              "anthropic_messages",
              "vertex_ai",
              "responses",
              "realtime",
              "bedrock_runtime"
            ]
          },
          "proposed": {
            "description": "{collection: {id: resource | null}} or the /controls/_batch list [{op: put|delete, collection, id, body}]: rendered in memory into a candidate source; never published.",
            "type": [
              "object",
              "array"
            ]
          },
          "simulate_failures": {
            "type": "array"
          },
          "simulate_route": {
            "type": "object"
          },
          "surface": {
            "description": "Route surface family. Aliases (deprecated): chat = chat_completion, responses = responses, vertex = vertex_ai, bedrock = bedrock_runtime.",
            "enum": [
              "chat_completion",
              "anthropic_messages",
              "vertex_ai",
              "responses",
              "realtime",
              "bedrock_runtime"
            ]
          },
          "user": {
            "type": "string"
          },
          "user_email": {
            "deprecated": true,
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "RoutingTestResponse": {
        "description": "The test-routing trace (turns, routes, selected destination) plus surface, revision and proposed {changes, warnings}.",
        "type": "object"
      },
      "SelfServiceAppOwners": {
        "additionalProperties": false,
        "properties": {
          "owners": {
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": "array"
          }
        },
        "required": [
          "owners"
        ],
        "type": "object"
      },
      "SelfServiceAppOwnersResult": {
        "additionalProperties": true,
        "properties": {
          "after": {
            "type": "object"
          },
          "app_name": {
            "type": "string"
          },
          "before": {
            "type": "object"
          },
          "owners": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "app_name",
          "owners"
        ],
        "type": "object"
      },
      "SelfServiceBlueprintEligibility": {
        "additionalProperties": true,
        "properties": {
          "apps": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "app_name": {
                  "description": "Your app's spelling, or as given when unknown.",
                  "type": "string"
                },
                "app_scoped_policies": {
                  "description": "A policy rule could match this app by its identity.",
                  "type": "boolean"
                },
                "app_scoped_policy_names": {
                  "description": "The policies (by name, their identity) with such a rule, in policy order; empty when none.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "eligible": {
                  "description": "Found and no app-scoped policies.",
                  "type": "boolean"
                },
                "found": {
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SelfServiceCoverage": {
        "additionalProperties": true,
        "properties": {
          "deny_without_profile": {
            "additionalProperties": true,
            "properties": {
              "allow_all_apps": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "cut_off": {
                "additionalProperties": true,
                "properties": {
                  "people": {
                    "type": "integer"
                  },
                  "personal_keys": {
                    "type": "integer"
                  },
                  "with_app_access": {
                    "type": "integer"
                  },
                  "with_personal_keys": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "enabled": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "draft": {
            "oneOf": [
              {
                "additionalProperties": true,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "profile_id": {
                    "type": "string"
                  },
                  "replaces_profile_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "exact": {
            "type": "boolean"
          },
          "key_impact": {
            "description": "POST with a draft input only (null otherwise): active personal keys whose owner would lose (or gain) access to the key's app compared with the saved settings.",
            "oneOf": [
              {
                "additionalProperties": true,
                "properties": {
                  "entries_limit": {
                    "type": "integer"
                  },
                  "exact": {
                    "description": "False when the personal-key read hit its limit.",
                    "type": "boolean"
                  },
                  "gained": {
                    "additionalProperties": true,
                    "properties": {
                      "apps": {
                        "type": "integer"
                      },
                      "entries": {
                        "description": "One row per person and app, by email then app; at most entries_limit.",
                        "items": {
                          "additionalProperties": true,
                          "properties": {
                            "app_name": {
                              "type": "string"
                            },
                            "email": {
                              "type": "string"
                            },
                            "personal_keys": {
                              "type": "integer"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "people": {
                        "type": "integer"
                      },
                      "personal_keys": {
                        "type": "integer"
                      },
                      "truncated": {
                        "description": "More rows than entries_limit.",
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  },
                  "lost": {
                    "additionalProperties": true,
                    "properties": {
                      "apps": {
                        "type": "integer"
                      },
                      "entries": {
                        "description": "One row per person and app, by email then app; at most entries_limit.",
                        "items": {
                          "additionalProperties": true,
                          "properties": {
                            "app_name": {
                              "type": "string"
                            },
                            "email": {
                              "type": "string"
                            },
                            "personal_keys": {
                              "type": "integer"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "people": {
                        "type": "integer"
                      },
                      "personal_keys": {
                        "type": "integer"
                      },
                      "truncated": {
                        "description": "More rows than entries_limit.",
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "limits": {
            "additionalProperties": true,
            "properties": {
              "personal_keys_limit": {
                "type": "integer"
              },
              "personal_keys_truncated": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "matched": {
            "type": "integer"
          },
          "people": {
            "additionalProperties": true,
            "properties": {
              "directory": {
                "additionalProperties": true,
                "properties": {
                  "available": {
                    "type": "boolean"
                  },
                  "outside_smart_groups": {
                    "type": "integer"
                  },
                  "people": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "in_smart_groups": {
                "description": "Members of enabled Smart Groups: the only people a profile can match.",
                "type": "integer"
              },
              "outside_smart_groups": {
                "type": "integer"
              },
              "total": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "profiles": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "draft": {
                  "type": "boolean"
                },
                "matching": {
                  "description": "People in one of its Smart Groups.",
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "profile_id": {
                  "type": "string"
                },
                "winning": {
                  "description": "People whose profile this is.",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "state_fingerprint": {
            "type": "string"
          },
          "suspended": {
            "type": "integer"
          },
          "unmatched": {
            "additionalProperties": true,
            "properties": {
              "in_smart_groups": {
                "type": "integer"
              },
              "outside_smart_groups": {
                "type": "integer"
              },
              "total": {
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "SelfServiceCoverageRequest": {
        "additionalProperties": false,
        "properties": {
          "deny_without_profile": {
            "description": "Count as if deny_without_profile had this value.",
            "type": "boolean"
          },
          "draft_apps": {
            "description": "Count as if these apps' self-service settings were saved; a field left out keeps its stored value.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "access_control": {
                  "description": "The app's whole self_service.access_control (null clears it).",
                  "oneOf": [
                    {
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "app_name": {
                  "type": "string"
                },
                "enable_self_service": {
                  "description": "Personal-key mode. false stops every personal key on the app.",
                  "type": "boolean"
                },
                "owners": {
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 20,
                  "type": "array"
                }
              },
              "required": [
                "app_name"
              ],
              "type": "object"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": "array"
          },
          "draft_profile": {
            "additionalProperties": false,
            "description": "An unsaved profile, validated like a create. It is evaluated as if saved; nothing is stored.",
            "properties": {
              "app_creation": {
                "description": "Developer app creation from blueprints. Null or absent: people cannot create apps.",
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "blueprints": {
                        "description": "Blueprint app names from the organization's blueprints.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 50,
                        "type": "array"
                      },
                      "max_apps_per_person": {
                        "maximum": 20,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "settings": {
                        "description": "What the owner may do with their app's settings: change directly, request changes, or nothing.",
                        "enum": [
                          "direct",
                          "request",
                          "hidden"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "blueprints",
                      "max_apps_per_person"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ceiling": {
                "additionalProperties": false,
                "description": "The most a person with this profile can ever hold, whatever the app grants.",
                "properties": {
                  "apps": {
                    "description": "\"all\" or a list of app names.",
                    "oneOf": [
                      {
                        "enum": [
                          "all"
                        ],
                        "type": "string"
                      },
                      {
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 200,
                        "type": "array"
                      }
                    ]
                  },
                  "roles": {
                    "items": {
                      "enum": [
                        "self_service_viewer",
                        "settings_update_requester",
                        "settings_update_direct",
                        "show_api_key",
                        "show_logs_for_all_users"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "roles"
                ],
                "type": "object"
              },
              "default_app": {
                "description": "App with personal keys enabled; required when llm_apps is hidden.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "maxLength": 500,
                "type": "string"
              },
              "grants": {
                "description": "Roles added on top of each app's own access list.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "apps": {
                      "description": "\"all\" or a list of app names.",
                      "oneOf": [
                        {
                          "enum": [
                            "all"
                          ],
                          "type": "string"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "maxItems": 200,
                          "type": "array"
                        }
                      ]
                    },
                    "roles": {
                      "items": {
                        "enum": [
                          "self_service_viewer",
                          "settings_update_requester",
                          "settings_update_direct",
                          "show_api_key",
                          "show_logs_for_all_users"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "apps",
                    "roles"
                  ],
                  "type": "object"
                },
                "maxItems": 20,
                "type": "array"
              },
              "keys": {
                "additionalProperties": false,
                "properties": {
                  "max_active_per_person": {
                    "maximum": 10,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "max_lifetime_days": {
                    "maximum": 3650,
                    "minimum": 1,
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "max_active_per_person"
                ],
                "type": "object"
              },
              "llm_apps": {
                "description": "hidden: the person works only in default_app, through a personal developer key.",
                "enum": [
                  "shown",
                  "hidden"
                ],
                "type": "string"
              },
              "models": {
                "description": "Model tiers for personal-key callers. Null or absent: no tier rules.",
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "max_reasoning_effort": {
                        "description": "Higher reasoning effort in a request is lowered to this, never refused.",
                        "enum": [
                          "low",
                          "medium",
                          "high",
                          null
                        ],
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tier_names_only": {
                        "description": "Only the allowed tier models can be called and listed; the served model is not revealed.",
                        "type": "boolean"
                      },
                      "tiers": {
                        "description": "tier_id values from the organization's tier catalog.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 10,
                        "type": "array"
                      }
                    },
                    "required": [
                      "tiers"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "description": "Unique in the organization (case-insensitive).",
                "maxLength": 80,
                "minLength": 1,
                "type": "string"
              },
              "sections": {
                "description": "Self-service sections the person sees.",
                "items": {
                  "enum": [
                    "my_usage",
                    "llm_gateway",
                    "mcp_gateway",
                    "workflow_agents",
                    "skills"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "smart_groups": {
                "description": "Smart Group names (stored lowercase). A person in several profiles' groups gets the profile whose best group ranks first (lowest priority number), then the lower name.",
                "items": {
                  "type": "string"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "name",
              "smart_groups",
              "sections",
              "llm_apps",
              "ceiling",
              "keys"
            ],
            "type": "object"
          },
          "remove_profile_id": {
            "description": "Count as if this saved profile were deleted. Not with draft_profile.",
            "type": "string"
          },
          "replaces_profile_id": {
            "description": "The saved profile the draft replaces (it takes that profile's place in the ranking). Omit to add the draft as a new profile.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SelfServiceEmail": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "SelfServiceEvaluateRequest": {
        "additionalProperties": false,
        "properties": {
          "draft_profile": {
            "additionalProperties": false,
            "description": "An unsaved profile, validated like a create. It is evaluated as if saved; nothing is stored.",
            "properties": {
              "app_creation": {
                "description": "Developer app creation from blueprints. Null or absent: people cannot create apps.",
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "blueprints": {
                        "description": "Blueprint app names from the organization's blueprints.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 50,
                        "type": "array"
                      },
                      "max_apps_per_person": {
                        "maximum": 20,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "settings": {
                        "description": "What the owner may do with their app's settings: change directly, request changes, or nothing.",
                        "enum": [
                          "direct",
                          "request",
                          "hidden"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "blueprints",
                      "max_apps_per_person"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ceiling": {
                "additionalProperties": false,
                "description": "The most a person with this profile can ever hold, whatever the app grants.",
                "properties": {
                  "apps": {
                    "description": "\"all\" or a list of app names.",
                    "oneOf": [
                      {
                        "enum": [
                          "all"
                        ],
                        "type": "string"
                      },
                      {
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 200,
                        "type": "array"
                      }
                    ]
                  },
                  "roles": {
                    "items": {
                      "enum": [
                        "self_service_viewer",
                        "settings_update_requester",
                        "settings_update_direct",
                        "show_api_key",
                        "show_logs_for_all_users"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "roles"
                ],
                "type": "object"
              },
              "default_app": {
                "description": "App with personal keys enabled; required when llm_apps is hidden.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "maxLength": 500,
                "type": "string"
              },
              "grants": {
                "description": "Roles added on top of each app's own access list.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "apps": {
                      "description": "\"all\" or a list of app names.",
                      "oneOf": [
                        {
                          "enum": [
                            "all"
                          ],
                          "type": "string"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "maxItems": 200,
                          "type": "array"
                        }
                      ]
                    },
                    "roles": {
                      "items": {
                        "enum": [
                          "self_service_viewer",
                          "settings_update_requester",
                          "settings_update_direct",
                          "show_api_key",
                          "show_logs_for_all_users"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "apps",
                    "roles"
                  ],
                  "type": "object"
                },
                "maxItems": 20,
                "type": "array"
              },
              "keys": {
                "additionalProperties": false,
                "properties": {
                  "max_active_per_person": {
                    "maximum": 10,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "max_lifetime_days": {
                    "maximum": 3650,
                    "minimum": 1,
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "max_active_per_person"
                ],
                "type": "object"
              },
              "llm_apps": {
                "description": "hidden: the person works only in default_app, through a personal developer key.",
                "enum": [
                  "shown",
                  "hidden"
                ],
                "type": "string"
              },
              "models": {
                "description": "Model tiers for personal-key callers. Null or absent: no tier rules.",
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "max_reasoning_effort": {
                        "description": "Higher reasoning effort in a request is lowered to this, never refused.",
                        "enum": [
                          "low",
                          "medium",
                          "high",
                          null
                        ],
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tier_names_only": {
                        "description": "Only the allowed tier models can be called and listed; the served model is not revealed.",
                        "type": "boolean"
                      },
                      "tiers": {
                        "description": "tier_id values from the organization's tier catalog.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 10,
                        "type": "array"
                      }
                    },
                    "required": [
                      "tiers"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "description": "Unique in the organization (case-insensitive).",
                "maxLength": 80,
                "minLength": 1,
                "type": "string"
              },
              "sections": {
                "description": "Self-service sections the person sees.",
                "items": {
                  "enum": [
                    "my_usage",
                    "llm_gateway",
                    "mcp_gateway",
                    "workflow_agents",
                    "skills"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "smart_groups": {
                "description": "Smart Group names (stored lowercase). A person in several profiles' groups gets the profile whose best group ranks first (lowest priority number), then the lower name.",
                "items": {
                  "type": "string"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              }
            },
            "required": [
              "name",
              "smart_groups",
              "sections",
              "llm_apps",
              "ceiling",
              "keys"
            ],
            "type": "object"
          },
          "email": {
            "type": "string"
          },
          "replaces_profile_id": {
            "description": "The saved profile the draft replaces (it takes that profile's place in the ranking). Omit to add the draft as a new profile.",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "SelfServiceEvaluation": {
        "additionalProperties": true,
        "properties": {
          "app_creation": {
            "description": "Creating apps from blueprints; null when not allowed.",
            "oneOf": [
              {
                "additionalProperties": true,
                "properties": {
                  "available_blueprints": {
                    "items": {
                      "type": "object"
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  },
                  "blueprints": {
                    "items": {
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "can_create": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "max_apps_per_person": {
                    "type": "integer"
                  },
                  "owned_apps": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "remaining": {
                    "type": "integer"
                  },
                  "settings": {
                    "type": "string"
                  },
                  "used": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "apps": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "app_name": {
                  "type": "string"
                },
                "from_app": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "from_exception": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "from_owner": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "from_profile": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "outside_ceiling": {
                  "type": "boolean"
                },
                "removed_by_ceiling": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "roles": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "blocked": {
            "description": "Suspended or denied: no roles, sections or keys.",
            "type": "boolean"
          },
          "denied": {
            "description": "Refused for matching no profile (deny_without_profile).",
            "type": "boolean"
          },
          "deny_without_profile": {
            "type": "boolean"
          },
          "draft": {
            "oneOf": [
              {
                "additionalProperties": true,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "profile_id": {
                    "type": "string"
                  },
                  "replaces_profile_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "type": "string"
          },
          "exceptions": {
            "additionalProperties": true,
            "properties": {
              "active": {
                "items": {
                  "additionalProperties": true,
                  "properties": {
                    "app_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ends_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "exception_id": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "payload": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "pending_count": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "keys": {
            "description": "Personal key limits; null when blocked.",
            "oneOf": [
              {
                "additionalProperties": true,
                "properties": {
                  "apps": {
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "app_max_lifetime_days": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "app_name": {
                          "type": "string"
                        },
                        "max_active_per_person": {
                          "type": "integer"
                        },
                        "max_lifetime_days": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "key_lifetime_exception_days": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "lifetime_source": {
                    "enum": [
                      "profile",
                      "exception",
                      null
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "limit_max_active_per_person": {
                    "type": "integer"
                  },
                  "limit_max_lifetime_days": {
                    "type": "integer"
                  },
                  "max_active_per_person": {
                    "type": "integer"
                  },
                  "max_lifetime_days": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "profile": {
                    "type": [
                      "object",
                      "null"
                    ]
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "llm_apps": {
            "description": "The winning profile's app mode; null without one.",
            "oneOf": [
              {
                "additionalProperties": true,
                "properties": {
                  "default_app": {
                    "oneOf": [
                      {
                        "additionalProperties": true,
                        "properties": {
                          "app_name": {
                            "type": "string"
                          },
                          "personal_keys_available": {
                            "type": "boolean"
                          },
                          "reason": {
                            "enum": [
                              "default_app_missing",
                              "personal_keys_disabled",
                              "outside_ceiling",
                              "suspended",
                              "access_denied",
                              null
                            ],
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "type": "object"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mode": {
                    "enum": [
                      "shown",
                      "hidden"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "matched": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "draft": {
                  "description": "Present when a draft was evaluated: true for the draft itself.",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "profile_id": {
                  "type": "string"
                },
                "rank": {
                  "type": "integer"
                },
                "via_group": {
                  "type": "string"
                },
                "via_group_name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "models": {
            "description": "Model tiers personal keys are held to; null: no tier rules.",
            "oneOf": [
              {
                "additionalProperties": true,
                "properties": {
                  "allowed_models": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "max_reasoning_effort": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tier_names_only": {
                    "type": "boolean"
                  },
                  "tier_upgrades": {
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "ends_at": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "exception_id": {
                          "type": "string"
                        },
                        "tier_id": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "tiers": {
                    "items": {
                      "additionalProperties": true,
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "model": {
                          "type": "string"
                        },
                        "rank": {
                          "type": "integer"
                        },
                        "source": {
                          "enum": [
                            "profile",
                            "exception"
                          ],
                          "type": "string"
                        },
                        "tier_id": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "profile": {
            "oneOf": [
              {
                "additionalProperties": true,
                "properties": {
                  "draft": {
                    "description": "Present when a draft was evaluated: true for the draft itself.",
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "profile_id": {
                    "type": "string"
                  },
                  "rank": {
                    "type": "integer"
                  },
                  "via_group": {
                    "type": "string"
                  },
                  "via_group_name": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "sections": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "suspended": {
            "type": "boolean"
          },
          "suspension": {
            "type": [
              "object",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "SelfServiceException": {
        "additionalProperties": true,
        "properties": {
          "app_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "applied": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "decided_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "decided_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "decision_comment": {
            "type": [
              "string",
              "null"
            ]
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "exception_id": {
            "type": "string"
          },
          "failure_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "justification": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "budget_increase",
              "app_access",
              "tier_upgrade",
              "key_lifetime",
              "app_create"
            ],
            "type": "string"
          },
          "payload": {
            "type": "object"
          },
          "requested_until": {
            "type": "string"
          },
          "requester": {
            "type": "string"
          },
          "reviewer_pool": {
            "enum": [
              "owners",
              "admins"
            ],
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected",
              "cancelled",
              "revoked",
              "failed",
              "expired"
            ],
            "type": "string"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "exception_id",
          "kind",
          "requester",
          "status"
        ],
        "type": "object"
      },
      "SelfServiceExceptionApprove": {
        "additionalProperties": false,
        "properties": {
          "comment": {
            "maxLength": 1000,
            "type": "string"
          },
          "ends_at": {
            "description": "ISO date or date-time, at most 365 days away. Defaults to the requested date.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SelfServiceExceptionItem": {
        "additionalProperties": true,
        "properties": {
          "exception": {
            "additionalProperties": true,
            "properties": {
              "app_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "applied": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decided_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decided_by": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decision_comment": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ends_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "exception_id": {
                "type": "string"
              },
              "failure_reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "justification": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "budget_increase",
                  "app_access",
                  "tier_upgrade",
                  "key_lifetime",
                  "app_create"
                ],
                "type": "string"
              },
              "payload": {
                "type": "object"
              },
              "requested_until": {
                "type": "string"
              },
              "requester": {
                "type": "string"
              },
              "reviewer_pool": {
                "enum": [
                  "owners",
                  "admins"
                ],
                "type": "string"
              },
              "revision": {
                "type": "integer"
              },
              "status": {
                "enum": [
                  "pending",
                  "approved",
                  "rejected",
                  "cancelled",
                  "revoked",
                  "failed",
                  "expired"
                ],
                "type": "string"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "exception_id",
              "kind",
              "requester",
              "status"
            ],
            "type": "object"
          }
        },
        "required": [
          "exception"
        ],
        "type": "object"
      },
      "SelfServiceExceptionList": {
        "additionalProperties": true,
        "properties": {
          "exceptions": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "app_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "applied": {
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "created_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "decided_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "decided_by": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "decision_comment": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "ends_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "exception_id": {
                  "type": "string"
                },
                "failure_reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "justification": {
                  "type": "string"
                },
                "kind": {
                  "enum": [
                    "budget_increase",
                    "app_access",
                    "tier_upgrade",
                    "key_lifetime",
                    "app_create"
                  ],
                  "type": "string"
                },
                "payload": {
                  "type": "object"
                },
                "requested_until": {
                  "type": "string"
                },
                "requester": {
                  "type": "string"
                },
                "reviewer_pool": {
                  "enum": [
                    "owners",
                    "admins"
                  ],
                  "type": "string"
                },
                "revision": {
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "pending",
                    "approved",
                    "rejected",
                    "cancelled",
                    "revoked",
                    "failed",
                    "expired"
                  ],
                  "type": "string"
                },
                "updated_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "exception_id",
                "kind",
                "requester",
                "status"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "exceptions"
        ],
        "type": "object"
      },
      "SelfServiceExceptionReject": {
        "additionalProperties": false,
        "properties": {
          "reason": {
            "maxLength": 1000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "type": "object"
      },
      "SelfServiceExceptionResult": {
        "additionalProperties": true,
        "properties": {
          "after": {
            "additionalProperties": true,
            "properties": {
              "app_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "applied": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decided_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decided_by": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decision_comment": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ends_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "exception_id": {
                "type": "string"
              },
              "failure_reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "justification": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "budget_increase",
                  "app_access",
                  "tier_upgrade",
                  "key_lifetime",
                  "app_create"
                ],
                "type": "string"
              },
              "payload": {
                "type": "object"
              },
              "requested_until": {
                "type": "string"
              },
              "requester": {
                "type": "string"
              },
              "reviewer_pool": {
                "enum": [
                  "owners",
                  "admins"
                ],
                "type": "string"
              },
              "revision": {
                "type": "integer"
              },
              "status": {
                "enum": [
                  "pending",
                  "approved",
                  "rejected",
                  "cancelled",
                  "revoked",
                  "failed",
                  "expired"
                ],
                "type": "string"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "exception_id",
              "kind",
              "requester",
              "status"
            ],
            "type": "object"
          },
          "before": {
            "additionalProperties": true,
            "properties": {
              "app_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "applied": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decided_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decided_by": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decision_comment": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ends_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "exception_id": {
                "type": "string"
              },
              "failure_reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "justification": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "budget_increase",
                  "app_access",
                  "tier_upgrade",
                  "key_lifetime",
                  "app_create"
                ],
                "type": "string"
              },
              "payload": {
                "type": "object"
              },
              "requested_until": {
                "type": "string"
              },
              "requester": {
                "type": "string"
              },
              "reviewer_pool": {
                "enum": [
                  "owners",
                  "admins"
                ],
                "type": "string"
              },
              "revision": {
                "type": "integer"
              },
              "status": {
                "enum": [
                  "pending",
                  "approved",
                  "rejected",
                  "cancelled",
                  "revoked",
                  "failed",
                  "expired"
                ],
                "type": "string"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "exception_id",
              "kind",
              "requester",
              "status"
            ],
            "type": "object"
          },
          "exception": {
            "additionalProperties": true,
            "properties": {
              "app_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "applied": {
                "type": [
                  "object",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decided_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decided_by": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decision_comment": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ends_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "exception_id": {
                "type": "string"
              },
              "failure_reason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "justification": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "budget_increase",
                  "app_access",
                  "tier_upgrade",
                  "key_lifetime",
                  "app_create"
                ],
                "type": "string"
              },
              "payload": {
                "type": "object"
              },
              "requested_until": {
                "type": "string"
              },
              "requester": {
                "type": "string"
              },
              "reviewer_pool": {
                "enum": [
                  "owners",
                  "admins"
                ],
                "type": "string"
              },
              "revision": {
                "type": "integer"
              },
              "status": {
                "enum": [
                  "pending",
                  "approved",
                  "rejected",
                  "cancelled",
                  "revoked",
                  "failed",
                  "expired"
                ],
                "type": "string"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "exception_id",
              "kind",
              "requester",
              "status"
            ],
            "type": "object"
          }
        },
        "required": [
          "exception"
        ],
        "type": "object"
      },
      "SelfServiceExceptionRevoke": {
        "additionalProperties": false,
        "properties": {
          "reason": {
            "maxLength": 1000,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SelfServiceKey": {
        "additionalProperties": true,
        "description": "A personal API key: metadata only, never the key value.",
        "properties": {
          "app_name": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "created_via": {
            "description": "management_api: issued through this API; self_service: by the user.",
            "enum": [
              "management_api",
              "self_service"
            ]
          },
          "expires_at": {
            "description": "Null: never expires.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "key_id": {
            "type": "string"
          },
          "key_name": {
            "type": "string"
          },
          "last_used_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "revoked_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "user_email": {
            "description": "The person the key belongs to (lowercase).",
            "type": "string"
          },
          "version": {
            "description": "Optional If-Match value for PATCH and DELETE.",
            "type": "string"
          }
        },
        "required": [
          "key_id",
          "key_name",
          "user_email",
          "status",
          "version"
        ],
        "type": "object"
      },
      "SelfServiceKeyCreate": {
        "additionalProperties": false,
        "properties": {
          "expires_in_days": {
            "description": "Lifetime in days, at most the app's maximum key lifetime. Omitted: the app's maximum; never expires only when the app sets no maximum.",
            "maximum": 3650,
            "minimum": 1,
            "type": "integer"
          },
          "key_name": {
            "description": "Unique (case-insensitive) among the person's active keys of this app.",
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "user_email": {
            "description": "Email of the person the key is for (case-insensitive).",
            "maxLength": 320,
            "type": "string"
          }
        },
        "required": [
          "user_email",
          "key_name"
        ],
        "type": "object"
      },
      "SelfServiceKeyCreated": {
        "additionalProperties": true,
        "properties": {
          "key": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SelfServiceKey"
              },
              {
                "additionalProperties": true,
                "properties": {
                  "secret": {
                    "description": "The key value. Returned only here (and in a replay of this request with the same Idempotency-Key within 24 hours); store it now.",
                    "type": "string"
                  }
                },
                "required": [
                  "secret"
                ],
                "type": "object"
              }
            ]
          },
          "operation_id": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "operation_id"
        ],
        "type": "object"
      },
      "SelfServiceKeyPage": {
        "additionalProperties": true,
        "properties": {
          "app_name": {
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/SelfServiceKey"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "status_counts": {
            "additionalProperties": true,
            "description": "Counts by status with the user_email filter applied.",
            "properties": {
              "active": {
                "type": "integer"
              },
              "expired": {
                "type": "integer"
              },
              "revoked": {
                "type": "integer"
              }
            },
            "required": [
              "active",
              "expired",
              "revoked"
            ],
            "type": "object"
          },
          "total": {
            "description": "Keys matching the filters.",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "status_counts",
          "next_cursor"
        ],
        "type": "object"
      },
      "SelfServiceKeyPatch": {
        "additionalProperties": false,
        "description": "At least one field.",
        "properties": {
          "expires_in_days": {
            "description": "New expiry, counted from now; at most the app's maximum key lifetime. An expiry can be changed but not removed.",
            "maximum": 3650,
            "minimum": 1,
            "type": "integer"
          },
          "key_name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SelfServiceKeyResult": {
        "additionalProperties": true,
        "properties": {
          "key": {
            "$ref": "#/components/schemas/SelfServiceKey"
          }
        },
        "required": [
          "key"
        ],
        "type": "object"
      },
      "SelfServiceKeyTenantPage": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SelfServiceKey"
            },
            "type": "array"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "status_counts": {
            "additionalProperties": true,
            "description": "Counts by status with the app_name and owner_email filters applied.",
            "properties": {
              "active": {
                "type": "integer"
              },
              "expired": {
                "type": "integer"
              },
              "revoked": {
                "type": "integer"
              }
            },
            "required": [
              "active",
              "expired",
              "revoked"
            ],
            "type": "object"
          },
          "total": {
            "description": "Keys matching the filters.",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "status_counts",
          "next_cursor"
        ],
        "type": "object"
      },
      "SelfServiceProfile": {
        "additionalProperties": true,
        "properties": {
          "app_creation": {
            "description": "Developer app creation from blueprints. Null or absent: people cannot create apps.",
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "blueprints": {
                    "description": "Blueprint app names from the organization's blueprints.",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  "max_apps_per_person": {
                    "maximum": 20,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "settings": {
                    "description": "What the owner may do with their app's settings: change directly, request changes, or nothing.",
                    "enum": [
                      "direct",
                      "request",
                      "hidden"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "blueprints",
                  "max_apps_per_person"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "ceiling": {
            "additionalProperties": false,
            "description": "The most a person with this profile can ever hold, whatever the app grants.",
            "properties": {
              "apps": {
                "description": "\"all\" or a list of app names.",
                "oneOf": [
                  {
                    "enum": [
                      "all"
                    ],
                    "type": "string"
                  },
                  {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 200,
                    "type": "array"
                  }
                ]
              },
              "roles": {
                "items": {
                  "enum": [
                    "self_service_viewer",
                    "settings_update_requester",
                    "settings_update_direct",
                    "show_api_key",
                    "show_logs_for_all_users"
                  ],
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "roles"
            ],
            "type": "object"
          },
          "default_app": {
            "description": "App with personal keys enabled; required when llm_apps is hidden.",
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "grants": {
            "description": "Roles added on top of each app's own access list.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "apps": {
                  "description": "\"all\" or a list of app names.",
                  "oneOf": [
                    {
                      "enum": [
                        "all"
                      ],
                      "type": "string"
                    },
                    {
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 200,
                      "type": "array"
                    }
                  ]
                },
                "roles": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "required": [
                "apps",
                "roles"
              ],
              "type": "object"
            },
            "maxItems": 20,
            "type": "array"
          },
          "keys": {
            "additionalProperties": false,
            "properties": {
              "max_active_per_person": {
                "maximum": 10,
                "minimum": 1,
                "type": "integer"
              },
              "max_lifetime_days": {
                "maximum": 3650,
                "minimum": 1,
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "max_active_per_person"
            ],
            "type": "object"
          },
          "llm_apps": {
            "description": "hidden: the person works only in default_app, through a personal developer key.",
            "enum": [
              "shown",
              "hidden"
            ],
            "type": "string"
          },
          "models": {
            "description": "Model tiers for personal-key callers. Null or absent: no tier rules.",
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "max_reasoning_effort": {
                    "description": "Higher reasoning effort in a request is lowered to this, never refused.",
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      null
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tier_names_only": {
                    "description": "Only the allowed tier models can be called and listed; the served model is not revealed.",
                    "type": "boolean"
                  },
                  "tiers": {
                    "description": "tier_id values from the organization's tier catalog.",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 10,
                    "type": "array"
                  }
                },
                "required": [
                  "tiers"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "description": "Unique in the organization (case-insensitive).",
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "profile_id": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "sections": {
            "description": "Self-service sections the person sees.",
            "items": {
              "enum": [
                "my_usage",
                "llm_gateway",
                "mcp_gateway",
                "workflow_agents",
                "skills"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "smart_groups": {
            "description": "Smart Group names (stored lowercase). A person in several profiles' groups gets the profile whose best group ranks first (lowest priority number), then the lower name.",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": "array"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_by": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "profile_id",
          "name",
          "revision"
        ],
        "type": "object"
      },
      "SelfServiceProfileDeleted": {
        "additionalProperties": true,
        "properties": {
          "before": {
            "additionalProperties": true,
            "properties": {
              "app_creation": {
                "description": "Developer app creation from blueprints. Null or absent: people cannot create apps.",
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "blueprints": {
                        "description": "Blueprint app names from the organization's blueprints.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 50,
                        "type": "array"
                      },
                      "max_apps_per_person": {
                        "maximum": 20,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "settings": {
                        "description": "What the owner may do with their app's settings: change directly, request changes, or nothing.",
                        "enum": [
                          "direct",
                          "request",
                          "hidden"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "blueprints",
                      "max_apps_per_person"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ceiling": {
                "additionalProperties": false,
                "description": "The most a person with this profile can ever hold, whatever the app grants.",
                "properties": {
                  "apps": {
                    "description": "\"all\" or a list of app names.",
                    "oneOf": [
                      {
                        "enum": [
                          "all"
                        ],
                        "type": "string"
                      },
                      {
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 200,
                        "type": "array"
                      }
                    ]
                  },
                  "roles": {
                    "items": {
                      "enum": [
                        "self_service_viewer",
                        "settings_update_requester",
                        "settings_update_direct",
                        "show_api_key",
                        "show_logs_for_all_users"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "roles"
                ],
                "type": "object"
              },
              "default_app": {
                "description": "App with personal keys enabled; required when llm_apps is hidden.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "maxLength": 500,
                "type": "string"
              },
              "grants": {
                "description": "Roles added on top of each app's own access list.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "apps": {
                      "description": "\"all\" or a list of app names.",
                      "oneOf": [
                        {
                          "enum": [
                            "all"
                          ],
                          "type": "string"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "maxItems": 200,
                          "type": "array"
                        }
                      ]
                    },
                    "roles": {
                      "items": {
                        "enum": [
                          "self_service_viewer",
                          "settings_update_requester",
                          "settings_update_direct",
                          "show_api_key",
                          "show_logs_for_all_users"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "apps",
                    "roles"
                  ],
                  "type": "object"
                },
                "maxItems": 20,
                "type": "array"
              },
              "keys": {
                "additionalProperties": false,
                "properties": {
                  "max_active_per_person": {
                    "maximum": 10,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "max_lifetime_days": {
                    "maximum": 3650,
                    "minimum": 1,
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "max_active_per_person"
                ],
                "type": "object"
              },
              "llm_apps": {
                "description": "hidden: the person works only in default_app, through a personal developer key.",
                "enum": [
                  "shown",
                  "hidden"
                ],
                "type": "string"
              },
              "models": {
                "description": "Model tiers for personal-key callers. Null or absent: no tier rules.",
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "max_reasoning_effort": {
                        "description": "Higher reasoning effort in a request is lowered to this, never refused.",
                        "enum": [
                          "low",
                          "medium",
                          "high",
                          null
                        ],
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tier_names_only": {
                        "description": "Only the allowed tier models can be called and listed; the served model is not revealed.",
                        "type": "boolean"
                      },
                      "tiers": {
                        "description": "tier_id values from the organization's tier catalog.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 10,
                        "type": "array"
                      }
                    },
                    "required": [
                      "tiers"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "description": "Unique in the organization (case-insensitive).",
                "maxLength": 80,
                "minLength": 1,
                "type": "string"
              },
              "profile_id": {
                "type": "string"
              },
              "revision": {
                "type": "integer"
              },
              "sections": {
                "description": "Self-service sections the person sees.",
                "items": {
                  "enum": [
                    "my_usage",
                    "llm_gateway",
                    "mcp_gateway",
                    "workflow_agents",
                    "skills"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "smart_groups": {
                "description": "Smart Group names (stored lowercase). A person in several profiles' groups gets the profile whose best group ranks first (lowest priority number), then the lower name.",
                "items": {
                  "type": "string"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_by": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "profile_id",
              "name",
              "revision"
            ],
            "type": "object"
          },
          "deleted": {
            "type": "boolean"
          }
        },
        "required": [
          "deleted"
        ],
        "type": "object"
      },
      "SelfServiceProfileList": {
        "additionalProperties": true,
        "properties": {
          "groups": {
            "additionalProperties": {
              "additionalProperties": true,
              "properties": {
                "effective_priority": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "object"
          },
          "profiles": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "app_creation": {
                  "description": "Developer app creation from blueprints. Null or absent: people cannot create apps.",
                  "oneOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "blueprints": {
                          "description": "Blueprint app names from the organization's blueprints.",
                          "items": {
                            "type": "string"
                          },
                          "maxItems": 50,
                          "type": "array"
                        },
                        "max_apps_per_person": {
                          "maximum": 20,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "settings": {
                          "description": "What the owner may do with their app's settings: change directly, request changes, or nothing.",
                          "enum": [
                            "direct",
                            "request",
                            "hidden"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "blueprints",
                        "max_apps_per_person"
                      ],
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "ceiling": {
                  "additionalProperties": false,
                  "description": "The most a person with this profile can ever hold, whatever the app grants.",
                  "properties": {
                    "apps": {
                      "description": "\"all\" or a list of app names.",
                      "oneOf": [
                        {
                          "enum": [
                            "all"
                          ],
                          "type": "string"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "maxItems": 200,
                          "type": "array"
                        }
                      ]
                    },
                    "roles": {
                      "items": {
                        "enum": [
                          "self_service_viewer",
                          "settings_update_requester",
                          "settings_update_direct",
                          "show_api_key",
                          "show_logs_for_all_users"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "roles"
                  ],
                  "type": "object"
                },
                "default_app": {
                  "description": "App with personal keys enabled; required when llm_apps is hidden.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "description": {
                  "maxLength": 500,
                  "type": "string"
                },
                "grants": {
                  "description": "Roles added on top of each app's own access list.",
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "apps": {
                        "description": "\"all\" or a list of app names.",
                        "oneOf": [
                          {
                            "enum": [
                              "all"
                            ],
                            "type": "string"
                          },
                          {
                            "items": {
                              "type": "string"
                            },
                            "maxItems": 200,
                            "type": "array"
                          }
                        ]
                      },
                      "roles": {
                        "items": {
                          "enum": [
                            "self_service_viewer",
                            "settings_update_requester",
                            "settings_update_direct",
                            "show_api_key",
                            "show_logs_for_all_users"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "apps",
                      "roles"
                    ],
                    "type": "object"
                  },
                  "maxItems": 20,
                  "type": "array"
                },
                "keys": {
                  "additionalProperties": false,
                  "properties": {
                    "max_active_per_person": {
                      "maximum": 10,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "max_lifetime_days": {
                      "maximum": 3650,
                      "minimum": 1,
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "max_active_per_person"
                  ],
                  "type": "object"
                },
                "llm_apps": {
                  "description": "hidden: the person works only in default_app, through a personal developer key.",
                  "enum": [
                    "shown",
                    "hidden"
                  ],
                  "type": "string"
                },
                "models": {
                  "description": "Model tiers for personal-key callers. Null or absent: no tier rules.",
                  "oneOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "max_reasoning_effort": {
                          "description": "Higher reasoning effort in a request is lowered to this, never refused.",
                          "enum": [
                            "low",
                            "medium",
                            "high",
                            null
                          ],
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "tier_names_only": {
                          "description": "Only the allowed tier models can be called and listed; the served model is not revealed.",
                          "type": "boolean"
                        },
                        "tiers": {
                          "description": "tier_id values from the organization's tier catalog.",
                          "items": {
                            "type": "string"
                          },
                          "maxItems": 10,
                          "type": "array"
                        }
                      },
                      "required": [
                        "tiers"
                      ],
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "name": {
                  "description": "Unique in the organization (case-insensitive).",
                  "maxLength": 80,
                  "minLength": 1,
                  "type": "string"
                },
                "profile_id": {
                  "type": "string"
                },
                "revision": {
                  "type": "integer"
                },
                "sections": {
                  "description": "Self-service sections the person sees.",
                  "items": {
                    "enum": [
                      "my_usage",
                      "llm_gateway",
                      "mcp_gateway",
                      "workflow_agents",
                      "skills"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "smart_groups": {
                  "description": "Smart Group names (stored lowercase). A person in several profiles' groups gets the profile whose best group ranks first (lowest priority number), then the lower name.",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50,
                  "minItems": 1,
                  "type": "array"
                },
                "updated_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "updated_by": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "profile_id",
                "name",
                "revision"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "settings": {
            "additionalProperties": true,
            "properties": {
              "blueprints": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "app_name": {
                      "description": "An existing app developers may copy.",
                      "type": "string"
                    },
                    "description": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 80,
                      "type": "string"
                    }
                  },
                  "required": [
                    "app_name"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "deny_without_profile": {
                "type": "boolean"
              },
              "revision": {
                "type": "integer"
              },
              "tiers": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "description": {
                      "maxLength": 300,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 40,
                      "minLength": 1,
                      "type": "string"
                    },
                    "model": {
                      "description": "The model name callers send; a routing group in your policies serves it.",
                      "maxLength": 200,
                      "minLength": 1,
                      "type": "string"
                    },
                    "rank": {
                      "description": "1 is the lowest tier.",
                      "maximum": 100,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "tier_id": {
                      "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "tier_id",
                    "label",
                    "model",
                    "rank"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_by": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "deny_without_profile",
              "revision"
            ],
            "type": "object"
          },
          "suspensions": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "email": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "suspended_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "suspended_by": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "email"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "profiles",
          "settings",
          "suspensions",
          "groups"
        ],
        "type": "object"
      },
      "SelfServiceProfileResult": {
        "additionalProperties": true,
        "properties": {
          "after": {
            "type": "object"
          },
          "before": {
            "type": [
              "object",
              "null"
            ]
          },
          "profile": {
            "additionalProperties": true,
            "properties": {
              "app_creation": {
                "description": "Developer app creation from blueprints. Null or absent: people cannot create apps.",
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "blueprints": {
                        "description": "Blueprint app names from the organization's blueprints.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 50,
                        "type": "array"
                      },
                      "max_apps_per_person": {
                        "maximum": 20,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "settings": {
                        "description": "What the owner may do with their app's settings: change directly, request changes, or nothing.",
                        "enum": [
                          "direct",
                          "request",
                          "hidden"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "blueprints",
                      "max_apps_per_person"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "ceiling": {
                "additionalProperties": false,
                "description": "The most a person with this profile can ever hold, whatever the app grants.",
                "properties": {
                  "apps": {
                    "description": "\"all\" or a list of app names.",
                    "oneOf": [
                      {
                        "enum": [
                          "all"
                        ],
                        "type": "string"
                      },
                      {
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 200,
                        "type": "array"
                      }
                    ]
                  },
                  "roles": {
                    "items": {
                      "enum": [
                        "self_service_viewer",
                        "settings_update_requester",
                        "settings_update_direct",
                        "show_api_key",
                        "show_logs_for_all_users"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "roles"
                ],
                "type": "object"
              },
              "default_app": {
                "description": "App with personal keys enabled; required when llm_apps is hidden.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "maxLength": 500,
                "type": "string"
              },
              "grants": {
                "description": "Roles added on top of each app's own access list.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "apps": {
                      "description": "\"all\" or a list of app names.",
                      "oneOf": [
                        {
                          "enum": [
                            "all"
                          ],
                          "type": "string"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "maxItems": 200,
                          "type": "array"
                        }
                      ]
                    },
                    "roles": {
                      "items": {
                        "enum": [
                          "self_service_viewer",
                          "settings_update_requester",
                          "settings_update_direct",
                          "show_api_key",
                          "show_logs_for_all_users"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "apps",
                    "roles"
                  ],
                  "type": "object"
                },
                "maxItems": 20,
                "type": "array"
              },
              "keys": {
                "additionalProperties": false,
                "properties": {
                  "max_active_per_person": {
                    "maximum": 10,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "max_lifetime_days": {
                    "maximum": 3650,
                    "minimum": 1,
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "max_active_per_person"
                ],
                "type": "object"
              },
              "llm_apps": {
                "description": "hidden: the person works only in default_app, through a personal developer key.",
                "enum": [
                  "shown",
                  "hidden"
                ],
                "type": "string"
              },
              "models": {
                "description": "Model tiers for personal-key callers. Null or absent: no tier rules.",
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "max_reasoning_effort": {
                        "description": "Higher reasoning effort in a request is lowered to this, never refused.",
                        "enum": [
                          "low",
                          "medium",
                          "high",
                          null
                        ],
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tier_names_only": {
                        "description": "Only the allowed tier models can be called and listed; the served model is not revealed.",
                        "type": "boolean"
                      },
                      "tiers": {
                        "description": "tier_id values from the organization's tier catalog.",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 10,
                        "type": "array"
                      }
                    },
                    "required": [
                      "tiers"
                    ],
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "description": "Unique in the organization (case-insensitive).",
                "maxLength": 80,
                "minLength": 1,
                "type": "string"
              },
              "profile_id": {
                "type": "string"
              },
              "revision": {
                "type": "integer"
              },
              "sections": {
                "description": "Self-service sections the person sees.",
                "items": {
                  "enum": [
                    "my_usage",
                    "llm_gateway",
                    "mcp_gateway",
                    "workflow_agents",
                    "skills"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "smart_groups": {
                "description": "Smart Group names (stored lowercase). A person in several profiles' groups gets the profile whose best group ranks first (lowest priority number), then the lower name.",
                "items": {
                  "type": "string"
                },
                "maxItems": 50,
                "minItems": 1,
                "type": "array"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_by": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "profile_id",
              "name",
              "revision"
            ],
            "type": "object"
          }
        },
        "required": [
          "profile"
        ],
        "type": "object"
      },
      "SelfServiceProfileUpdate": {
        "additionalProperties": false,
        "description": "Full replacement; revision from the latest read.",
        "properties": {
          "app_creation": {
            "description": "Developer app creation from blueprints. Null or absent: people cannot create apps.",
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "blueprints": {
                    "description": "Blueprint app names from the organization's blueprints.",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  "max_apps_per_person": {
                    "maximum": 20,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "settings": {
                    "description": "What the owner may do with their app's settings: change directly, request changes, or nothing.",
                    "enum": [
                      "direct",
                      "request",
                      "hidden"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "blueprints",
                  "max_apps_per_person"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "ceiling": {
            "additionalProperties": false,
            "description": "The most a person with this profile can ever hold, whatever the app grants.",
            "properties": {
              "apps": {
                "description": "\"all\" or a list of app names.",
                "oneOf": [
                  {
                    "enum": [
                      "all"
                    ],
                    "type": "string"
                  },
                  {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 200,
                    "type": "array"
                  }
                ]
              },
              "roles": {
                "items": {
                  "enum": [
                    "self_service_viewer",
                    "settings_update_requester",
                    "settings_update_direct",
                    "show_api_key",
                    "show_logs_for_all_users"
                  ],
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "roles"
            ],
            "type": "object"
          },
          "default_app": {
            "description": "App with personal keys enabled; required when llm_apps is hidden.",
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "grants": {
            "description": "Roles added on top of each app's own access list.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "apps": {
                  "description": "\"all\" or a list of app names.",
                  "oneOf": [
                    {
                      "enum": [
                        "all"
                      ],
                      "type": "string"
                    },
                    {
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 200,
                      "type": "array"
                    }
                  ]
                },
                "roles": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "required": [
                "apps",
                "roles"
              ],
              "type": "object"
            },
            "maxItems": 20,
            "type": "array"
          },
          "keys": {
            "additionalProperties": false,
            "properties": {
              "max_active_per_person": {
                "maximum": 10,
                "minimum": 1,
                "type": "integer"
              },
              "max_lifetime_days": {
                "maximum": 3650,
                "minimum": 1,
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "max_active_per_person"
            ],
            "type": "object"
          },
          "llm_apps": {
            "description": "hidden: the person works only in default_app, through a personal developer key.",
            "enum": [
              "shown",
              "hidden"
            ],
            "type": "string"
          },
          "models": {
            "description": "Model tiers for personal-key callers. Null or absent: no tier rules.",
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "max_reasoning_effort": {
                    "description": "Higher reasoning effort in a request is lowered to this, never refused.",
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      null
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tier_names_only": {
                    "description": "Only the allowed tier models can be called and listed; the served model is not revealed.",
                    "type": "boolean"
                  },
                  "tiers": {
                    "description": "tier_id values from the organization's tier catalog.",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 10,
                    "type": "array"
                  }
                },
                "required": [
                  "tiers"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "description": "Unique in the organization (case-insensitive).",
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "sections": {
            "description": "Self-service sections the person sees.",
            "items": {
              "enum": [
                "my_usage",
                "llm_gateway",
                "mcp_gateway",
                "workflow_agents",
                "skills"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "smart_groups": {
            "description": "Smart Group names (stored lowercase). A person in several profiles' groups gets the profile whose best group ranks first (lowest priority number), then the lower name.",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "name",
          "smart_groups",
          "sections",
          "llm_apps",
          "ceiling",
          "keys",
          "revision"
        ],
        "type": "object"
      },
      "SelfServiceProfileWrite": {
        "additionalProperties": false,
        "properties": {
          "app_creation": {
            "description": "Developer app creation from blueprints. Null or absent: people cannot create apps.",
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "blueprints": {
                    "description": "Blueprint app names from the organization's blueprints.",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 50,
                    "type": "array"
                  },
                  "max_apps_per_person": {
                    "maximum": 20,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "settings": {
                    "description": "What the owner may do with their app's settings: change directly, request changes, or nothing.",
                    "enum": [
                      "direct",
                      "request",
                      "hidden"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "blueprints",
                  "max_apps_per_person"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "ceiling": {
            "additionalProperties": false,
            "description": "The most a person with this profile can ever hold, whatever the app grants.",
            "properties": {
              "apps": {
                "description": "\"all\" or a list of app names.",
                "oneOf": [
                  {
                    "enum": [
                      "all"
                    ],
                    "type": "string"
                  },
                  {
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 200,
                    "type": "array"
                  }
                ]
              },
              "roles": {
                "items": {
                  "enum": [
                    "self_service_viewer",
                    "settings_update_requester",
                    "settings_update_direct",
                    "show_api_key",
                    "show_logs_for_all_users"
                  ],
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "roles"
            ],
            "type": "object"
          },
          "default_app": {
            "description": "App with personal keys enabled; required when llm_apps is hidden.",
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "maxLength": 500,
            "type": "string"
          },
          "grants": {
            "description": "Roles added on top of each app's own access list.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "apps": {
                  "description": "\"all\" or a list of app names.",
                  "oneOf": [
                    {
                      "enum": [
                        "all"
                      ],
                      "type": "string"
                    },
                    {
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 200,
                      "type": "array"
                    }
                  ]
                },
                "roles": {
                  "items": {
                    "enum": [
                      "self_service_viewer",
                      "settings_update_requester",
                      "settings_update_direct",
                      "show_api_key",
                      "show_logs_for_all_users"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "required": [
                "apps",
                "roles"
              ],
              "type": "object"
            },
            "maxItems": 20,
            "type": "array"
          },
          "keys": {
            "additionalProperties": false,
            "properties": {
              "max_active_per_person": {
                "maximum": 10,
                "minimum": 1,
                "type": "integer"
              },
              "max_lifetime_days": {
                "maximum": 3650,
                "minimum": 1,
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "max_active_per_person"
            ],
            "type": "object"
          },
          "llm_apps": {
            "description": "hidden: the person works only in default_app, through a personal developer key.",
            "enum": [
              "shown",
              "hidden"
            ],
            "type": "string"
          },
          "models": {
            "description": "Model tiers for personal-key callers. Null or absent: no tier rules.",
            "oneOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "max_reasoning_effort": {
                    "description": "Higher reasoning effort in a request is lowered to this, never refused.",
                    "enum": [
                      "low",
                      "medium",
                      "high",
                      null
                    ],
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tier_names_only": {
                    "description": "Only the allowed tier models can be called and listed; the served model is not revealed.",
                    "type": "boolean"
                  },
                  "tiers": {
                    "description": "tier_id values from the organization's tier catalog.",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 10,
                    "type": "array"
                  }
                },
                "required": [
                  "tiers"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "description": "Unique in the organization (case-insensitive).",
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "sections": {
            "description": "Self-service sections the person sees.",
            "items": {
              "enum": [
                "my_usage",
                "llm_gateway",
                "mcp_gateway",
                "workflow_agents",
                "skills"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "smart_groups": {
            "description": "Smart Group names (stored lowercase). A person in several profiles' groups gets the profile whose best group ranks first (lowest priority number), then the lower name.",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "name",
          "smart_groups",
          "sections",
          "llm_apps",
          "ceiling",
          "keys"
        ],
        "type": "object"
      },
      "SelfServiceSettingsResult": {
        "additionalProperties": true,
        "properties": {
          "after": {
            "additionalProperties": true,
            "properties": {
              "blueprints": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "app_name": {
                      "description": "An existing app developers may copy.",
                      "type": "string"
                    },
                    "description": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 80,
                      "type": "string"
                    }
                  },
                  "required": [
                    "app_name"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "deny_without_profile": {
                "type": "boolean"
              },
              "revision": {
                "type": "integer"
              },
              "tiers": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "description": {
                      "maxLength": 300,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 40,
                      "minLength": 1,
                      "type": "string"
                    },
                    "model": {
                      "description": "The model name callers send; a routing group in your policies serves it.",
                      "maxLength": 200,
                      "minLength": 1,
                      "type": "string"
                    },
                    "rank": {
                      "description": "1 is the lowest tier.",
                      "maximum": 100,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "tier_id": {
                      "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "tier_id",
                    "label",
                    "model",
                    "rank"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_by": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "deny_without_profile",
              "revision"
            ],
            "type": "object"
          },
          "before": {
            "additionalProperties": true,
            "properties": {
              "blueprints": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "app_name": {
                      "description": "An existing app developers may copy.",
                      "type": "string"
                    },
                    "description": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 80,
                      "type": "string"
                    }
                  },
                  "required": [
                    "app_name"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "deny_without_profile": {
                "type": "boolean"
              },
              "revision": {
                "type": "integer"
              },
              "tiers": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "description": {
                      "maxLength": 300,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 40,
                      "minLength": 1,
                      "type": "string"
                    },
                    "model": {
                      "description": "The model name callers send; a routing group in your policies serves it.",
                      "maxLength": 200,
                      "minLength": 1,
                      "type": "string"
                    },
                    "rank": {
                      "description": "1 is the lowest tier.",
                      "maximum": 100,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "tier_id": {
                      "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "tier_id",
                    "label",
                    "model",
                    "rank"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_by": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "deny_without_profile",
              "revision"
            ],
            "type": "object"
          },
          "settings": {
            "additionalProperties": true,
            "properties": {
              "blueprints": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "app_name": {
                      "description": "An existing app developers may copy.",
                      "type": "string"
                    },
                    "description": {
                      "maxLength": 500,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 80,
                      "type": "string"
                    }
                  },
                  "required": [
                    "app_name"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "deny_without_profile": {
                "type": "boolean"
              },
              "revision": {
                "type": "integer"
              },
              "tiers": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "description": {
                      "maxLength": 300,
                      "type": "string"
                    },
                    "label": {
                      "maxLength": 40,
                      "minLength": 1,
                      "type": "string"
                    },
                    "model": {
                      "description": "The model name callers send; a routing group in your policies serves it.",
                      "maxLength": 200,
                      "minLength": 1,
                      "type": "string"
                    },
                    "rank": {
                      "description": "1 is the lowest tier.",
                      "maximum": 100,
                      "minimum": 1,
                      "type": "integer"
                    },
                    "tier_id": {
                      "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "tier_id",
                    "label",
                    "model",
                    "rank"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "updated_by": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "deny_without_profile",
              "revision"
            ],
            "type": "object"
          },
          "warnings": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "code": {
                  "type": "string"
                },
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SelfServiceSettingsUpdate": {
        "additionalProperties": false,
        "description": "Send only what you change: an omitted field keeps its saved value. revision from your latest read.",
        "properties": {
          "blueprints": {
            "description": "Apps developers may copy. Omit to keep them.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "app_name": {
                  "description": "An existing app developers may copy.",
                  "type": "string"
                },
                "description": {
                  "maxLength": 500,
                  "type": "string"
                },
                "label": {
                  "maxLength": 80,
                  "type": "string"
                }
              },
              "required": [
                "app_name"
              ],
              "type": "object"
            },
            "maxItems": 50,
            "type": "array"
          },
          "deny_without_profile": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer"
          },
          "tiers": {
            "description": "The tier catalog. Omit to keep it.",
            "items": {
              "additionalProperties": false,
              "properties": {
                "description": {
                  "maxLength": 300,
                  "type": "string"
                },
                "label": {
                  "maxLength": 40,
                  "minLength": 1,
                  "type": "string"
                },
                "model": {
                  "description": "The model name callers send; a routing group in your policies serves it.",
                  "maxLength": 200,
                  "minLength": 1,
                  "type": "string"
                },
                "rank": {
                  "description": "1 is the lowest tier.",
                  "maximum": 100,
                  "minimum": 1,
                  "type": "integer"
                },
                "tier_id": {
                  "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
                  "type": "string"
                }
              },
              "required": [
                "tier_id",
                "label",
                "model",
                "rank"
              ],
              "type": "object"
            },
            "maxItems": 10,
            "type": "array"
          }
        },
        "required": [
          "revision"
        ],
        "type": "object"
      },
      "SelfServiceSuspend": {
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string"
          },
          "reason": {
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "type": "object"
      },
      "SelfServiceSuspendResult": {
        "additionalProperties": true,
        "properties": {
          "before": {
            "type": [
              "object",
              "null"
            ]
          },
          "created": {
            "type": "boolean"
          },
          "suspension": {
            "additionalProperties": true,
            "properties": {
              "email": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "suspended_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "suspended_by": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "email"
            ],
            "type": "object"
          }
        },
        "type": "object"
      },
      "SelfServiceUnsuspendResult": {
        "additionalProperties": true,
        "properties": {
          "removed": {
            "type": [
              "object",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "SelfServiceUsageReport": {
        "additionalProperties": true,
        "properties": {
          "apps": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "access_control": {
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "access_control_error": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "api_keys": {
                  "additionalProperties": true,
                  "properties": {
                    "active": {
                      "type": "integer"
                    },
                    "created_in_window": {
                      "type": "integer"
                    },
                    "expired": {
                      "type": "integer"
                    },
                    "revoked": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "used_in_window": {
                      "type": "integer"
                    }
                  },
                  "type": "object"
                },
                "app_name": {
                  "type": "string"
                },
                "change_requests": {
                  "type": "object"
                },
                "credential_mode": {
                  "enum": [
                    "user_api_key",
                    "main_app_key"
                  ],
                  "type": "string"
                },
                "enable_self_service": {
                  "type": "boolean"
                },
                "granted_users": {
                  "type": "object"
                },
                "provider_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "self_service_configured": {
                  "type": "boolean"
                },
                "usage": {
                  "additionalProperties": true,
                  "properties": {
                    "all": {
                      "additionalProperties": true,
                      "description": "Request traffic and estimated cost.",
                      "properties": {
                        "anonymized_requests": {
                          "type": "integer"
                        },
                        "blocked_requests": {
                          "type": "integer"
                        },
                        "cache_read_tokens": {
                          "type": "integer"
                        },
                        "cache_write_tokens": {
                          "type": "integer"
                        },
                        "error_count": {
                          "type": "integer"
                        },
                        "estimated_cost_usd": {
                          "type": "number"
                        },
                        "last_request_at": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "reasoning_tokens": {
                          "type": "integer"
                        },
                        "request_count": {
                          "type": "integer"
                        },
                        "total_request_tokens": {
                          "type": "integer"
                        },
                        "total_response_tokens": {
                          "type": "integer"
                        },
                        "total_tokens": {
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "by_identity": {
                      "additionalProperties": true,
                      "description": "self_service_api_key: personal keys; admin_api_key: the app's own key while personal keys are on; identified_user: other requests naming a person; anonymous: no person.",
                      "properties": {
                        "admin_api_key": {
                          "additionalProperties": true,
                          "description": "Request traffic and estimated cost.",
                          "properties": {
                            "anonymized_requests": {
                              "type": "integer"
                            },
                            "blocked_requests": {
                              "type": "integer"
                            },
                            "cache_read_tokens": {
                              "type": "integer"
                            },
                            "cache_write_tokens": {
                              "type": "integer"
                            },
                            "error_count": {
                              "type": "integer"
                            },
                            "estimated_cost_usd": {
                              "type": "number"
                            },
                            "last_request_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "reasoning_tokens": {
                              "type": "integer"
                            },
                            "request_count": {
                              "type": "integer"
                            },
                            "total_request_tokens": {
                              "type": "integer"
                            },
                            "total_response_tokens": {
                              "type": "integer"
                            },
                            "total_tokens": {
                              "type": "integer"
                            }
                          },
                          "type": "object"
                        },
                        "anonymous": {
                          "additionalProperties": true,
                          "description": "Request traffic and estimated cost.",
                          "properties": {
                            "anonymized_requests": {
                              "type": "integer"
                            },
                            "blocked_requests": {
                              "type": "integer"
                            },
                            "cache_read_tokens": {
                              "type": "integer"
                            },
                            "cache_write_tokens": {
                              "type": "integer"
                            },
                            "error_count": {
                              "type": "integer"
                            },
                            "estimated_cost_usd": {
                              "type": "number"
                            },
                            "last_request_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "reasoning_tokens": {
                              "type": "integer"
                            },
                            "request_count": {
                              "type": "integer"
                            },
                            "total_request_tokens": {
                              "type": "integer"
                            },
                            "total_response_tokens": {
                              "type": "integer"
                            },
                            "total_tokens": {
                              "type": "integer"
                            }
                          },
                          "type": "object"
                        },
                        "identified_user": {
                          "additionalProperties": true,
                          "description": "Request traffic and estimated cost.",
                          "properties": {
                            "anonymized_requests": {
                              "type": "integer"
                            },
                            "blocked_requests": {
                              "type": "integer"
                            },
                            "cache_read_tokens": {
                              "type": "integer"
                            },
                            "cache_write_tokens": {
                              "type": "integer"
                            },
                            "error_count": {
                              "type": "integer"
                            },
                            "estimated_cost_usd": {
                              "type": "number"
                            },
                            "last_request_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "reasoning_tokens": {
                              "type": "integer"
                            },
                            "request_count": {
                              "type": "integer"
                            },
                            "total_request_tokens": {
                              "type": "integer"
                            },
                            "total_response_tokens": {
                              "type": "integer"
                            },
                            "total_tokens": {
                              "type": "integer"
                            }
                          },
                          "type": "object"
                        },
                        "self_service_api_key": {
                          "additionalProperties": true,
                          "description": "Request traffic and estimated cost.",
                          "properties": {
                            "anonymized_requests": {
                              "type": "integer"
                            },
                            "blocked_requests": {
                              "type": "integer"
                            },
                            "cache_read_tokens": {
                              "type": "integer"
                            },
                            "cache_write_tokens": {
                              "type": "integer"
                            },
                            "error_count": {
                              "type": "integer"
                            },
                            "estimated_cost_usd": {
                              "type": "number"
                            },
                            "last_request_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "reasoning_tokens": {
                              "type": "integer"
                            },
                            "request_count": {
                              "type": "integer"
                            },
                            "total_request_tokens": {
                              "type": "integer"
                            },
                            "total_response_tokens": {
                              "type": "integer"
                            },
                            "total_tokens": {
                              "type": "integer"
                            }
                          },
                          "type": "object"
                        }
                      },
                      "type": "object"
                    },
                    "identified_user_count": {
                      "type": "integer"
                    },
                    "models": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "top_users": {
                      "items": {
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "from_date": {
            "type": "string"
          },
          "models_without_pricing": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "notes": {
            "type": "object"
          },
          "summary": {
            "additionalProperties": true,
            "properties": {
              "api_keys": {
                "additionalProperties": true,
                "properties": {
                  "active": {
                    "type": "integer"
                  },
                  "created_in_window": {
                    "type": "integer"
                  },
                  "expired": {
                    "type": "integer"
                  },
                  "revoked": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "integer"
                  },
                  "used_in_window": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "apps": {
                "additionalProperties": {
                  "type": "integer"
                },
                "type": "object"
              },
              "change_requests": {
                "type": "object"
              },
              "usage": {
                "additionalProperties": true,
                "properties": {
                  "all": {
                    "additionalProperties": true,
                    "description": "Request traffic and estimated cost.",
                    "properties": {
                      "anonymized_requests": {
                        "type": "integer"
                      },
                      "blocked_requests": {
                        "type": "integer"
                      },
                      "cache_read_tokens": {
                        "type": "integer"
                      },
                      "cache_write_tokens": {
                        "type": "integer"
                      },
                      "error_count": {
                        "type": "integer"
                      },
                      "estimated_cost_usd": {
                        "type": "number"
                      },
                      "last_request_at": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "reasoning_tokens": {
                        "type": "integer"
                      },
                      "request_count": {
                        "type": "integer"
                      },
                      "total_request_tokens": {
                        "type": "integer"
                      },
                      "total_response_tokens": {
                        "type": "integer"
                      },
                      "total_tokens": {
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "by_identity": {
                    "additionalProperties": true,
                    "description": "self_service_api_key: personal keys; admin_api_key: the app's own key while personal keys are on; identified_user: other requests naming a person; anonymous: no person.",
                    "properties": {
                      "admin_api_key": {
                        "additionalProperties": true,
                        "description": "Request traffic and estimated cost.",
                        "properties": {
                          "anonymized_requests": {
                            "type": "integer"
                          },
                          "blocked_requests": {
                            "type": "integer"
                          },
                          "cache_read_tokens": {
                            "type": "integer"
                          },
                          "cache_write_tokens": {
                            "type": "integer"
                          },
                          "error_count": {
                            "type": "integer"
                          },
                          "estimated_cost_usd": {
                            "type": "number"
                          },
                          "last_request_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reasoning_tokens": {
                            "type": "integer"
                          },
                          "request_count": {
                            "type": "integer"
                          },
                          "total_request_tokens": {
                            "type": "integer"
                          },
                          "total_response_tokens": {
                            "type": "integer"
                          },
                          "total_tokens": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "anonymous": {
                        "additionalProperties": true,
                        "description": "Request traffic and estimated cost.",
                        "properties": {
                          "anonymized_requests": {
                            "type": "integer"
                          },
                          "blocked_requests": {
                            "type": "integer"
                          },
                          "cache_read_tokens": {
                            "type": "integer"
                          },
                          "cache_write_tokens": {
                            "type": "integer"
                          },
                          "error_count": {
                            "type": "integer"
                          },
                          "estimated_cost_usd": {
                            "type": "number"
                          },
                          "last_request_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reasoning_tokens": {
                            "type": "integer"
                          },
                          "request_count": {
                            "type": "integer"
                          },
                          "total_request_tokens": {
                            "type": "integer"
                          },
                          "total_response_tokens": {
                            "type": "integer"
                          },
                          "total_tokens": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "identified_user": {
                        "additionalProperties": true,
                        "description": "Request traffic and estimated cost.",
                        "properties": {
                          "anonymized_requests": {
                            "type": "integer"
                          },
                          "blocked_requests": {
                            "type": "integer"
                          },
                          "cache_read_tokens": {
                            "type": "integer"
                          },
                          "cache_write_tokens": {
                            "type": "integer"
                          },
                          "error_count": {
                            "type": "integer"
                          },
                          "estimated_cost_usd": {
                            "type": "number"
                          },
                          "last_request_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reasoning_tokens": {
                            "type": "integer"
                          },
                          "request_count": {
                            "type": "integer"
                          },
                          "total_request_tokens": {
                            "type": "integer"
                          },
                          "total_response_tokens": {
                            "type": "integer"
                          },
                          "total_tokens": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "self_service_api_key": {
                        "additionalProperties": true,
                        "description": "Request traffic and estimated cost.",
                        "properties": {
                          "anonymized_requests": {
                            "type": "integer"
                          },
                          "blocked_requests": {
                            "type": "integer"
                          },
                          "cache_read_tokens": {
                            "type": "integer"
                          },
                          "cache_write_tokens": {
                            "type": "integer"
                          },
                          "error_count": {
                            "type": "integer"
                          },
                          "estimated_cost_usd": {
                            "type": "number"
                          },
                          "last_request_at": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reasoning_tokens": {
                            "type": "integer"
                          },
                          "request_count": {
                            "type": "integer"
                          },
                          "total_request_tokens": {
                            "type": "integer"
                          },
                          "total_response_tokens": {
                            "type": "integer"
                          },
                          "total_tokens": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "users": {
                "type": "object"
              }
            },
            "type": "object"
          },
          "tenant_id": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "to_date": {
            "type": "string"
          },
          "users": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "active_in_window": {
                  "type": "boolean"
                },
                "api_keys": {
                  "type": "object"
                },
                "change_requests": {
                  "type": "object"
                },
                "granted_apps": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "identity_kinds": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "is_granted": {
                  "type": "boolean"
                },
                "roles": {
                  "type": "object"
                },
                "usage": {
                  "additionalProperties": true,
                  "description": "Request traffic and estimated cost.",
                  "properties": {
                    "anonymized_requests": {
                      "type": "integer"
                    },
                    "blocked_requests": {
                      "type": "integer"
                    },
                    "cache_read_tokens": {
                      "type": "integer"
                    },
                    "cache_write_tokens": {
                      "type": "integer"
                    },
                    "error_count": {
                      "type": "integer"
                    },
                    "estimated_cost_usd": {
                      "type": "number"
                    },
                    "last_request_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reasoning_tokens": {
                      "type": "integer"
                    },
                    "request_count": {
                      "type": "integer"
                    },
                    "total_request_tokens": {
                      "type": "integer"
                    },
                    "total_response_tokens": {
                      "type": "integer"
                    },
                    "total_tokens": {
                      "type": "integer"
                    }
                  },
                  "type": "object"
                },
                "usage_by_app": {
                  "items": {
                    "type": "object"
                  },
                  "type": "array"
                },
                "user_email": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "from_date",
          "to_date",
          "summary",
          "apps",
          "users"
        ],
        "type": "object"
      },
      "SmartGroup": {
        "additionalProperties": true,
        "description": "Smart group definition with secret values omitted.",
        "properties": {
          "display_name": {
            "type": "string"
          },
          "emails": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "group_name": {
            "description": "Full name; virtual groups start with virtual:.",
            "type": "string"
          },
          "member_count": {
            "type": "integer"
          },
          "name": {
            "description": "Name without the virtual: prefix.",
            "type": "string"
          },
          "priority": {
            "description": "Effective priority: the override when set, else the synced priority. Lower wins.",
            "type": "integer"
          },
          "priority_override": {
            "description": "Admin override of a synced group's priority; null: none.",
            "type": [
              "integer",
              "null"
            ]
          },
          "priority_override_updated_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "priority_override_updated_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "rank": {
            "description": "1-based position among enabled groups (priority, then name); 1 is the strongest. Null for a disabled group. The console shows this as Strength and the priority number as Rank.",
            "type": [
              "integer",
              "null"
            ]
          },
          "source": {
            "description": "synced: maintained by the directory sync; virtual: created by an admin.",
            "enum": [
              "synced",
              "virtual"
            ]
          },
          "synced_priority": {
            "description": "Priority from the directory sync (a virtual group's own priority).",
            "type": "integer"
          },
          "version": {
            "description": "If-Match value for PATCH and DELETE.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SmartGroupCreate": {
        "additionalProperties": false,
        "properties": {
          "display_name": {
            "description": "Shown in the console. Default: name.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "emails": {
            "description": "Member email addresses (case-insensitive; stored lowercase, duplicates removed).",
            "items": {
              "type": "string"
            },
            "maxItems": 50000,
            "type": "array"
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "name": {
            "description": "Name without the virtual: prefix (lowercased, spaces collapsed). The group is stored as virtual:<name>. The name priority is reserved.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "priority": {
            "default": 100,
            "description": "Lower number wins when a person is in several groups.",
            "maximum": 1000000,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "SmartGroupDeleted": {
        "additionalProperties": true,
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "forced_references": {
            "description": "References that were present when force=true was used.",
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "group_name": {
            "type": "string"
          }
        },
        "required": [
          "deleted",
          "group_name"
        ],
        "type": "object"
      },
      "SmartGroupList": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SmartGroup"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "SmartGroupMembersChange": {
        "additionalProperties": false,
        "description": "At least one email in add or remove; virtual groups only.",
        "properties": {
          "add": {
            "description": "Emails to add (already-present ones are ignored).",
            "items": {
              "type": "string"
            },
            "maxItems": 50000,
            "type": "array"
          },
          "remove": {
            "description": "Emails to remove (absent ones are ignored).",
            "items": {
              "type": "string"
            },
            "maxItems": 50000,
            "type": "array"
          }
        },
        "type": "object"
      },
      "SmartGroupMembersResult": {
        "additionalProperties": true,
        "properties": {
          "added": {
            "type": "integer"
          },
          "removed": {
            "type": "integer"
          },
          "smart_group": {
            "type": "object"
          }
        },
        "required": [
          "smart_group",
          "added",
          "removed"
        ],
        "type": "object"
      },
      "SmartGroupPatch": {
        "additionalProperties": false,
        "description": "At least one field. Synced groups accept only priority.",
        "properties": {
          "display_name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "emails": {
            "description": "Replaces the member list (virtual groups only).",
            "items": {
              "type": "string"
            },
            "maxItems": 50000,
            "type": "array"
          },
          "enabled": {
            "type": "boolean"
          },
          "priority": {
            "description": "Virtual group: its priority (not null). Synced group: the priority override; null resets to the synced priority.",
            "maximum": 1000000,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "SmartGroupPriorityPreview": {
        "additionalProperties": true,
        "properties": {
          "affected_count": {
            "type": "integer"
          },
          "affected_users": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "email": {
                  "type": "string"
                },
                "from_group": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to_group": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "email",
                "from_group",
                "to_group"
              ],
              "type": "object"
            },
            "maxItems": 500,
            "type": "array"
          },
          "budget_moves": {
            "description": "People whose governing budget in a strongest group budget set would change. The new group's budget starts its own counter; usage stays on the old one.",
            "items": {
              "additionalProperties": true,
              "properties": {
                "apps": {
                  "description": "Apps where the move happens (\"*\" = every other app); null when it happens for every app. Only sets with app-scoped budgets narrow this.",
                  "items": {
                    "type": "string"
                  },
                  "type": [
                    "array",
                    "null"
                  ]
                },
                "conditional": {
                  "description": "The governing group depends on the request (app-scoped budgets); from_groups / to_groups then list the possible groups.",
                  "type": "boolean"
                },
                "email": {
                  "type": "string"
                },
                "from_group": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "from_groups": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "from_limit": {
                  "description": "First window's base limit (spend as a decimal USD string).",
                  "type": [
                    "string",
                    "integer"
                  ]
                },
                "from_quota_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "from_quota_ids": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "metric": {
                  "type": "string"
                },
                "set_id": {
                  "type": "string"
                },
                "set_label": {
                  "type": "string"
                },
                "to_group": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to_groups": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "to_limit": {
                  "type": [
                    "string",
                    "integer"
                  ]
                },
                "to_quota_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "to_quota_ids": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "window": {
                  "type": "object"
                }
              },
              "required": [
                "email",
                "set_id",
                "from_group",
                "to_group"
              ],
              "type": "object"
            },
            "maxItems": 500,
            "type": "array"
          },
          "budget_moves_count": {
            "type": "integer"
          },
          "budget_moves_truncated": {
            "type": "boolean"
          },
          "budget_moves_unavailable": {
            "description": "Set when budget sets could not be read (budget_moves empty).",
            "type": "string"
          },
          "ties": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "groups": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "priority": {
                  "type": "integer"
                },
                "shared_members": {
                  "description": "People in more than one of these groups (decided by name).",
                  "type": "integer"
                }
              },
              "required": [
                "priority",
                "groups",
                "shared_members"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "truncated": {
            "description": "True when affected_users holds only the first 500.",
            "type": "boolean"
          }
        },
        "required": [
          "affected_users",
          "affected_count",
          "truncated",
          "ties"
        ],
        "type": "object"
      },
      "SmartGroupPriorityPreviewRequest": {
        "additionalProperties": false,
        "properties": {
          "changes": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "group_name": {
                  "description": "Full group name.",
                  "type": "string"
                },
                "priority": {
                  "description": "Proposed priority; null: reset a synced group's override.",
                  "maximum": 1000000,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                }
              },
              "required": [
                "group_name",
                "priority"
              ],
              "type": "object"
            },
            "maxItems": 1000,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "changes"
        ],
        "type": "object"
      },
      "SmartGroupResponse": {
        "additionalProperties": true,
        "properties": {
          "smart_group": {
            "$ref": "#/components/schemas/SmartGroup"
          }
        },
        "required": [
          "smart_group"
        ],
        "type": "object"
      },
      "TenantOutboundIpsView": {
        "additionalProperties": true,
        "properties": {
          "applies_within_seconds": {
            "description": "A change reaches every server in the region within this many seconds.",
            "type": "integer"
          },
          "available": {
            "description": "false where this gateway can't call out from the chosen region's outbound IPs: the setting is stored but changes nothing.",
            "type": "boolean"
          },
          "enabled": {
            "description": "true: every provider without a use_outbound_ips setting of its own calls out from the Quilr outbound IPs. false or null: those providers are called directly.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "region": {
            "description": "The region whose Quilr outbound IPs are used; null: the gateway's own region.",
            "enum": [
              "us",
              "eu",
              "in",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "regions": {
            "items": {
              "additionalProperties": true,
              "properties": {
                "available": {
                  "type": "boolean"
                },
                "code": {
                  "type": "string"
                },
                "ips": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "name",
                "ips",
                "available"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "updated_at": {
            "description": "When the setting was last changed.",
            "type": [
              "string",
              "null"
            ]
          },
          "updated_by": {
            "description": "Who changed it last.",
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "region",
          "regions",
          "available",
          "applies_within_seconds",
          "version"
        ],
        "type": "object"
      },
      "TenantSettings": {
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "TenantSettingsView": {
        "additionalProperties": true,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "version": {
            "description": "Opaque resource version. Send its quoted value in If-Match.",
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "version"
        ],
        "type": "object"
      },
      "TokenLimits": {
        "additionalProperties": true,
        "properties": {
          "input": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RateLimit"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_per_request": {
            "description": "Maximum input tokens per request; 0 disables.",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "output": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RateLimit"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "TokenSaving": {
        "additionalProperties": false,
        "description": "Request-body transforms that reduce input tokens.",
        "properties": {
          "base64_blob_elision": {
            "type": "boolean"
          },
          "html_to_text": {
            "type": "boolean"
          },
          "json_minification": {
            "type": "boolean"
          },
          "markdown_to_text": {
            "type": "boolean"
          },
          "smart_json_compression": {
            "type": "boolean"
          },
          "text_compression": {
            "type": "boolean"
          },
          "tool_output_cleanup": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "UpstreamLimits": {
        "additionalProperties": false,
        "properties": {
          "input_tpm": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "max_inflight_requests": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "output_tpm": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "rpm": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "shared_quota_pool_ids": {
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 32,
            "type": [
              "array",
              "null"
            ],
            "uniqueItems": true
          },
          "total_tpm": {
            "maximum": 9007199254740991,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": [
          "object",
          "null"
        ]
      },
      "UsageMeasures": {
        "additionalProperties": true,
        "properties": {
          "blocked": {
            "description": "Requests refused by a policy check before the model call, or blocked by a guardrail.",
            "minimum": 0,
            "type": "integer"
          },
          "cache_read_tokens": {
            "description": "Input tokens read from the provider's prompt cache.",
            "minimum": 0,
            "type": "integer"
          },
          "cache_write_tokens": {
            "description": "Input tokens written to the provider's prompt cache.",
            "minimum": 0,
            "type": "integer"
          },
          "cost_usd": {
            "description": "Cost recorded with each request at request time, in USD. Never re-estimated: requests without a recorded cost add nothing (see unpriced_requests).",
            "minimum": 0,
            "type": "number"
          },
          "errors": {
            "description": "Requests that failed upstream or in the gateway (status 400 or above), excluding blocked and rate-limited requests. Provider rate limits (429) count here.",
            "minimum": 0,
            "type": "integer"
          },
          "input_tokens": {
            "description": "Input tokens, including cached input.",
            "minimum": 0,
            "type": "integer"
          },
          "output_tokens": {
            "description": "Output tokens.",
            "minimum": 0,
            "type": "integer"
          },
          "rate_limited": {
            "description": "Requests refused by a gateway rate limit, token limit or quota.",
            "minimum": 0,
            "type": "integer"
          },
          "reasoning_tokens": {
            "description": "Reasoning tokens (part of output_tokens where the provider reports them).",
            "minimum": 0,
            "type": "integer"
          },
          "requests": {
            "description": "Client requests (every outcome). The background cache-refresh requests the gateway sends on its own are not counted.",
            "minimum": 0,
            "type": "integer"
          },
          "unpriced_requests": {
            "description": "Requests with token usage but no recorded cost (for example a model missing from the price list when it was called).",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "requests",
          "errors",
          "blocked",
          "rate_limited",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "cost_usd",
          "unpriced_requests"
        ],
        "type": "object"
      },
      "UsageReport": {
        "additionalProperties": true,
        "properties": {
          "currency": {
            "const": "USD"
          },
          "data_through": {
            "description": "Effective exclusive end of the data counted: the requested `to`, or the time of the read when `to` is omitted. Requests are written a few seconds to minutes after they finish, so the most recent ones can be missing.",
            "format": "date-time",
            "type": "string"
          },
          "from": {
            "description": "Start of the range; null when it starts at the first recorded request.",
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "generated_at": {
            "description": "When the data behind this response was read from storage (UTC). Results are cached, so this can be up to 60 seconds before the response.",
            "format": "date-time",
            "type": "string"
          },
          "granularity": {
            "enum": [
              "total",
              "month",
              "week",
              "day",
              "hour"
            ],
            "type": "string"
          },
          "group_by": {
            "items": {
              "enum": [
                "app",
                "model",
                "provider",
                "user",
                "key",
                "source",
                "outcome"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page. Follow it to the end for a complete export.",
            "type": [
              "string",
              "null"
            ]
          },
          "row_count": {
            "description": "Rows across every page.",
            "minimum": 0,
            "type": "integer"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/UsageRow"
            },
            "type": "array"
          },
          "timezone": {
            "const": "UTC"
          },
          "to": {
            "description": "End of the range (exclusive): the requested end, or the time of the read.",
            "format": "date-time",
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/UsageTotals"
          }
        },
        "required": [
          "from",
          "to",
          "granularity",
          "timezone",
          "group_by",
          "currency",
          "totals",
          "rows",
          "next_cursor",
          "generated_at",
          "data_through"
        ],
        "type": "object"
      },
      "UsageRow": {
        "additionalProperties": true,
        "properties": {
          "app": {
            "description": "App name: the app's current name while it exists, otherwise the name recorded with its requests (null when unknown).",
            "type": [
              "string",
              "null"
            ]
          },
          "app_deleted": {
            "description": "With app: the app no longer exists.",
            "type": "boolean"
          },
          "blocked": {
            "description": "Requests refused by a policy check before the model call, or blocked by a guardrail.",
            "minimum": 0,
            "type": "integer"
          },
          "cache_read_tokens": {
            "description": "Input tokens read from the provider's prompt cache.",
            "minimum": 0,
            "type": "integer"
          },
          "cache_write_tokens": {
            "description": "Input tokens written to the provider's prompt cache.",
            "minimum": 0,
            "type": "integer"
          },
          "cost_usd": {
            "description": "Cost recorded with each request at request time, in USD. Never re-estimated: requests without a recorded cost add nothing (see unpriced_requests).",
            "minimum": 0,
            "type": "number"
          },
          "errors": {
            "description": "Requests that failed upstream or in the gateway (status 400 or above), excluding blocked and rate-limited requests. Provider rate limits (429) count here.",
            "minimum": 0,
            "type": "integer"
          },
          "input_tokens": {
            "description": "Input tokens, including cached input.",
            "minimum": 0,
            "type": "integer"
          },
          "key": {
            "description": "Gateway credential id (key_id of GET /apps/{app_name}/keys), or the personal key id (key_id of the user's self-service keys) for personal-key traffic; null when the request used neither (JWT, shared app key without a credential id) or predates credential tracking.",
            "type": [
              "string",
              "null"
            ]
          },
          "key_name": {
            "description": "With key: the credential's name when it still exists.",
            "type": [
              "string",
              "null"
            ]
          },
          "model": {
            "description": "The served model (after routing and aliases), not the model name the client sent; null when not recorded.",
            "type": [
              "string",
              "null"
            ]
          },
          "outcome": {
            "enum": [
              "served",
              "blocked",
              "error",
              "rate_limited"
            ],
            "type": "string"
          },
          "output_tokens": {
            "description": "Output tokens.",
            "minimum": 0,
            "type": "integer"
          },
          "period_start": {
            "description": "Start of the period, UTC: a date (YYYY-MM-DD; weeks start Monday) for day, week and month, or an RFC 3339 timestamp (YYYY-MM-DDTHH:00:00Z) for hour; absent when granularity is total.",
            "type": "string"
          },
          "provider": {
            "description": "Provider label, or the provider type for providers configured inside an app; null when not recorded.",
            "type": [
              "string",
              "null"
            ]
          },
          "rate_limited": {
            "description": "Requests refused by a gateway rate limit, token limit or quota.",
            "minimum": 0,
            "type": "integer"
          },
          "reasoning_tokens": {
            "description": "Reasoning tokens (part of output_tokens where the provider reports them).",
            "minimum": 0,
            "type": "integer"
          },
          "requests": {
            "description": "Client requests (every outcome). The background cache-refresh requests the gateway sends on its own are not counted.",
            "minimum": 0,
            "type": "integer"
          },
          "source": {
            "enum": [
              "gateway",
              "sdk",
              "copilot_studio"
            ],
            "type": "string"
          },
          "unpriced_requests": {
            "description": "Requests with token usage but no recorded cost (for example a model missing from the price list when it was called).",
            "minimum": 0,
            "type": "integer"
          },
          "user": {
            "description": "User email; null when the request carried no identity or its identity was removed by data retention.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "requests",
          "errors",
          "blocked",
          "rate_limited",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "cost_usd",
          "unpriced_requests"
        ],
        "type": "object"
      },
      "UsageTotals": {
        "additionalProperties": true,
        "properties": {
          "blocked": {
            "description": "Requests refused by a policy check before the model call, or blocked by a guardrail.",
            "minimum": 0,
            "type": "integer"
          },
          "cache_read_tokens": {
            "description": "Input tokens read from the provider's prompt cache.",
            "minimum": 0,
            "type": "integer"
          },
          "cache_write_tokens": {
            "description": "Input tokens written to the provider's prompt cache.",
            "minimum": 0,
            "type": "integer"
          },
          "cost_usd": {
            "description": "Cost recorded with each request at request time, in USD. Never re-estimated: requests without a recorded cost add nothing (see unpriced_requests).",
            "minimum": 0,
            "type": "number"
          },
          "errors": {
            "description": "Requests that failed upstream or in the gateway (status 400 or above), excluding blocked and rate-limited requests. Provider rate limits (429) count here.",
            "minimum": 0,
            "type": "integer"
          },
          "input_tokens": {
            "description": "Input tokens, including cached input.",
            "minimum": 0,
            "type": "integer"
          },
          "output_tokens": {
            "description": "Output tokens.",
            "minimum": 0,
            "type": "integer"
          },
          "priced_coverage_pct": {
            "description": "Share of billable requests with a recorded cost: 100 x (B - unpriced_requests) / B, where B is the requests that reached the pricing stage with token usage (keep-warm refreshes included, like cost_usd). Below 100, cost_usd understates spend. Null when B is 0.",
            "maximum": 100,
            "minimum": 0,
            "type": [
              "number",
              "null"
            ]
          },
          "rate_limited": {
            "description": "Requests refused by a gateway rate limit, token limit or quota.",
            "minimum": 0,
            "type": "integer"
          },
          "reasoning_tokens": {
            "description": "Reasoning tokens (part of output_tokens where the provider reports them).",
            "minimum": 0,
            "type": "integer"
          },
          "requests": {
            "description": "Client requests (every outcome). The background cache-refresh requests the gateway sends on its own are not counted.",
            "minimum": 0,
            "type": "integer"
          },
          "unpriced_requests": {
            "description": "Requests with token usage but no recorded cost (for example a model missing from the price list when it was called).",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "requests",
          "errors",
          "blocked",
          "rate_limited",
          "input_tokens",
          "output_tokens",
          "cache_read_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "cost_usd",
          "unpriced_requests",
          "priced_coverage_pct"
        ],
        "type": "object"
      },
      "VersionList": {
        "additionalProperties": true,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/VersionRecord"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page; null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "type": "object"
      },
      "VersionRecord": {
        "additionalProperties": true,
        "properties": {
          "actor_email": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "changed_at": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "new_config": {
            "description": "Snapshot with secret values omitted.",
            "type": "object"
          },
          "operation": {
            "type": [
              "string",
              "null"
            ]
          },
          "previous_config": {
            "description": "Snapshot with secret values omitted.",
            "type": "object"
          },
          "version": {
            "type": [
              "integer",
              "string",
              "null"
            ]
          },
          "version_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "VersionResponse": {
        "additionalProperties": true,
        "properties": {
          "version_record": {
            "$ref": "#/components/schemas/VersionRecord"
          }
        },
        "required": [
          "version_record"
        ],
        "type": "object"
      },
      "Warning": {
        "additionalProperties": true,
        "description": "Non-blocking notice about a saved change.",
        "properties": {
          "active_revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "code": {
            "type": "string"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "message": {
            "type": "string"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "ManagementKey": {
        "bearerFormat": "qlmgmt_",
        "description": "Management key issued by a tenant administrator. Keys carry scopes; each operation lists the scopes it needs in x-scopes.",
        "scheme": "bearer",
        "type": "http"
      },
      "TenantAdminJWT": {
        "bearerFormat": "JWT",
        "description": "Verified Quilr user token whose tenantIds claim includes the tenant in the path and that identifies the user (sub, userId or email). Tenant headers and operator sessions are not accepted.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Configure the Quilr LLM Gateway programmatically: apps, shared providers, quota pools, gateway keys, prompts, budgets and history.\n\n**Authentication.** Tenant administrators enable management for a tenant and issue management keys with the Administration endpoints (verified tenant administrator token). Every other endpoint takes a management key as `Authorization: Bearer qlmgmt_...`. Each operation lists the scopes it requires in `x-scopes`; an empty list on an Administration operation means a verified tenant administrator token.\n\n**Writes.** Updates and deletes of an existing resource require `If-Match` with the quoted `version` (ETag) from the latest read (`428` when missing, `412` when stale). Creates take an `Idempotency-Key`; retrying with the same key replays the original result for 24 hours. Saved configuration reaches the gateway asynchronously.\n\n**Responses.** Every JSON response carries `request_id` (also in `X-Request-ID`) and `Cache-Control: no-store`. Errors use `{\"error\": {\"code\", \"message\", ...}, \"request_id\"}`. Lists are paginated with `limit` and an opaque `cursor` (`next_cursor` is null on the last page).\n\n**Policy.** General QuilrQL policy authoring is not part of this API. Budget and pricing edits (scope `budgets:policy`) are the only policy-backed writes: each publishes a validated policy revision. When QuilrQL governs a tenant, app settings it governs are saved but take effect only when policy authority is disabled; responses flag them with an `inactive_under_quilrql` warning.\n\nApps whose names contain `/` or a literal `%` can be addressed with the query-locator aliases under `/app?app_name=...` (marked with `x-alias-of`).",
    "title": "LLM Gateway Management API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/llmgateway/management-admin/v1/tenants/{tenant_id}/hooks": {
      "get": {
        "description": "Read-only view of the tenant's external hooks for the console: the active policy revision and every hook in the same view as GET /controls/hooks (secrets masked as ********). Hooks are configured only through the Management API. While the policy engine is off for the tenant the answer is {\"revision\": null, \"hooks\": []}.",
        "operationId": "List_tenant_hooks",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "hooks": [
                    {
                      "all_apps": false,
                      "description": "ACME prompt policy check",
                      "enabled": true,
                      "endpoint": {
                        "auth": {
                          "type": "none"
                        },
                        "body": {
                          "format": "quilr"
                        },
                        "headers": [
                          {
                            "name": "X-Api-Key",
                            "value": "{{secret.api_key}}"
                          }
                        ],
                        "method": "POST",
                        "on_failure": "allow",
                        "response": {
                          "format": "quilr"
                        },
                        "timeout_ms": 1500,
                        "url": "https://guard.example.com/v1/check"
                      },
                      "id": "acme-guard",
                      "match": {
                        "api_families": [
                          "openai.chat_completions"
                        ],
                        "requested_models": []
                      },
                      "mode": "observe",
                      "scope": {
                        "app_tags": [],
                        "apps": [
                          "support-bot"
                        ],
                        "smart_groups": [],
                        "users": []
                      },
                      "secrets": {
                        "api_key": "********"
                      },
                      "send": {
                        "body": "as_received",
                        "exclude": [],
                        "include": [],
                        "max_body_bytes": 1048576,
                        "on_oversize": "send_without_body",
                        "preset": "standard",
                        "request_headers": []
                      },
                      "stage": "pre_call"
                    }
                  ],
                  "request_id": "req_example",
                  "revision": 42
                },
                "schema": {
                  "$ref": "#/components/schemas/AdminHooks"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "List the tenant's external hooks",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      }
    },
    "/llmgateway/management-admin/v1/tenants/{tenant_id}/keys": {
      "get": {
        "description": "Management keys of the tenant: metadata, scopes, status and version, never the secret.",
        "operationId": "List_management_keys",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "created_at": 1790251200.0,
                      "created_by": "tenant_admin:admin@example.com",
                      "expires_at": null,
                      "key_id": "2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                      "last_used_at": null,
                      "name": "Deployment automation",
                      "revoked_at": null,
                      "scopes": [
                        "config:write",
                        "credentials:write",
                        "providers:write",
                        "read"
                      ],
                      "status": "active",
                      "tenant": "your-tenant-id",
                      "version": "5d4c3b2a1f0e"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ManagementKeyList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "List management keys",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      },
      "post": {
        "description": "Issues a management key with the given scopes; the secret is returned once. Management must be enabled for the tenant (403 management_disabled_for_tenant). A retry by the same administrator with the same Idempotency-Key within 24 hours returns the same key.",
        "operationId": "Issue_a_management_key",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "automation": {
                  "summary": "Configuration automation",
                  "value": {
                    "expires_at": null,
                    "name": "Deployment automation",
                    "scopes": [
                      "read",
                      "config:write",
                      "providers:write",
                      "credentials:write"
                    ]
                  }
                },
                "finance": {
                  "summary": "Read-only budget dashboard",
                  "value": {
                    "expires_at": "2027-01-01T00:00:00Z",
                    "name": "Finance dashboard",
                    "scopes": [
                      "budgets:read"
                    ]
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ManagementKeyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": 1790251200.0,
                    "created_by": "tenant_admin:admin@example.com",
                    "expires_at": null,
                    "key_id": "2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "last_used_at": null,
                    "name": "Deployment automation",
                    "revoked_at": null,
                    "scopes": [
                      "config:write",
                      "credentials:write",
                      "providers:write",
                      "read"
                    ],
                    "secret": "<new-management-key>",
                    "status": "active",
                    "tenant": "your-tenant-id",
                    "version": "5d4c3b2a1f0e"
                  },
                  "operation_id": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ManagementKeyIssued"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "Issue a management key",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      }
    },
    "/llmgateway/management-admin/v1/tenants/{tenant_id}/keys/{key_id}": {
      "delete": {
        "description": "Revokes the key immediately; it can no longer authenticate. Use key.version from the list as a quoted If-Match.",
        "operationId": "Revoke_a_management_key",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": 1790251200.0,
                    "created_by": "tenant_admin:admin@example.com",
                    "expires_at": null,
                    "key_id": "2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "last_used_at": null,
                    "name": "Deployment automation",
                    "revoked_at": 1790251300.0,
                    "scopes": [
                      "config:write",
                      "credentials:write",
                      "providers:write",
                      "read"
                    ],
                    "status": "revoked",
                    "tenant": "your-tenant-id",
                    "version": "5d4c3b2a1f0e"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ManagementKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "Revoke a management key",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      },
      "patch": {
        "description": "Changes the name, scopes or expiry of a management key. Use key.version from the list as a quoted If-Match.",
        "operationId": "Update_a_management_key",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Production automation",
                "scopes": [
                  "read",
                  "config:write"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/ManagementKeyPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": 1790251200.0,
                    "created_by": "tenant_admin:admin@example.com",
                    "expires_at": null,
                    "key_id": "2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "last_used_at": null,
                    "name": "Production automation",
                    "revoked_at": null,
                    "scopes": [
                      "config:write",
                      "read"
                    ],
                    "status": "active",
                    "tenant": "your-tenant-id",
                    "version": "5d4c3b2a1f0e"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ManagementKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "Update a management key",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      }
    },
    "/llmgateway/management-admin/v1/tenants/{tenant_id}/outbound-ips": {
      "get": {
        "description": "The same view as GET /outbound-ips, plus the settings version.",
        "operationId": "Read_tenant_outbound_ips",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "applies_within_seconds": 120,
                  "available": true,
                  "enabled": true,
                  "region": "in",
                  "regions": [
                    {
                      "available": true,
                      "code": "in",
                      "ips": [
                        "203.0.113.10"
                      ],
                      "name": "India"
                    }
                  ],
                  "request_id": "req_example",
                  "updated_at": null,
                  "updated_by": null,
                  "version": "6c5b4a392817"
                },
                "schema": {
                  "$ref": "#/components/schemas/TenantOutboundIpsView"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "Read the tenant's outbound IP setting",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      },
      "put": {
        "description": "Sets enabled, region, or both. Send the quoted version from the latest read in If-Match.",
        "operationId": "Set_tenant_outbound_ips",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "enabled": true,
                "region": "in"
              },
              "schema": {
                "$ref": "#/components/schemas/OutboundIpsUpdate"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "applies_within_seconds": 120,
                  "available": true,
                  "enabled": true,
                  "region": "in",
                  "regions": [
                    {
                      "available": true,
                      "code": "in",
                      "ips": [
                        "203.0.113.10"
                      ],
                      "name": "India"
                    }
                  ],
                  "request_id": "req_example",
                  "updated_at": null,
                  "updated_by": null,
                  "version": "6c5b4a392817"
                },
                "schema": {
                  "$ref": "#/components/schemas/TenantOutboundIpsView"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "Set the tenant's outbound IP setting",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      }
    },
    "/llmgateway/management-admin/v1/tenants/{tenant_id}/settings": {
      "get": {
        "description": "Whether management is enabled for the tenant (off by default) and the settings version.",
        "operationId": "Read_tenant_management_settings",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "enabled": true,
                  "request_id": "req_example",
                  "version": "6c5b4a392817"
                },
                "schema": {
                  "$ref": "#/components/schemas/TenantSettingsView"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "Read tenant management settings",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      },
      "patch": {
        "description": "Turns management on or off for the tenant. Suspending keeps keys; unexpired, unrevoked keys work again when management is re-enabled. Send the quoted version from the latest read in If-Match.",
        "operationId": "Enable_or_suspend_tenant_management",
        "parameters": [
          {
            "description": "Quilr tenant ID.",
            "example": "your-tenant-id",
            "in": "path",
            "name": "tenant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "enabled": true
              },
              "schema": {
                "$ref": "#/components/schemas/TenantSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "enabled": true,
                  "request_id": "req_example",
                  "version": "7d6c5b4a3928"
                },
                "schema": {
                  "$ref": "#/components/schemas/TenantSettingsView"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "TenantAdminJWT": []
          }
        ],
        "summary": "Enable or suspend tenant management",
        "tags": [
          "Administration"
        ],
        "x-scopes": []
      }
    },
    "/llmgateway/management/v1/app": {
      "get": {
        "description": "Stored settings of one app, grouped by section, with secret values omitted. `version` is the app ETag used by every app write, including prompts, attachments and rollback.\n\nQuery-locator alias of Read_an_app: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Read_an_app_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read an app (query locator)",
        "tags": [
          "Apps"
        ],
        "x-alias-of": "Read_an_app",
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Partial update: only the fields you send change, and fields inside a section merge. Set `enabled` to false to disable the app (its keys stop working until it is re-enabled). Send the quoted version from the latest read in If-Match. Settings governed by an active QuilrQL policy are saved but reported in an `inactive_under_quilrql` warning; routing members that cannot serve every client API produce non-blocking warnings.\n\nQuery-locator alias of Update_or_disable_an_app: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Update_or_disable_an_app_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "detection": {
                  "summary": "Redact data risks and set a timeout",
                  "value": {
                    "detection": {
                      "data_risk_action": "redact"
                    },
                    "limits": {
                      "timeout": 30
                    }
                  }
                },
                "disable": {
                  "summary": "Disable the app",
                  "value": {
                    "enabled": false
                  }
                },
                "rate_limit": {
                  "summary": "Limit requests per hour",
                  "value": {
                    "limits": {
                      "rate_limit": {
                        "duration": "hour",
                        "value": 1000
                      }
                    }
                  }
                },
                "system_prompt": {
                  "summary": "Prepend a universal system prompt",
                  "value": {
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "Answer only questions about Acme products.",
                        "enabled": true
                      }
                    }
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/AppPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {
                      "timeout": 30
                    },
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update or disable an app (query locator)",
        "tags": [
          "Apps"
        ],
        "x-alias-of": "Update_or_disable_an_app",
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/keys": {
      "get": {
        "description": "Gateway keys of the app: metadata, a short fingerprint and recent usage, never the secret.\n\nQuery-locator alias of List_gateway_credentials: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "List_gateway_credentials_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "created_at": "2026-09-24T12:00:00Z",
                      "expires_at": null,
                      "fingerprint": "0123456789ab",
                      "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                      "name": "Default",
                      "status": "active",
                      "usage": {
                        "last_used_at": "2026-10-30T17:42:08Z",
                        "requests_30d": 18234
                      }
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List gateway credentials (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "List_gateway_credentials",
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "Issues another gateway key for the app; the secret is returned once (and on an idempotent replay). Names are unique among the app's active and expired keys.\n\nQuery-locator alias of Issue_a_gateway_credential: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Issue_a_gateway_credential_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_at": "2027-01-01T00:00:00Z",
                "name": "Deployment"
              },
              "schema": {
                "$ref": "#/components/schemas/GatewayKeyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Deployment",
                    "secret": "<new-gateway-key>",
                    "status": "active"
                  },
                  "operation_id": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyIssued"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Issue a gateway credential (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Issue_a_gateway_credential",
        "x-scopes": [
          "credentials:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/keys/{key_id}": {
      "delete": {
        "description": "Revokes the key immediately and permanently. Revoking an already revoked key returns it unchanged. Send the quoted version from the latest read in If-Match.\n\nQuery-locator alias of Revoke_a_gateway_credential: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Revoke_a_gateway_credential_query",
        "parameters": [
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "status": "revoked"
                  },
                  "request_id": "req_example",
                  "version": "8f7e6d5c4b3a"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Revoke a gateway credential (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Revoke_a_gateway_credential",
        "x-scopes": [
          "credentials:write"
        ]
      },
      "get": {
        "description": "Metadata and recent usage of one gateway key, and its version (ETag).\n\nQuery-locator alias of Get_key: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Get_key_query",
        "parameters": [
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "status": "active",
                    "usage": {
                      "last_used_at": "2026-10-30T17:42:08Z",
                      "requests_30d": 18234
                    }
                  },
                  "request_id": "req_example",
                  "version": "7e6d5c4b3a29"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a gateway credential (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Get_key",
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Renames a key (`name`, unique among active and expired keys: 409 duplicate_key_name) and/or sets or clears (null) the expiry of an active key. Revoked keys cannot change; expired keys can only be renamed (409 terminal_key_state). Send the quoted version from the latest read in If-Match.\n\nQuery-locator alias of Change_gateway_key_expiry: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Change_gateway_key_expiry_query",
        "parameters": [
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "clear": {
                  "summary": "Never expire",
                  "value": {
                    "expires_at": null
                  }
                },
                "rename": {
                  "summary": "Rename",
                  "value": {
                    "name": "ci-runner"
                  }
                },
                "set": {
                  "summary": "Expire on a date",
                  "value": {
                    "expires_at": "2027-01-01T00:00:00Z"
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/GatewayKeyPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": "2027-01-01T00:00:00Z",
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "status": "active"
                  },
                  "request_id": "req_example",
                  "version": "8f7e6d5c4b3a"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Rename a gateway key or change its expiry (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Change_gateway_key_expiry",
        "x-scopes": [
          "credentials:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/keys/{key_id}/reveal": {
      "post": {
        "description": "Returns the secret of an active key. Expired or revoked keys return 409 terminal_key_state. Every reveal is recorded in the audit trail.\n\nQuery-locator alias of Reveal_a_gateway_credential: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Reveal_a_gateway_credential_query",
        "parameters": [
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "secret": "<gateway-key>",
                    "status": "active"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Reveal a gateway credential (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Reveal_a_gateway_credential",
        "x-scopes": [
          "credentials:read"
        ]
      }
    },
    "/llmgateway/management/v1/app/prompts": {
      "get": {
        "description": "Stored prompts of the app, sorted by prompt_id, with the app version.\n\nQuery-locator alias of List_prompts: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "List_prompts_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "content": "You help customers with support questions.",
                      "created_at": "2026-09-24T12:00:00Z",
                      "prompt_id": "support",
                      "updated_at": "2026-09-24T12:00:00Z"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "version": "3f1c0a9e5b7d"
                },
                "schema": {
                  "$ref": "#/components/schemas/PromptList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List prompts (query locator)",
        "tags": [
          "Prompts"
        ],
        "x-alias-of": "List_prompts",
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/app/prompts/{prompt_id}": {
      "delete": {
        "description": "Deletes a stored prompt. Uses the app ETag.\n\nQuery-locator alias of Delete_a_prompt: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Delete_a_prompt_query",
        "parameters": [
          {
            "example": "support",
            "in": "path",
            "name": "prompt_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "prompt": null,
                  "prompt_id": "support",
                  "request_id": "req_example",
                  "version": "5b3d2c1e0f9a"
                },
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a prompt (query locator)",
        "tags": [
          "Prompts"
        ],
        "x-alias-of": "Delete_a_prompt",
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One stored prompt and the app version.\n\nQuery-locator alias of Read_a_prompt: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Read_a_prompt_query",
        "parameters": [
          {
            "example": "support",
            "in": "path",
            "name": "prompt_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "prompt": {
                    "content": "You help customers with support questions.",
                    "created_at": "2026-09-24T12:00:00Z",
                    "updated_at": "2026-09-24T12:00:00Z"
                  },
                  "prompt_id": "support",
                  "request_id": "req_example",
                  "version": "3f1c0a9e5b7d"
                },
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a prompt (query locator)",
        "tags": [
          "Prompts"
        ],
        "x-alias-of": "Read_a_prompt",
        "x-scopes": [
          "read"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) a prompt. prompt_id is 1-200 letters, digits, `_` or `-`. Creating a new prompt needs no If-Match; replacing or deleting one uses the app ETag in If-Match (428 without it).\n\nQuery-locator alias of Create_or_replace_a_prompt: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Create_or_replace_a_prompt_query",
        "parameters": [
          {
            "example": "support",
            "in": "path",
            "name": "prompt_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version. Optional when creating a new prompt; required (428) to replace an existing one.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "content": "You help customers with support questions."
              },
              "schema": {
                "$ref": "#/components/schemas/Prompt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "prompt": {
                    "content": "You help customers with support questions.",
                    "created_at": "2026-09-24T12:00:00Z",
                    "updated_at": "2026-09-24T12:00:00Z"
                  },
                  "prompt_id": "support",
                  "request_id": "req_example",
                  "version": "4a2c1b0d9e8f"
                },
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a prompt (query locator)",
        "tags": [
          "Prompts"
        ],
        "x-alias-of": "Create_or_replace_a_prompt",
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/provider-conversion": {
      "post": {
        "description": "Moves an inline app (legacy per-app credentials) to shared providers in one step: send the complete list of shared-provider labels and, optionally, routing rewritten to reference them. Uses the app ETag; 409 already_converted when the app already uses shared providers.\n\nQuery-locator alias of Convert_inline_providers: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Convert_inline_providers_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "provider_labels": [
                  "Production OpenAI"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/Conversion"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Convert inline providers (query locator)",
        "tags": [
          "Apps"
        ],
        "x-alias-of": "Convert_inline_providers",
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/providers": {
      "get": {
        "description": "Ordered shared-provider labels attached to the app (the first is primary) and the app version. Not paginated.\n\nQuery-locator alias of List_app_providers: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "List_app_providers_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "provider_labels": [
                    "Production OpenAI"
                  ],
                  "request_id": "req_example",
                  "version": "3f1c0a9e5b7d"
                },
                "schema": {
                  "$ref": "#/components/schemas/AttachmentList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List app providers (query locator)",
        "tags": [
          "Apps"
        ],
        "x-alias-of": "List_app_providers",
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/app/providers/{label}": {
      "delete": {
        "description": "Removes the provider from the app after checking the remaining routes still resolve. Uses the app ETag. While QuilrQL governs the tenant, removal is refused (409 policy_dependency, with the rules as references) only when an active rule that can apply to the app names the provider; edit those rules first (GET /controls/references?provider_label=).\n\nQuery-locator alias of Detach_an_app_provider: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Detach_an_app_provider_query",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Detach an app provider (query locator)",
        "tags": [
          "Apps"
        ],
        "x-alias-of": "Detach_an_app_provider",
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Adds the shared provider to the app; other attachments are kept. `primary: true` moves it first. Uses the app ETag. Inline apps must be converted first (409 provider_migration_required).\n\nQuery-locator alias of Attach_a_shared_provider: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Attach_a_shared_provider_query",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "primary": false
              },
              "schema": {
                "$ref": "#/components/schemas/Attachment"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Attach a shared provider (query locator)",
        "tags": [
          "Apps"
        ],
        "x-alias-of": "Attach_a_shared_provider",
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/self-service-keys": {
      "get": {
        "description": "Personal (self-service) API keys of one app, newest first, metadata only: never a key value. Filter by user_email and status (active, expired or revoked); page with limit (1 to 200, default 50) and cursor.\n\nQuery-locator alias of List_personal_api_keys: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "List_personal_api_keys_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this person's keys (case-insensitive).",
            "in": "query",
            "name": "user_email",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only keys in this state; omit for all.",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "active",
                "expired",
                "revoked"
              ]
            }
          },
          {
            "description": "Page size: 1 to 200, default 50.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app_name": "Support Bot",
                  "items": [
                    {
                      "app_name": "Support Bot",
                      "created_at": "2026-11-03T09:00:00.000Z",
                      "created_via": "management_api",
                      "expires_at": "2027-02-01T09:00:00.000Z",
                      "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                      "key_name": "laptop-cli",
                      "last_used_at": null,
                      "revoked_at": null,
                      "status": "active",
                      "user_email": "dana@example.com",
                      "version": "9b2e4f0c7a1d"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "status_counts": {
                    "active": 1,
                    "expired": 0,
                    "revoked": 0
                  },
                  "total": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List an app's personal API keys (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "List_personal_api_keys",
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "Create a personal API key on a person's behalf. The person needs self-service access to the app exactly as if they created the key themselves: the app must allow personal API keys (user API-key mode), and the person must hold the self-service viewer role (a requester or direct-update role implies it; a deny wins). The app's maximum key lifetime applies, and an omitted expires_in_days takes it (the key never expires only when the app sets no maximum). Names are unique among the person's active keys of the app (case-insensitive), and the per-person limit of active keys applies. The key value is in this response only: a retry with the same Idempotency-Key and body replays it for 24 hours, after which it is never shown again. Calls authenticate as the person.\n\nQuery-locator alias of Issue_a_personal_api_key: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Issue_a_personal_api_key_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result (including the key value) for 24 hours; the same key with a different body is a 409.",
            "example": "issue-dana-laptop-cli-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_in_days": 90,
                "key_name": "laptop-cli",
                "user_email": "dana@example.com"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceKeyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "app_name": "Support Bot",
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "created_via": "management_api",
                    "expires_at": "2027-02-01T09:00:00.000Z",
                    "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                    "key_name": "laptop-cli",
                    "last_used_at": null,
                    "revoked_at": null,
                    "secret": "sk-quilr-example:ss1.0a1b2c.d3e4",
                    "status": "active",
                    "user_email": "dana@example.com",
                    "version": "9b2e4f0c7a1d"
                  },
                  "operation_id": "6f0c3c1e-8f3a-4c43-9d7e-2a1b5c9d0e11",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyCreated"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Issue a personal API key for a user (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Issue_a_personal_api_key",
        "x-scopes": [
          "keys:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/self-service-keys/{key_id}": {
      "delete": {
        "description": "Revoke the key at once; it stops authenticating. Revocation is permanent. Applies to any personal key of the app, including keys the person created themselves; the person's current access is not checked. Send the key's version in If-Match to guard against concurrent changes (optional).\n\nQuery-locator alias of Revoke_a_personal_api_key: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Revoke_a_personal_api_key_query",
        "parameters": [
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional quoted version from the latest read of the key; 412 when it changed.",
            "example": "\"9b2e4f0c7a1d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "app_name": "Support Bot",
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "created_via": "management_api",
                    "expires_at": "2027-02-01T09:00:00.000Z",
                    "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                    "key_name": "laptop-cli",
                    "last_used_at": null,
                    "revoked_at": "2026-11-04T10:00:00.000Z",
                    "status": "revoked",
                    "user_email": "dana@example.com",
                    "version": "9b2e4f0c7a1d"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Revoke a personal API key (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Revoke_a_personal_api_key",
        "x-scopes": [
          "keys:write"
        ]
      },
      "get": {
        "description": "One personal API key of the app, metadata only.\n\nQuery-locator alias of Read_a_personal_api_key: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Read_a_personal_api_key_query",
        "parameters": [
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "app_name": "Support Bot",
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "created_via": "management_api",
                    "expires_at": "2027-02-01T09:00:00.000Z",
                    "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                    "key_name": "laptop-cli",
                    "last_used_at": null,
                    "revoked_at": null,
                    "status": "active",
                    "user_email": "dana@example.com",
                    "version": "9b2e4f0c7a1d"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a personal API key (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Read_a_personal_api_key",
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Rename the key (unique among its owner's active keys of the app) and/or set a new expiry counted from now, capped by the app's maximum key lifetime. Revoked keys cannot be changed, and expired keys cannot get a new expiry. Applies to any personal key of the app, including keys the person created themselves; the person's current access is not checked. Send the key's version in If-Match to guard against concurrent changes (optional).\n\nQuery-locator alias of Rename_or_re_expire_a_personal_api_key: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Rename_or_re_expire_a_personal_api_key_query",
        "parameters": [
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional quoted version from the latest read of the key; 412 when it changed.",
            "example": "\"9b2e4f0c7a1d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_in_days": 30,
                "key_name": "build-agent"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceKeyPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "app_name": "Support Bot",
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "created_via": "management_api",
                    "expires_at": "2027-02-01T09:00:00.000Z",
                    "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                    "key_name": "build-agent",
                    "last_used_at": null,
                    "revoked_at": null,
                    "status": "active",
                    "user_email": "dana@example.com",
                    "version": "9b2e4f0c7a1d"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Rename a personal API key or change its expiry (query locator)",
        "tags": [
          "Credentials"
        ],
        "x-alias-of": "Rename_or_re_expire_a_personal_api_key",
        "x-scopes": [
          "keys:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/self-service-owners": {
      "put": {
        "description": "Up to 20 emails; [] removes every owner. Owners review the app's budget and access requests. On an app a developer created from a blueprint, owners can also see its keys and logs and disable or delete it. Owners are part of the app's settings: this write and app updates (PATCH /apps/{app_name}) never overwrite each other's changes, and a PATCH that omits owners keeps them.\n\nQuery-locator alias of Set_self_service_app_owners: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Set_self_service_app_owners_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "owners": [
                  "dana@example.com"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceAppOwners"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "after": {
                    "owners": [
                      "dana@example.com"
                    ]
                  },
                  "app_name": "Support Bot",
                  "before": {
                    "owners": []
                  },
                  "owners": [
                    "dana@example.com"
                  ],
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceAppOwnersResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Set an app's owners (query locator)",
        "tags": [
          "Users"
        ],
        "x-alias-of": "Set_self_service_app_owners",
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/app/versions": {
      "get": {
        "description": "Saved configuration versions of the app, newest first: version metadata only (id, version, time, operation, actor). Read one version for its before and after snapshots.\n\nQuery-locator alias of List_app_configuration_versions: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "List_app_configuration_versions_query",
        "parameters": [
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/VersionList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List app configuration versions (query locator)",
        "tags": [
          "History"
        ],
        "x-alias-of": "List_app_configuration_versions",
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/app/versions/{version_id}": {
      "get": {
        "description": "One configuration version with before and after snapshots (secret values omitted).\n\nQuery-locator alias of Read_a_configuration_version: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Read_a_configuration_version_query",
        "parameters": [
          {
            "example": "ver_01",
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "version_record": {
                    "actor_email": null,
                    "actor_type": "management_api",
                    "actor_user_id": "2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "changed_at": "2026-09-24T12:00:00Z",
                    "new_config": {},
                    "operation": "management_update",
                    "previous_config": {},
                    "version": 4,
                    "version_id": "ver_01"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a configuration version (query locator)",
        "tags": [
          "History"
        ],
        "x-alias-of": "Read_a_configuration_version",
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/app/versions/{version_id}/rollback": {
      "post": {
        "description": "Restores the app settings saved in a version. Provider credentials and QuilrQL policy are not rolled back. Requires the current app ETag and an Idempotency-Key.\n\nQuery-locator alias of Roll_back_app_configuration: pass the app name in the app_name query parameter (URL-encoded once). Use it for names containing `/` or a literal `%`.",
        "operationId": "Roll_back_app_configuration_query",
        "parameters": [
          {
            "example": "ver_01",
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact app name; encode with standard query URL encoding.",
            "example": "Support Bot",
            "in": "query",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Roll back app configuration (query locator)",
        "tags": [
          "History"
        ],
        "x-alias-of": "Roll_back_app_configuration",
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps": {
      "get": {
        "description": "Apps of the tenant with their stored settings. Filters: `name` (case-insensitive substring), `tag` (exact), `enabled` (true or false), `origin` (`blueprint`: apps people created from a blueprint in self-service; `admin`: every other app) and `created_by` (the email of the person who created the app from a blueprint).",
        "operationId": "List_apps",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case-insensitive substring of the app name.",
            "in": "query",
            "name": "name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact tag.",
            "in": "query",
            "name": "tag",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "enabled",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "blueprint: apps people created from a blueprint in self-service (they carry `origin`); admin: every other app.",
            "in": "query",
            "name": "origin",
            "schema": {
              "enum": [
                "blueprint",
                "admin"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only apps this person created from a blueprint (email, case-insensitive).",
            "in": "query",
            "name": "created_by",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "access": {},
                      "detection": {
                        "custom_definitions": [],
                        "enabled_categories": {}
                      },
                      "enabled": true,
                      "limits": {},
                      "mode": "gateway",
                      "name": "Support Bot",
                      "policy_authority": {
                        "active_checksum": null,
                        "active_revision": null,
                        "enabled": false
                      },
                      "prompts": {
                        "universal_system_prompt": {
                          "content": "",
                          "enabled": false
                        }
                      },
                      "provider_labels": [
                        "Production OpenAI"
                      ],
                      "provider_mode": "shared",
                      "routing": {
                        "custom_routing": [],
                        "routing_groups": [],
                        "token_based_routing_groups": []
                      },
                      "self_service": {},
                      "tags": [
                        "production"
                      ],
                      "transformations": {},
                      "version": "3f1c0a9e5b7d"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/AppList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List apps",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "Creates an app and issues its first gateway key (returned once in `key.secret`). Requires both config:write and credentials:write. When QuilrQL governs the tenant, the app's configured models are allowed for all its users by default and a `quilrql_governs_app` warning is returned. If that default policy would exceed the tenant's QuilrQL capacity (1,000 policies), creation is refused with 422 policy_capacity_exceeded (`limits`, `exceeded`) before anything is written. Retrying with the same Idempotency-Key returns the same app and key.",
        "operationId": "Create_an_app",
        "parameters": [
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "sdk": {
                  "summary": "SDK app with limits and a named first key",
                  "value": {
                    "initial_key": {
                      "expires_at": "2027-01-01T00:00:00Z",
                      "name": "Backend"
                    },
                    "limits": {
                      "rate_limit_per_minute": 600,
                      "timeout": 30
                    },
                    "mode": "sdk",
                    "name": "Claims SDK"
                  }
                },
                "shared": {
                  "summary": "Gateway app using a shared provider",
                  "value": {
                    "name": "Support Bot",
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "tags": [
                      "production"
                    ]
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/AppCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "secret": "<new-gateway-key>",
                    "status": "active"
                  },
                  "operation_id": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppCreated"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create an app",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write",
          "credentials:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}": {
      "get": {
        "description": "Stored settings of one app, grouped by section, with secret values omitted. `version` is the app ETag used by every app write, including prompts, attachments and rollback.",
        "operationId": "Read_an_app",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read an app",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Partial update: only the fields you send change, and fields inside a section merge. Set `enabled` to false to disable the app (its keys stop working until it is re-enabled). Send the quoted version from the latest read in If-Match. Settings governed by an active QuilrQL policy are saved but reported in an `inactive_under_quilrql` warning; routing members that cannot serve every client API produce non-blocking warnings.",
        "operationId": "Update_or_disable_an_app",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "detection": {
                  "summary": "Redact data risks and set a timeout",
                  "value": {
                    "detection": {
                      "data_risk_action": "redact"
                    },
                    "limits": {
                      "timeout": 30
                    }
                  }
                },
                "disable": {
                  "summary": "Disable the app",
                  "value": {
                    "enabled": false
                  }
                },
                "rate_limit": {
                  "summary": "Limit requests per hour",
                  "value": {
                    "limits": {
                      "rate_limit": {
                        "duration": "hour",
                        "value": 1000
                      }
                    }
                  }
                },
                "system_prompt": {
                  "summary": "Prepend a universal system prompt",
                  "value": {
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "Answer only questions about Acme products.",
                        "enabled": true
                      }
                    }
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/AppPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {
                      "timeout": 30
                    },
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update or disable an app",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/keys": {
      "get": {
        "description": "Gateway keys of the app: metadata, a short fingerprint and recent usage, never the secret.",
        "operationId": "List_gateway_credentials",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "created_at": "2026-09-24T12:00:00Z",
                      "expires_at": null,
                      "fingerprint": "0123456789ab",
                      "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                      "name": "Default",
                      "status": "active",
                      "usage": {
                        "last_used_at": "2026-10-30T17:42:08Z",
                        "requests_30d": 18234
                      }
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List gateway credentials",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "Issues another gateway key for the app; the secret is returned once (and on an idempotent replay). Names are unique among the app's active and expired keys.",
        "operationId": "Issue_a_gateway_credential",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_at": "2027-01-01T00:00:00Z",
                "name": "Deployment"
              },
              "schema": {
                "$ref": "#/components/schemas/GatewayKeyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Deployment",
                    "secret": "<new-gateway-key>",
                    "status": "active"
                  },
                  "operation_id": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyIssued"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Issue a gateway credential",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "credentials:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/keys/{key_id}": {
      "delete": {
        "description": "Revokes the key immediately and permanently. Revoking an already revoked key returns it unchanged. Send the quoted version from the latest read in If-Match.",
        "operationId": "Revoke_a_gateway_credential",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "status": "revoked"
                  },
                  "request_id": "req_example",
                  "version": "8f7e6d5c4b3a"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Revoke a gateway credential",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "credentials:write"
        ]
      },
      "get": {
        "description": "Metadata and recent usage of one gateway key, and its version (ETag).",
        "operationId": "Get_key",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "status": "active",
                    "usage": {
                      "last_used_at": "2026-10-30T17:42:08Z",
                      "requests_30d": 18234
                    }
                  },
                  "request_id": "req_example",
                  "version": "7e6d5c4b3a29"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a gateway credential",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Renames a key (`name`, unique among active and expired keys: 409 duplicate_key_name) and/or sets or clears (null) the expiry of an active key. Revoked keys cannot change; expired keys can only be renamed (409 terminal_key_state). Send the quoted version from the latest read in If-Match.",
        "operationId": "Change_gateway_key_expiry",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "clear": {
                  "summary": "Never expire",
                  "value": {
                    "expires_at": null
                  }
                },
                "rename": {
                  "summary": "Rename",
                  "value": {
                    "name": "ci-runner"
                  }
                },
                "set": {
                  "summary": "Expire on a date",
                  "value": {
                    "expires_at": "2027-01-01T00:00:00Z"
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/GatewayKeyPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": "2027-01-01T00:00:00Z",
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "status": "active"
                  },
                  "request_id": "req_example",
                  "version": "8f7e6d5c4b3a"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Rename a gateway key or change its expiry",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "credentials:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/keys/{key_id}/reveal": {
      "post": {
        "description": "Returns the secret of an active key. Expired or revoked keys return 409 terminal_key_state. Every reveal is recorded in the audit trail.",
        "operationId": "Reveal_a_gateway_credential",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "expires_at": null,
                    "fingerprint": "0123456789ab",
                    "key_id": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
                    "name": "Default",
                    "secret": "<gateway-key>",
                    "status": "active"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayKeyResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Reveal a gateway credential",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "credentials:read"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/prompts": {
      "get": {
        "description": "Stored prompts of the app, sorted by prompt_id, with the app version.",
        "operationId": "List_prompts",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "content": "You help customers with support questions.",
                      "created_at": "2026-09-24T12:00:00Z",
                      "prompt_id": "support",
                      "updated_at": "2026-09-24T12:00:00Z"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "version": "3f1c0a9e5b7d"
                },
                "schema": {
                  "$ref": "#/components/schemas/PromptList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List prompts",
        "tags": [
          "Prompts"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/prompts/{prompt_id}": {
      "delete": {
        "description": "Deletes a stored prompt. Uses the app ETag.",
        "operationId": "Delete_a_prompt",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "support",
            "in": "path",
            "name": "prompt_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "prompt": null,
                  "prompt_id": "support",
                  "request_id": "req_example",
                  "version": "5b3d2c1e0f9a"
                },
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a prompt",
        "tags": [
          "Prompts"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One stored prompt and the app version.",
        "operationId": "Read_a_prompt",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "support",
            "in": "path",
            "name": "prompt_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "prompt": {
                    "content": "You help customers with support questions.",
                    "created_at": "2026-09-24T12:00:00Z",
                    "updated_at": "2026-09-24T12:00:00Z"
                  },
                  "prompt_id": "support",
                  "request_id": "req_example",
                  "version": "3f1c0a9e5b7d"
                },
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a prompt",
        "tags": [
          "Prompts"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) a prompt. prompt_id is 1-200 letters, digits, `_` or `-`. Creating a new prompt needs no If-Match; replacing or deleting one uses the app ETag in If-Match (428 without it).",
        "operationId": "Create_or_replace_a_prompt",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "support",
            "in": "path",
            "name": "prompt_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version. Optional when creating a new prompt; required (428) to replace an existing one.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "content": "You help customers with support questions."
              },
              "schema": {
                "$ref": "#/components/schemas/Prompt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "prompt": {
                    "content": "You help customers with support questions.",
                    "created_at": "2026-09-24T12:00:00Z",
                    "updated_at": "2026-09-24T12:00:00Z"
                  },
                  "prompt_id": "support",
                  "request_id": "req_example",
                  "version": "4a2c1b0d9e8f"
                },
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a prompt",
        "tags": [
          "Prompts"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/provider-conversion": {
      "post": {
        "description": "Moves an inline app (legacy per-app credentials) to shared providers in one step: send the complete list of shared-provider labels and, optionally, routing rewritten to reference them. Uses the app ETag; 409 already_converted when the app already uses shared providers.",
        "operationId": "Convert_inline_providers",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "provider_labels": [
                  "Production OpenAI"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/Conversion"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Convert inline providers",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/providers": {
      "get": {
        "description": "Ordered shared-provider labels attached to the app (the first is primary) and the app version. Not paginated.",
        "operationId": "List_app_providers",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "provider_labels": [
                    "Production OpenAI"
                  ],
                  "request_id": "req_example",
                  "version": "3f1c0a9e5b7d"
                },
                "schema": {
                  "$ref": "#/components/schemas/AttachmentList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List app providers",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/providers/{label}": {
      "delete": {
        "description": "Removes the provider from the app after checking the remaining routes still resolve. Uses the app ETag. While QuilrQL governs the tenant, removal is refused (409 policy_dependency, with the rules as references) only when an active rule that can apply to the app names the provider; edit those rules first (GET /controls/references?provider_label=).",
        "operationId": "Detach_an_app_provider",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Detach an app provider",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Adds the shared provider to the app; other attachments are kept. `primary: true` moves it first. Uses the app ETag. Inline apps must be converted first (409 provider_migration_required).",
        "operationId": "Attach_a_shared_provider",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "primary": false
              },
              "schema": {
                "$ref": "#/components/schemas/Attachment"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Attach a shared provider",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/self-service-keys": {
      "get": {
        "description": "Personal (self-service) API keys of one app, newest first, metadata only: never a key value. Filter by user_email and status (active, expired or revoked); page with limit (1 to 200, default 50) and cursor.",
        "operationId": "List_personal_api_keys",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this person's keys (case-insensitive).",
            "in": "query",
            "name": "user_email",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only keys in this state; omit for all.",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "active",
                "expired",
                "revoked"
              ]
            }
          },
          {
            "description": "Page size: 1 to 200, default 50.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app_name": "Support Bot",
                  "items": [
                    {
                      "app_name": "Support Bot",
                      "created_at": "2026-11-03T09:00:00.000Z",
                      "created_via": "management_api",
                      "expires_at": "2027-02-01T09:00:00.000Z",
                      "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                      "key_name": "laptop-cli",
                      "last_used_at": null,
                      "revoked_at": null,
                      "status": "active",
                      "user_email": "dana@example.com",
                      "version": "9b2e4f0c7a1d"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "status_counts": {
                    "active": 1,
                    "expired": 0,
                    "revoked": 0
                  },
                  "total": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List an app's personal API keys",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "Create a personal API key on a person's behalf. The person needs self-service access to the app exactly as if they created the key themselves: the app must allow personal API keys (user API-key mode), and the person must hold the self-service viewer role (a requester or direct-update role implies it; a deny wins). The app's maximum key lifetime applies, and an omitted expires_in_days takes it (the key never expires only when the app sets no maximum). Names are unique among the person's active keys of the app (case-insensitive), and the per-person limit of active keys applies. The key value is in this response only: a retry with the same Idempotency-Key and body replays it for 24 hours, after which it is never shown again. Calls authenticate as the person.",
        "operationId": "Issue_a_personal_api_key",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result (including the key value) for 24 hours; the same key with a different body is a 409.",
            "example": "issue-dana-laptop-cli-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_in_days": 90,
                "key_name": "laptop-cli",
                "user_email": "dana@example.com"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceKeyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "app_name": "Support Bot",
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "created_via": "management_api",
                    "expires_at": "2027-02-01T09:00:00.000Z",
                    "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                    "key_name": "laptop-cli",
                    "last_used_at": null,
                    "revoked_at": null,
                    "secret": "sk-quilr-example:ss1.0a1b2c.d3e4",
                    "status": "active",
                    "user_email": "dana@example.com",
                    "version": "9b2e4f0c7a1d"
                  },
                  "operation_id": "6f0c3c1e-8f3a-4c43-9d7e-2a1b5c9d0e11",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyCreated"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Issue a personal API key for a user",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "keys:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/self-service-keys/{key_id}": {
      "delete": {
        "description": "Revoke the key at once; it stops authenticating. Revocation is permanent. Applies to any personal key of the app, including keys the person created themselves; the person's current access is not checked. Send the key's version in If-Match to guard against concurrent changes (optional).",
        "operationId": "Revoke_a_personal_api_key",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional quoted version from the latest read of the key; 412 when it changed.",
            "example": "\"9b2e4f0c7a1d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "app_name": "Support Bot",
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "created_via": "management_api",
                    "expires_at": "2027-02-01T09:00:00.000Z",
                    "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                    "key_name": "laptop-cli",
                    "last_used_at": null,
                    "revoked_at": "2026-11-04T10:00:00.000Z",
                    "status": "revoked",
                    "user_email": "dana@example.com",
                    "version": "9b2e4f0c7a1d"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Revoke a personal API key",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "keys:write"
        ]
      },
      "get": {
        "description": "One personal API key of the app, metadata only.",
        "operationId": "Read_a_personal_api_key",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "app_name": "Support Bot",
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "created_via": "management_api",
                    "expires_at": "2027-02-01T09:00:00.000Z",
                    "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                    "key_name": "laptop-cli",
                    "last_used_at": null,
                    "revoked_at": null,
                    "status": "active",
                    "user_email": "dana@example.com",
                    "version": "9b2e4f0c7a1d"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a personal API key",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Rename the key (unique among its owner's active keys of the app) and/or set a new expiry counted from now, capped by the app's maximum key lifetime. Revoked keys cannot be changed, and expired keys cannot get a new expiry. Applies to any personal key of the app, including keys the person created themselves; the person's current access is not checked. Send the key's version in If-Match to guard against concurrent changes (optional).",
        "operationId": "Rename_or_re_expire_a_personal_api_key",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "6b0e2c1a-4f3d-4c55-9a1e-0d2b7f8c9e10",
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Optional quoted version from the latest read of the key; 412 when it changed.",
            "example": "\"9b2e4f0c7a1d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_in_days": 30,
                "key_name": "build-agent"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceKeyPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "key": {
                    "app_name": "Support Bot",
                    "created_at": "2026-11-03T09:00:00.000Z",
                    "created_via": "management_api",
                    "expires_at": "2027-02-01T09:00:00.000Z",
                    "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                    "key_name": "build-agent",
                    "last_used_at": null,
                    "revoked_at": null,
                    "status": "active",
                    "user_email": "dana@example.com",
                    "version": "9b2e4f0c7a1d"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Rename a personal API key or change its expiry",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "keys:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/self-service-owners": {
      "put": {
        "description": "Up to 20 emails; [] removes every owner. Owners review the app's budget and access requests. On an app a developer created from a blueprint, owners can also see its keys and logs and disable or delete it. Owners are part of the app's settings: this write and app updates (PATCH /apps/{app_name}) never overwrite each other's changes, and a PATCH that omits owners keeps them.",
        "operationId": "Set_self_service_app_owners",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "owners": [
                  "dana@example.com"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceAppOwners"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "after": {
                    "owners": [
                      "dana@example.com"
                    ]
                  },
                  "app_name": "Support Bot",
                  "before": {
                    "owners": []
                  },
                  "owners": [
                    "dana@example.com"
                  ],
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceAppOwnersResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Set an app's owners",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/versions": {
      "get": {
        "description": "Saved configuration versions of the app, newest first: version metadata only (id, version, time, operation, actor). Read one version for its before and after snapshots.",
        "operationId": "List_app_configuration_versions",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/VersionList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List app configuration versions",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/versions/{version_id}": {
      "get": {
        "description": "One configuration version with before and after snapshots (secret values omitted).",
        "operationId": "Read_a_configuration_version",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "ver_01",
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "version_record": {
                    "actor_email": null,
                    "actor_type": "management_api",
                    "actor_user_id": "2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "changed_at": "2026-09-24T12:00:00Z",
                    "new_config": {},
                    "operation": "management_update",
                    "previous_config": {},
                    "version": 4,
                    "version_id": "ver_01"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a configuration version",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/versions/{version_id}/rollback": {
      "post": {
        "description": "Restores the app settings saved in a version. Provider credentials and QuilrQL policy are not rolled back. Requires the current app ETag and an Idempotency-Key.",
        "operationId": "Roll_back_app_configuration",
        "parameters": [
          {
            "description": "Exact app name, URL-encoded.",
            "example": "Support Bot",
            "in": "path",
            "name": "app_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "ver_01",
            "in": "path",
            "name": "version_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "request_id": "req_example",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/AppResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Roll back app configuration",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/audit": {
      "get": {
        "description": "Management events of the tenant, newest first: actor, operation, resource, result and time. Rejected writes are recorded with their error code. Events are kept for 90 days. New events never invalidate a cursor.",
        "operationId": "Get_audit",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact actor (a management key id or administrator).",
            "in": "query",
            "name": "actor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact operation, for example provider_update.",
            "in": "query",
            "name": "operation",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact resource name or id as recorded.",
            "in": "query",
            "name": "resource",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Inclusive start: RFC 3339 time, date (UTC midnight) or epoch seconds.",
            "in": "query",
            "name": "since",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exclusive end: RFC 3339 time, date (UTC midnight) or epoch seconds.",
            "in": "query",
            "name": "until",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "actor": "2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                      "changes": {},
                      "created_at": 1790251200.0,
                      "event_id": "evt_01",
                      "operation": "provider_create",
                      "request_id": "req_example",
                      "resource": "Production OpenAI",
                      "result": "committed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/AuditPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List audit events",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/budget-alert-destinations": {
      "get": {
        "description": "Webhooks that receive budget alerts. Targets are redacted on read.",
        "operationId": "Read_budget_alert_destinations",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "destinations": [
                    {
                      "enabled": true,
                      "id": "ops-webhook",
                      "kind": "webhook",
                      "target": "https://hooks.example.com/..."
                    }
                  ],
                  "etag": "\"a1b2c3\"",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetAlertDestinationsView"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read budget alert destinations",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      },
      "put": {
        "description": "Replaces the whole destination list. Omit `target` (or send the redacted read value) to keep a stored URL. Optional If-Match with the etag from the read.",
        "operationId": "Replace_budget_alert_destinations",
        "parameters": [
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "destinations": [
                  {
                    "enabled": true,
                    "id": "ops-webhook",
                    "kind": "webhook",
                    "target": "https://hooks.example.com/services/budget"
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetAlertDestinations"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "destinations": [
                    {
                      "enabled": true,
                      "id": "ops-webhook",
                      "kind": "webhook",
                      "target": "https://hooks.example.com/..."
                    }
                  ],
                  "etag": "\"d4e5f6\"",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetAlertDestinationsView"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Replace budget alert destinations",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-alerts": {
      "get": {
        "description": "Alerts that fired, newest first. Filter by since, until, subject and quota_id (budget id).",
        "operationId": "List_budget_alerts",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO timestamp (default: 30 days before until).",
            "in": "query",
            "name": "since",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO timestamp (default: now).",
            "in": "query",
            "name": "until",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Subject bucket or a value inside it.",
            "in": "query",
            "name": "subject",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Budget id.",
            "in": "query",
            "name": "quota_id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "available": true,
                  "items": [
                    {
                      "fired_at": "2026-10-14T16:20:00Z",
                      "id": "alr_01",
                      "quota": {
                        "id": "support_spend",
                        "kind": "budget",
                        "label": "Support spend",
                        "metric": "spend_usd",
                        "mode": "enforce"
                      }
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetAlertsPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List budget alerts",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/budget-events": {
      "get": {
        "description": "Grant changes and budget policy edits made through the API, oldest first after `after` (a next_cursor or an ISO timestamp), so a client can poll for new events. Filter by type, budget_id, grant_id and subject.",
        "operationId": "List_budget_events",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page, or an ISO timestamp.",
            "in": "query",
            "name": "after",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Event type, for example grant.created.",
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Budget id.",
            "in": "query",
            "name": "budget_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Grant id.",
            "in": "query",
            "name": "grant_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Subject bucket or a value inside it.",
            "in": "query",
            "name": "subject",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "has_more": false,
                  "items": [
                    {
                      "actor": "management_key:2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                      "after": {
                        "limit": "25.00"
                      },
                      "before": null,
                      "bucket": "user.email=alice@example.com",
                      "budget_id": "support_spend",
                      "event_id": "bev_01",
                      "grant_id": "grt_4f9a2c1b7e3d",
                      "occurred_at": "2026-10-01T09:00:00Z",
                      "subject": {
                        "user": "alice@example.com"
                      },
                      "type": "grant.created"
                    }
                  ],
                  "next_cursor": "2026-10-01T09:00:00Z",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEventsPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List budget events",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/budget-exemptions": {
      "get": {
        "description": "Exemptions of the active policy: which users, apps or smart groups skip which budgets, until when.",
        "operationId": "List_budget_exemptions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r12\"",
                  "items": [
                    {
                      "applies_to": {
                        "users": [
                          "ceo@example.com"
                        ]
                      },
                      "id": "ex_3e1f0a9b8c7d",
                      "quotas": "all",
                      "reason": "Executive access"
                    }
                  ],
                  "request_id": "req_example",
                  "revision": 12
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetExemptionList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List budget exemptions",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      },
      "post": {
        "description": "Exempts users, apps or smart groups from all or listed budgets, optionally until expires_at. Publishes a policy revision (201; 200 with dry_run).",
        "operationId": "Create_a_budget_exemption",
        "parameters": [
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409. Not needed with dry_run=true.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "applies_to": {
                  "users": [
                    "ceo@example.com"
                  ]
                },
                "expires_at": "2026-12-31T23:59:59Z",
                "quotas": "all",
                "reason": "Executive access"
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetExemption"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "create_exemption"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create a budget exemption",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-exemptions/{exemption_id}": {
      "delete": {
        "description": "Removes an exemption and publishes a policy revision.",
        "operationId": "Delete_a_budget_exemption",
        "parameters": [
          {
            "example": "ex_3e1f0a9b8c7d",
            "in": "path",
            "name": "exemption_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetDelete"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "delete_exemption"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a budget exemption",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-forecast": {
      "get": {
        "description": "Subjects of every calendar budget that are already at their limit or, at their rate over the lookback, will reach it within `within` (default 7d) and before their window resets. Soonest first. Rolling and lifetime budgets are listed in `not_forecast`.",
        "operationId": "Read_budget_forecast",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Whole hours or days such as 7d (default), up to 31d: subjects projected to reach their limit within it.",
            "in": "query",
            "name": "within",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Duration the rate is measured over, such as 24h (default) or 7d; at most 31d.",
            "in": "query",
            "name": "lookback",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Budget id.",
            "in": "query",
            "name": "budget_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "false leaves out subjects already at their limit.",
            "in": "query",
            "name": "include_exhausted",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "as_of": "2026-10-15T10:00:00Z",
                  "items": [
                    {
                      "bucket": "user.email=alice@example.com",
                      "budget": {
                        "id": "support_spend",
                        "label": "Support spend",
                        "metric": "spend_usd",
                        "mode": "enforce"
                      },
                      "effective_limit": "12.50",
                      "forecast": {
                        "exhausted": false,
                        "exhausts_at": "2026-10-15T19:10:00Z",
                        "lookback_hours": 24.0,
                        "projected_pct": 277.44,
                        "projected_total": "34.68",
                        "rate_per_hour": "0.12"
                      },
                      "grant": null,
                      "pct": 81.6,
                      "state": "alerting",
                      "subject": {
                        "user": "alice@example.com"
                      },
                      "used": "10.20"
                    }
                  ],
                  "lookback": "24h",
                  "method": "linear: rate over the lookback, held until the window resets",
                  "next_cursor": null,
                  "period": "current",
                  "request_id": "req_example",
                  "revision": 12,
                  "snapshot": "2026-10-15T10:00:00Z",
                  "stale": false,
                  "total": 1,
                  "within": "7d"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetForecastPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read budget forecast",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/budget-grants": {
      "get": {
        "description": "Grants across budgets. Filter by budget_id, bucket, status, expires_before, expires_after and subject; sort by created_at (newest first, default) or expires_at (soonest first; grants with no end date last). `status`: active (in effect now), scheduled (starts later), expired, revoked, superseded or all (default). `ends_within=7d` lists the active grants ending in the next 7 days, soonest first. `include_usage=true` adds each grant's current used amount and percent of its limit; `base_limit` is the limit that applies again when a grant ends.",
        "operationId": "List_budget_grants",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Budget id.",
            "in": "query",
            "name": "budget_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical subject bucket.",
            "in": "query",
            "name": "bucket",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "all (default), active (in effect now), scheduled (starts later), revoked, superseded or expired.",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "admin (written through this API or the console) or auto (automatic raises).",
            "in": "query",
            "name": "source",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO timestamp.",
            "in": "query",
            "name": "expires_before",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ISO timestamp.",
            "in": "query",
            "name": "expires_after",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Whole hours or days such as 12h or 7d: active grants ending within it, soonest first.",
            "in": "query",
            "name": "ends_within",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort order, for example pct, used or remaining; grants: created_at (default) or expires_at.",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true adds each grant's current used amount and percent of its limit.",
            "in": "query",
            "name": "include_usage",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "User email.",
            "in": "query",
            "name": "subject.user",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "App name.",
            "in": "query",
            "name": "subject.app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Smart group name.",
            "in": "query",
            "name": "subject.smart_group",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Model id.",
            "in": "query",
            "name": "subject.model",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Smart group name: that group's Smart group grant.",
            "in": "query",
            "name": "subject.members_of",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "actor": "management_key:2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                      "base_limit": "12.50",
                      "bucket": "user.email=alice@example.com",
                      "budget_id": "support_spend",
                      "budget_label": "Support spend",
                      "created_at": "2026-10-01T09:00:00Z",
                      "etag": "\"1790845200000000\"",
                      "expires_at": "2026-10-31T23:59:59Z",
                      "id": "grt_4f9a2c1b7e3d",
                      "limit": "25.00",
                      "metric": "spend_usd",
                      "no_end_date": false,
                      "reason": "Quarter-end ticket surge",
                      "source": "admin",
                      "starts_at": "2026-10-01T00:00:00Z",
                      "status": "active",
                      "subject": {
                        "user": "alice@example.com"
                      },
                      "updated_at": "2026-10-01T09:00:00Z",
                      "usage": {
                        "pct": 73.6,
                        "used": "18.40"
                      },
                      "version": 1790845200000000
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "usage_as_of": "2026-10-28T10:00:00Z",
                  "usage_stale": false
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetGrantList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List budget grants",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/budget-grants/{grant_id}": {
      "delete": {
        "description": "Revokes a grant; the subject returns to the base limit. A reason may be sent in the body or the reason query parameter. Requires the grant etag in If-Match.",
        "operationId": "Revoke_a_budget_grant",
        "parameters": [
          {
            "example": "grt_4f9a2c1b7e3d",
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Why the grant is revoked.",
            "in": "query",
            "name": "reason",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetGrantRevoke"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"1790850000000000\"",
                  "grant": {
                    "actor": "management_key:2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "base_limit": "12.50",
                    "bucket": "user.email=alice@example.com",
                    "budget_id": "support_spend",
                    "budget_label": "Support spend",
                    "created_at": "2026-10-01T09:00:00Z",
                    "etag": "\"1790845200000000\"",
                    "expires_at": "2026-10-31T23:59:59Z",
                    "id": "grt_4f9a2c1b7e3d",
                    "limit": "25.00",
                    "metric": "spend_usd",
                    "no_end_date": false,
                    "reason": "Quarter-end ticket surge",
                    "source": "admin",
                    "starts_at": "2026-10-01T00:00:00Z",
                    "status": "revoked",
                    "subject": {
                      "user": "alice@example.com"
                    },
                    "updated_at": "2026-10-01T09:00:00Z",
                    "version": 1790845200000000
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetGrantResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Revoke a budget grant",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:grant"
        ]
      },
      "get": {
        "description": "One grant and its etag, used as If-Match on grant writes.",
        "operationId": "Read_a_budget_grant",
        "parameters": [
          {
            "example": "grt_4f9a2c1b7e3d",
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"1790845200000000\"",
                  "grant": {
                    "actor": "management_key:2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "base_limit": "12.50",
                    "bucket": "user.email=alice@example.com",
                    "budget_id": "support_spend",
                    "budget_label": "Support spend",
                    "created_at": "2026-10-01T09:00:00Z",
                    "etag": "\"1790845200000000\"",
                    "expires_at": "2026-10-31T23:59:59Z",
                    "id": "grt_4f9a2c1b7e3d",
                    "limit": "25.00",
                    "metric": "spend_usd",
                    "no_end_date": false,
                    "reason": "Quarter-end ticket surge",
                    "source": "admin",
                    "starts_at": "2026-10-01T00:00:00Z",
                    "status": "active",
                    "subject": {
                      "user": "alice@example.com"
                    },
                    "updated_at": "2026-10-01T09:00:00Z",
                    "version": 1790845200000000
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetGrantResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a budget grant",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      },
      "patch": {
        "description": "Changes the limit (or extra), expiry or reason of an active or scheduled grant. `limit` makes the grant absolute, `extra` makes it follow the base. Requires the grant etag in If-Match.",
        "operationId": "Update_a_budget_grant",
        "parameters": [
          {
            "example": "grt_4f9a2c1b7e3d",
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "limit": "30",
                "reason": "Extended surge"
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetGrantPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"1790850000000000\"",
                  "grant": {
                    "actor": "management_key:2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "base_limit": "12.50",
                    "bucket": "user.email=alice@example.com",
                    "budget_id": "support_spend",
                    "budget_label": "Support spend",
                    "created_at": "2026-10-01T09:00:00Z",
                    "etag": "\"1790845200000000\"",
                    "expires_at": "2026-10-31T23:59:59Z",
                    "id": "grt_4f9a2c1b7e3d",
                    "limit": "30.00",
                    "metric": "spend_usd",
                    "no_end_date": false,
                    "reason": "Quarter-end ticket surge",
                    "source": "admin",
                    "starts_at": "2026-10-01T00:00:00Z",
                    "status": "active",
                    "subject": {
                      "user": "alice@example.com"
                    },
                    "updated_at": "2026-10-01T09:00:00Z",
                    "version": 1790845200000000
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetGrantResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a budget grant",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:grant"
        ]
      }
    },
    "/llmgateway/management/v1/budget-pricing": {
      "get": {
        "description": "Every provider and model configured for the tenant with its effective price and where it comes from (policy rate, provider cost, Quilr catalog, mixed or unpriced), the tenant-wide rate items and how unpriced models are charged. Use it to render a full price table.",
        "operationId": "Read_budget_pricing",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "conditional_rates_present": false,
                  "effective": [
                    {
                      "model": "gpt-4.1-mini",
                      "provider": "openai",
                      "provider_label": "Production OpenAI",
                      "source": "catalog"
                    }
                  ],
                  "etag": "\"r12\"",
                  "open_ended": [],
                  "rates": [],
                  "request_id": "req_example",
                  "revision": 12,
                  "unpriced_models": "zero"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetPricingView"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read budget pricing",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      },
      "patch": {
        "description": "Sets how requests to models with no known price are treated: `zero` (count as free) or `block`; null removes the setting. Publishes a policy revision.",
        "operationId": "Update_unpriced_model_handling",
        "parameters": [
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "unpriced_models": "block"
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetPricingPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "set_unpriced_models"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update unpriced model handling",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-pricing/rates/{provider}/{model}": {
      "delete": {
        "description": "Removes a tenant-wide rate; the model falls back to provider or catalog pricing. provider_label selects a label-specific rate.",
        "operationId": "Remove_a_model_rate",
        "parameters": [
          {
            "example": "openai",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Model id; may contain `/`.",
            "example": "gpt-4.1-mini",
            "in": "path",
            "name": "model",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Remove the rate of one provider label only.",
            "in": "query",
            "name": "provider_label",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetDelete"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "delete_rate"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Remove a model rate",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      },
      "put": {
        "description": "Sets the tenant-wide price of one provider and model (model IDs may contain `/`). Rates are USD per 1M tokens, as numbers or decimal strings; tiers and cache rates are optional. Publishes a policy revision.",
        "operationId": "Set_a_model_rate",
        "parameters": [
          {
            "example": "openai",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Model id; may contain `/`.",
            "example": "gpt-4.1-mini",
            "in": "path",
            "name": "model",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "input_usd_per_1m": "0.40",
                "message": "Negotiated rate",
                "output_usd_per_1m": "1.60"
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetRate"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "put_rate"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Set a model rate",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-sets": {
      "get": {
        "description": "Group budget sets of the active policy: one budget split per smart group. resolve strongest gives a person in several of the set's groups only their best-ranked group's budget (smart-group rank); strictest applies every group's budget. Per-group budgets created before sets existed are listed as strictest sets with inferred: true.",
        "operationId": "List_budget_sets",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "budget_ids": [
                        "bgt_1a2b3c4d5e6f",
                        "bgt_6f5e4d3c2b1a"
                      ],
                      "etag": "\"s0f1e2d3c4b5a6978\"",
                      "groups": [
                        {
                          "budget_ids": [
                            "bgt_1a2b3c4d5e6f"
                          ],
                          "group": "executives"
                        },
                        {
                          "budget_ids": [
                            "bgt_6f5e4d3c2b1a"
                          ],
                          "group": "employees"
                        }
                      ],
                      "id": "set_9c2e4b1a7f30",
                      "inferred": false,
                      "label": "Monthly AI spend",
                      "managed": true,
                      "metric": "spend_usd",
                      "per": [],
                      "policy": null,
                      "resolve": "strongest",
                      "revision": 13,
                      "windows": [
                        {
                          "kind": "calendar",
                          "unit": "month"
                        }
                      ]
                    }
                  ],
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetSetList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List group budget sets",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      },
      "post": {
        "description": "Creates one API-managed budget per group (each scoped to its group's members, family = set id) and publishes one policy revision (201; 200 with dry_run). resolve defaults to strongest.",
        "operationId": "Create_a_budget_set",
        "parameters": [
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409. Not needed with dry_run=true.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "groups": [
                  {
                    "group": "executives",
                    "limit": "500.00"
                  },
                  "employees"
                ],
                "label": "Monthly AI spend",
                "limit": "50.00",
                "metric": "spend_usd",
                "resolve": "strongest",
                "window": {
                  "kind": "calendar",
                  "unit": "month"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetSetCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "create",
                    "create",
                    "create_set"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13,
                  "set": {
                    "budget_ids": [
                      "bgt_1a2b3c4d5e6f",
                      "bgt_6f5e4d3c2b1a"
                    ],
                    "etag": "\"s0f1e2d3c4b5a6978\"",
                    "groups": [
                      {
                        "budget_ids": [
                          "bgt_1a2b3c4d5e6f"
                        ],
                        "group": "executives"
                      },
                      {
                        "budget_ids": [
                          "bgt_6f5e4d3c2b1a"
                        ],
                        "group": "employees"
                      }
                    ],
                    "id": "set_9c2e4b1a7f30",
                    "inferred": false,
                    "label": "Monthly AI spend",
                    "managed": true,
                    "metric": "spend_usd",
                    "per": [],
                    "policy": null,
                    "resolve": "strongest",
                    "revision": 13,
                    "windows": [
                      {
                        "kind": "calendar",
                        "unit": "month"
                      }
                    ]
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create a group budget set",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-sets/{set_id}": {
      "delete": {
        "description": "Deletes every member budget (API-managed sets only; 409 budget_set_not_api_managed). If-Match required.",
        "operationId": "Delete_a_budget_set",
        "parameters": [
          {
            "description": "Group budget set id (GET /budget-sets).",
            "example": "set_9c2e4b1a7f30",
            "in": "path",
            "name": "set_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"s0f1e2d3c4b5a6978\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetDelete"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "delete",
                    "delete_set"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a group budget set",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      },
      "get": {
        "description": "One set with its member budgets. etag is the If-Match for PATCH and DELETE.",
        "operationId": "Read_a_budget_set",
        "parameters": [
          {
            "description": "Group budget set id (GET /budget-sets).",
            "example": "set_9c2e4b1a7f30",
            "in": "path",
            "name": "set_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "budgets": [],
                  "etag": "\"s0f1e2d3c4b5a6978\"",
                  "request_id": "req_example",
                  "revision": 13,
                  "set": {
                    "budget_ids": [
                      "bgt_1a2b3c4d5e6f",
                      "bgt_6f5e4d3c2b1a"
                    ],
                    "etag": "\"s0f1e2d3c4b5a6978\"",
                    "groups": [
                      {
                        "budget_ids": [
                          "bgt_1a2b3c4d5e6f"
                        ],
                        "group": "executives"
                      },
                      {
                        "budget_ids": [
                          "bgt_6f5e4d3c2b1a"
                        ],
                        "group": "employees"
                      }
                    ],
                    "id": "set_9c2e4b1a7f30",
                    "inferred": false,
                    "label": "Monthly AI spend",
                    "managed": true,
                    "metric": "spend_usd",
                    "per": [],
                    "policy": null,
                    "resolve": "strongest",
                    "revision": 13,
                    "windows": [
                      {
                        "kind": "calendar",
                        "unit": "month"
                      }
                    ]
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetSetGet"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a group budget set",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      },
      "patch": {
        "description": "Sets resolve on every member budget (counters are kept). Works on any set, also an inferred one (its group_set keys are written into the policy). If-Match (set etag) is required.",
        "operationId": "Switch_budget_set_resolution",
        "parameters": [
          {
            "description": "Group budget set id (GET /budget-sets).",
            "example": "set_9c2e4b1a7f30",
            "in": "path",
            "name": "set_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"s0f1e2d3c4b5a6978\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "resolve": "strictest"
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetSetPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "set_resolve"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Switch how a group budget set resolves",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-sets/{set_id}/groups": {
      "post": {
        "description": "Copies the set's first group's budgets (every window) for the new group, with an optional limit. API-managed sets only. Optional If-Match (set etag).",
        "operationId": "Add_a_group_to_a_budget_set",
        "parameters": [
          {
            "description": "Group budget set id (GET /budget-sets).",
            "example": "set_9c2e4b1a7f30",
            "in": "path",
            "name": "set_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"s0f1e2d3c4b5a6978\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409. Not needed with dry_run=true.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "group": "contractors",
                "limit": "20.00"
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetSetGroupAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "create",
                    "add_set_group"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Add a group to a budget set",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-sets/{set_id}/groups/{group}": {
      "delete": {
        "description": "Deletes that group's budgets (API-managed sets only). If-Match (set etag) required. Removing the last group deletes the set.",
        "operationId": "Remove_a_group_from_a_budget_set",
        "parameters": [
          {
            "description": "Group budget set id (GET /budget-sets).",
            "example": "set_9c2e4b1a7f30",
            "in": "path",
            "name": "set_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Smart group name, URL-encoded (virtual groups: virtual%3A<name>).",
            "example": "engineering",
            "in": "path",
            "name": "group",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"s0f1e2d3c4b5a6978\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetDelete"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "delete",
                    "remove_set_group"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Remove a group from a budget set",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budget-subjects": {
      "get": {
        "description": "One row per subject (user, app, key or smart group) across all budgets, with the tightest budget first. Filter with q (substring), kind, budget_id, min_pct and state; include_idle=true adds members with no usage.",
        "operationId": "List_budget_subjects",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "current (default), previous, or the ISO start of a past calendar window.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case-insensitive substring of the subject.",
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by kind.",
            "in": "query",
            "name": "kind",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Budget id.",
            "in": "query",
            "name": "budget_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only subjects at or above this percent of their limit.",
            "in": "query",
            "name": "min_pct",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ok, alerting, granted, overflow or blocked.",
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort order, for example pct, used or remaining; grants: created_at (default) or expires_at.",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Also list smart-group members and key owners with no usage (true or false).",
            "in": "query",
            "name": "include_idle",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "as_of": "2026-10-15T10:00:00Z",
                  "items": [
                    {
                      "active_grants": 1,
                      "budgets": [
                        {
                          "bucket": "user.email=alice@example.com",
                          "budget_id": "support_spend",
                          "effective_limit": "25.00",
                          "grant": null,
                          "pct": 40.8,
                          "state": "granted",
                          "used": "10.20"
                        }
                      ],
                      "subject": {
                        "kind": "user",
                        "value": "alice@example.com"
                      },
                      "tightest": {
                        "budget_id": "support_spend",
                        "pct": 40.8,
                        "state": "granted"
                      }
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "snapshot": "2026-10-15T10:00:00Z",
                  "stale": false
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetSubjectsPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List budget subjects",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/budget-subjects/{kind}/{value}": {
      "get": {
        "description": "Every budget that would count this subject (kind user, app, key or smart_group), including budgets with no usage yet, and whether each rule depends on request details. `app` narrows rules that depend on the app.",
        "operationId": "Read_a_budget_subject",
        "parameters": [
          {
            "description": "user, app, key or smart_group.",
            "example": "user",
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "alice@example.com",
            "in": "path",
            "name": "value",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "current (default), previous, or the ISO start of a past calendar window.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "App name, for rules that depend on the app.",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [],
                  "request_id": "req_example",
                  "subject": {
                    "kind": "user",
                    "value": "alice@example.com"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetSubjectDetail"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a budget subject",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/budget-usage-summary": {
      "get": {
        "description": "One row per budget: subjects tracked, total used, subjects over 80 percent, in overflow, at the limit or blocked, and active grants. `period` selects a past calendar window.",
        "operationId": "Read_budget_usage_summary",
        "parameters": [
          {
            "description": "current (default), previous, or the ISO start of a past calendar window.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "as_of": "2026-10-15T10:00:00Z",
                  "items": [
                    {
                      "active_grants": 2,
                      "at_limit": 1,
                      "blocked": 1,
                      "budget_id": "support_spend",
                      "in_overflow": 0,
                      "label": "Support spend",
                      "metric": "spend_usd",
                      "over_80_pct": 3,
                      "subjects_tracked": 42,
                      "total_used": "318.40"
                    }
                  ],
                  "period": "current",
                  "request_id": "req_example",
                  "revision": 12,
                  "snapshot": "2026-10-15T10:00:00Z",
                  "stale": false
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetUsageSummary"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read budget usage summary",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/budgets": {
      "get": {
        "description": "Budgets (spend, request or token limits) of the active policy, with `caller` describing what the key may do and `policy_engine` status. When QuilrQL is not enabled for the tenant the list is empty. Filters: kind, metric, managed, adjustable.",
        "operationId": "List_budgets",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by kind.",
            "in": "query",
            "name": "kind",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "spend_usd, requests or a token metric.",
            "in": "query",
            "name": "metric",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true lists only API-managed budgets.",
            "in": "query",
            "name": "managed",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true lists only budgets that accept grants.",
            "in": "query",
            "name": "adjustable",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "caller": {
                    "can_edit_policy": false,
                    "can_grant": false,
                    "can_read": true,
                    "scopes": [
                      "budgets:read"
                    ]
                  },
                  "items": [
                    {
                      "adjustments": {
                        "ceiling": "50",
                        "max_duration": "90d",
                        "requestable": false
                      },
                      "alerts": [
                        {
                          "at_pct": 80
                        }
                      ],
                      "applies_to": {
                        "apps": [
                          "Support Bot"
                        ],
                        "conditional": true,
                        "smart_groups": [],
                        "text": "application.name == \"Support Bot\""
                      },
                      "base_limit": "12.50",
                      "etag": "\"b3f9c0a1b2c4d5e6f\"",
                      "family": null,
                      "id": "support_spend",
                      "kind": "budget",
                      "label": "Support spend",
                      "managed": true,
                      "metric": "spend_usd",
                      "mode": "enforce",
                      "per": [
                        "user.email"
                      ],
                      "policy": "managed",
                      "revision": 12,
                      "window": {
                        "kind": "calendar",
                        "unit": "month"
                      }
                    }
                  ],
                  "next_cursor": null,
                  "policy_engine": {
                    "active_revision": 12,
                    "enabled": true
                  },
                  "request_id": "req_example",
                  "revision": 12
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List budgets",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      },
      "post": {
        "description": "Adds a budget to the API-managed budgets policy and publishes a new policy revision (201). With dry_run=true returns the diff, diagnostics and impact without publishing (200). An id is generated when omitted.",
        "operationId": "Create_a_budget",
        "parameters": [
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409. Not needed with dry_run=true.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "conversation_cap": {
                  "summary": "Lifetime spend cap per conversation",
                  "value": {
                    "id": "conversation_cap",
                    "label": "No conversation over 20 USD",
                    "limit": "20",
                    "metric": "spend_usd",
                    "missing_id": "refuse",
                    "one_time": true,
                    "per": [
                      "user",
                      "conversation"
                    ],
                    "window": {
                      "kind": "lifetime"
                    }
                  }
                },
                "hourly_requests": {
                  "summary": "Hourly request rate per app",
                  "value": {
                    "kind": "rate",
                    "limit": 1000,
                    "metric": "requests",
                    "per": [
                      "application.name"
                    ],
                    "window": {
                      "kind": "rolling",
                      "unit": "hour"
                    }
                  }
                },
                "monthly_spend": {
                  "summary": "Monthly spend per user",
                  "value": {
                    "alerts": [
                      {
                        "at_pct": 80
                      }
                    ],
                    "applies_to": {
                      "apps": [
                        "Support Bot"
                      ]
                    },
                    "id": "support_spend",
                    "label": "Support spend",
                    "limit": "12.50",
                    "metric": "spend_usd",
                    "per": [
                      "user.email"
                    ],
                    "window": {
                      "kind": "calendar",
                      "unit": "month"
                    }
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "budget": {
                    "adjustments": {
                      "ceiling": "50",
                      "max_duration": "90d",
                      "requestable": false
                    },
                    "alerts": [
                      {
                        "at_pct": 80
                      }
                    ],
                    "applies_to": {
                      "apps": [
                        "Support Bot"
                      ],
                      "conditional": true,
                      "smart_groups": [],
                      "text": "application.name == \"Support Bot\""
                    },
                    "base_limit": "12.50",
                    "etag": "\"b3f9c0a1b2c4d5e6f\"",
                    "family": null,
                    "id": "support_spend",
                    "kind": "budget",
                    "label": "Support spend",
                    "managed": true,
                    "metric": "spend_usd",
                    "mode": "enforce",
                    "per": [
                      "user.email"
                    ],
                    "policy": "managed",
                    "revision": 12,
                    "window": {
                      "kind": "calendar",
                      "unit": "month"
                    }
                  },
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "create"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create a budget",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budgets/_batch": {
      "post": {
        "description": "Up to 100 budget, rate and exemption operations published as ONE policy revision, all or nothing. Each op may carry its own if_match.",
        "operationId": "Apply_budget_changes_in_batch",
        "parameters": [
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"r12\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409. Not needed with dry_run=true.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "message": "Raise support budget and price gpt-4.1-mini",
                "ops": [
                  {
                    "body": {
                      "limit": "20"
                    },
                    "id": "support_spend",
                    "op": "patch"
                  },
                  {
                    "body": {
                      "input_usd_per_1m": "0.40",
                      "model": "gpt-4.1-mini",
                      "output_usd_per_1m": "1.60",
                      "provider": "openai"
                    },
                    "op": "put_rate"
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetBatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "patch",
                    "put_rate"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Apply budget changes in a batch",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budgets/{budget_id}": {
      "delete": {
        "description": "Removes an API-managed budget and publishes a new revision. Budgets written by hand in policy return 409 budget_not_api_managed. The budget's active and scheduled grants are revoked (`grants_revoked`); a budget created later with the same id starts without them. Requires the budget etag in If-Match.",
        "operationId": "Delete_a_budget",
        "parameters": [
          {
            "example": "support_spend",
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"b3f9c0a1b2c4d5e6f\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetDelete"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "delete"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a budget",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      },
      "get": {
        "description": "One budget and its etag (a hash of the budget's own definition; unrelated publishes keep it valid), used as If-Match on budget writes.",
        "operationId": "Read_a_budget",
        "parameters": [
          {
            "example": "support_spend",
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "budget": {
                    "adjustments": {
                      "ceiling": "50",
                      "max_duration": "90d",
                      "requestable": false
                    },
                    "alerts": [
                      {
                        "at_pct": 80
                      }
                    ],
                    "applies_to": {
                      "apps": [
                        "Support Bot"
                      ],
                      "conditional": true,
                      "smart_groups": [],
                      "text": "application.name == \"Support Bot\""
                    },
                    "base_limit": "12.50",
                    "etag": "\"b3f9c0a1b2c4d5e6f\"",
                    "family": null,
                    "id": "support_spend",
                    "kind": "budget",
                    "label": "Support spend",
                    "managed": true,
                    "metric": "spend_usd",
                    "mode": "enforce",
                    "per": [
                      "user.email"
                    ],
                    "policy": "managed",
                    "revision": 12,
                    "window": {
                      "kind": "calendar",
                      "unit": "month"
                    }
                  },
                  "etag": "\"b3f9c0a1b2c4d5e6f\"",
                  "request_id": "req_example",
                  "revision": 12
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetGet"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a budget",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      },
      "patch": {
        "description": "Changes limit, label, mode, alerts, adjustments or (API-managed budgets only) applies_to, and publishes a new revision. id, metric, per and window are immutable (422 identity_field_immutable). Requires the budget etag in If-Match. dry_run=true previews diff and impact.",
        "operationId": "Update_a_budget",
        "parameters": [
          {
            "example": "support_spend",
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Return the policy diff, diagnostics and impact without publishing.",
            "in": "query",
            "name": "dry_run",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Budget etag \"b<16 hex>\" (required on PATCH/DELETE of a budget; the legacy \"r<revision>-<id>\" is accepted while the revision is unchanged); grant etag \"<version>\" (required on PATCH/DELETE of a grant); budget set etag \"s<16 hex>\" (required on PATCH/DELETE of a set and DELETE of a set group, optional on adding a group); optional policy etag \"r<revision>\" on pricing, exemption and batch writes; optional alert-destinations etag on PUT /budget-alert-destinations.",
            "example": "\"b3f9c0a1b2c4d5e6f\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "adjustable": {
                  "summary": "Allow grants up to 50 USD",
                  "value": {
                    "adjustments": {
                      "ceiling": "50",
                      "max_duration": "90d"
                    }
                  }
                },
                "alert_only": {
                  "summary": "Switch to alert-only",
                  "value": {
                    "mode": "alert"
                  }
                },
                "limit": {
                  "summary": "Raise the limit",
                  "value": {
                    "limit": "20"
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "budget": {
                    "adjustments": {
                      "ceiling": "50",
                      "max_duration": "90d",
                      "requestable": false
                    },
                    "alerts": [
                      {
                        "at_pct": 80
                      }
                    ],
                    "applies_to": {
                      "apps": [
                        "Support Bot"
                      ],
                      "conditional": true,
                      "smart_groups": [],
                      "text": "application.name == \"Support Bot\""
                    },
                    "base_limit": "20.00",
                    "etag": "\"b3f9c0a1b2c4d5e6f\"",
                    "family": null,
                    "id": "support_spend",
                    "kind": "budget",
                    "label": "Support spend",
                    "managed": true,
                    "metric": "spend_usd",
                    "mode": "enforce",
                    "per": [
                      "user.email"
                    ],
                    "policy": "managed",
                    "revision": 12,
                    "window": {
                      "kind": "calendar",
                      "unit": "month"
                    }
                  },
                  "changed": true,
                  "etag": "\"r13\"",
                  "ids": [
                    "support_spend"
                  ],
                  "ops": [
                    "patch"
                  ],
                  "previous_revision": 12,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetEditResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a budget",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:policy"
        ]
      }
    },
    "/llmgateway/management/v1/budgets/{budget_id}/burn-rate": {
      "get": {
        "description": "Per subject of a calendar budget: usage, effective limit, the rate over the lookback (default 24h, or the window so far when it started more recently) and a projection that holds that rate until the window resets: projected_total, projected_pct and exhausts_at (when the limit is reached, or null if not before the reset). Sorted by soonest to run out. When one subject matches, `series` has its hourly usage over the lookback. Rolling and lifetime budgets return 422 burn_rate_not_supported.",
        "operationId": "Read_budget_burn_rate",
        "parameters": [
          {
            "example": "support_spend",
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Duration the rate is measured over, such as 24h (default) or 7d; at most 31d.",
            "in": "query",
            "name": "lookback",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only subjects projected to reach at least this percent of their limit by the reset.",
            "in": "query",
            "name": "min_projected_pct",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical subject bucket.",
            "in": "query",
            "name": "bucket",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "false omits the hourly series when one subject matches.",
            "in": "query",
            "name": "include_series",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "User email.",
            "in": "query",
            "name": "subject.user",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "App name.",
            "in": "query",
            "name": "subject.app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Smart group name.",
            "in": "query",
            "name": "subject.smart_group",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Model id.",
            "in": "query",
            "name": "subject.model",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "as_of": "2026-10-15T10:00:00Z",
                  "budget": {
                    "id": "support_spend",
                    "metric": "spend_usd"
                  },
                  "items": [
                    {
                      "bucket": "user.email=alice@example.com",
                      "effective_limit": "12.50",
                      "forecast": {
                        "exhausted": false,
                        "exhausts_at": "2026-10-15T19:10:00Z",
                        "lookback_hours": 24.0,
                        "projected_pct": 277.44,
                        "projected_total": "34.68",
                        "rate_per_hour": "0.12"
                      },
                      "grant": null,
                      "pct": 81.6,
                      "state": "alerting",
                      "subject": {
                        "user": "alice@example.com"
                      },
                      "used": "10.20"
                    }
                  ],
                  "lookback": "24h",
                  "method": "linear: rate over the lookback, held until the window resets",
                  "next_cursor": null,
                  "period": "current",
                  "request_id": "req_example",
                  "revision": 12,
                  "series": [
                    {
                      "hour": "2026-10-14T10:00:00Z",
                      "used": "0.11"
                    }
                  ],
                  "snapshot": "2026-10-15T10:00:00Z",
                  "stale": false,
                  "total": 1,
                  "window": {
                    "reset_at": "2026-11-01T00:00:00Z",
                    "start": "2026-10-01T00:00:00Z"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetBurnRatePage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read budget burn rate",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/budgets/{budget_id}/grants": {
      "post": {
        "description": "Gives one subject of an adjustable budget its own limit (higher or lower than the base, at most the budget's ceiling) until `expires_at`. When the budget's adjustments.max_duration is \"unlimited\", `expires_at` may be null or omitted for a grant with no end date. A new grant supersedes only the subject's grants whose time range overlaps its own (scheduled ones included; one in effect is cut to end at a later `starts_at` instead); grants that do not overlap stay, and the one in effect now applies. `superseded` is the newest grant it replaced. Grants do not change policy. `{\"subject\": {\"members_of\": \"Data Science\"}}` grants a Smart group: every current member gets the limit, people who join or leave the group follow automatically, a member's own grant wins and a member of several granted groups gets the best-ranked group's. Per-person budgets (by email) only. Give exactly one of `limit` (absolute) or `extra` (added to the base limit: the grant follows the base, so a later base change moves it; still capped by the ceiling). A `starts_at` in the future lists the grant as `scheduled` until it starts.",
        "operationId": "Issue_a_budget_grant",
        "parameters": [
          {
            "example": "support_spend",
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409. Not needed with dry_run=true.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "extra": {
                  "summary": "Base plus extra",
                  "value": {
                    "expires_at": "2026-10-31T23:59:59Z",
                    "extra": "10",
                    "reason": "Launch week",
                    "subject": {
                      "user": "alice@example.com"
                    }
                  }
                },
                "limit": {
                  "summary": "Absolute limit",
                  "value": {
                    "expires_at": "2026-10-31T23:59:59Z",
                    "limit": "25",
                    "reason": "Quarter-end ticket surge",
                    "subject": {
                      "user": "alice@example.com"
                    }
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetGrant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"1790845200000000\"",
                  "grant": {
                    "actor": "management_key:2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                    "base_limit": "12.50",
                    "bucket": "user.email=alice@example.com",
                    "budget_id": "support_spend",
                    "budget_label": "Support spend",
                    "created_at": "2026-10-01T09:00:00Z",
                    "etag": "\"1790845200000000\"",
                    "expires_at": "2026-10-31T23:59:59Z",
                    "id": "grt_4f9a2c1b7e3d",
                    "limit": "25.00",
                    "metric": "spend_usd",
                    "no_end_date": false,
                    "reason": "Quarter-end ticket surge",
                    "source": "admin",
                    "starts_at": "2026-10-01T00:00:00Z",
                    "status": "active",
                    "subject": {
                      "user": "alice@example.com"
                    },
                    "updated_at": "2026-10-01T09:00:00Z",
                    "version": 1790845200000000
                  },
                  "request_id": "req_example",
                  "superseded": null
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetGrantResult"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Issue a budget grant",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:grant"
        ]
      }
    },
    "/llmgateway/management/v1/budgets/{budget_id}/grants/_bulk": {
      "post": {
        "description": "Issues up to 1000 grants, listed in `grants` or expanded from every member of a smart group (`subjects_from`). Each item succeeds or fails independently; failures are listed in `errors`. 201 when at least one grant was issued, otherwise 200.",
        "operationId": "Issue_budget_grants_in_bulk",
        "parameters": [
          {
            "example": "support_spend",
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409. Not needed with dry_run=true.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_at": "2026-10-31T23:59:59Z",
                "limit": "25",
                "reason": "Launch week",
                "subjects_from": {
                  "smart_group": "support-team"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/BudgetGrantBulk"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetGrantBulkResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "errors": [],
                  "items": [
                    {
                      "grant": {
                        "actor": "management_key:2d7e9f40-1b6a-4c8e-a3f2-5e6d7c8b9a01",
                        "base_limit": "12.50",
                        "bucket": "user.email=alice@example.com",
                        "budget_id": "support_spend",
                        "budget_label": "Support spend",
                        "created_at": "2026-10-01T09:00:00Z",
                        "etag": "\"1790845200000000\"",
                        "expires_at": "2026-10-31T23:59:59Z",
                        "id": "grt_4f9a2c1b7e3d",
                        "limit": "25.00",
                        "metric": "spend_usd",
                        "no_end_date": false,
                        "reason": "Quarter-end ticket surge",
                        "source": "admin",
                        "starts_at": "2026-10-01T00:00:00Z",
                        "status": "active",
                        "subject": {
                          "user": "alice@example.com"
                        },
                        "updated_at": "2026-10-01T09:00:00Z",
                        "version": 1790845200000000
                      },
                      "index": 0,
                      "superseded": null
                    }
                  ],
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetGrantBulkResult"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Issue budget grants in bulk",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:grant"
        ]
      }
    },
    "/llmgateway/management/v1/budgets/{budget_id}/usage": {
      "get": {
        "description": "Usage of one budget per subject in the current (or a past calendar) window: used, base and effective limits, remaining, percent, state, grant and overflow. Filter by subject, min_pct and state; sort by pct, used or remaining. Usage is a cached snapshot refreshed every few seconds (`as_of`, `stale`).",
        "operationId": "Read_budget_usage",
        "parameters": [
          {
            "example": "support_spend",
            "in": "path",
            "name": "budget_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "current (default), previous, or the ISO start of a past calendar window.",
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only subjects at or above this percent of their limit.",
            "in": "query",
            "name": "min_pct",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "ok, alerting, granted, overflow or blocked.",
            "in": "query",
            "name": "state",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Sort order, for example pct, used or remaining; grants: created_at (default) or expires_at.",
            "in": "query",
            "name": "sort",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Also list smart-group members and key owners with no usage (true or false).",
            "in": "query",
            "name": "include_idle",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Smart group name: list every current member of the group (members with no usage at 0) with limit_source, for example to see who a Smart group grant covers. Per-person budgets only.",
            "in": "query",
            "name": "members_of",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "User email.",
            "in": "query",
            "name": "subject.user",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "App name.",
            "in": "query",
            "name": "subject.app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Smart group name.",
            "in": "query",
            "name": "subject.smart_group",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Model id.",
            "in": "query",
            "name": "subject.model",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "as_of": "2026-10-15T10:00:00Z",
                  "budget": {
                    "id": "support_spend",
                    "metric": "spend_usd"
                  },
                  "items": [
                    {
                      "base_limit": "12.50",
                      "bucket": "user.email=alice@example.com",
                      "effective_limit": "25.00",
                      "grant": {
                        "expires_at": "2026-10-31T23:59:59Z",
                        "id": "grt_4f9a2c1b7e3d",
                        "limit": "25.00",
                        "source": "admin"
                      },
                      "overflow": null,
                      "pct": 40.8,
                      "remaining": "14.80",
                      "state": "granted",
                      "subject": {
                        "user": "alice@example.com"
                      },
                      "used": "10.20"
                    }
                  ],
                  "next_cursor": null,
                  "period": "current",
                  "request_id": "req_example",
                  "revision": 12,
                  "snapshot": "2026-10-15T10:00:00Z",
                  "stale": false,
                  "window": {
                    "reset_at": "2026-11-01T00:00:00Z",
                    "start": "2026-10-01T00:00:00Z"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/BudgetUsagePage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read budget usage",
        "tags": [
          "Budgets"
        ],
        "x-scopes": [
          "budgets:read"
        ]
      }
    },
    "/llmgateway/management/v1/capabilities": {
      "get": {
        "description": "What this deployment supports: every scope, the scopes of the calling key (`caller.scopes`), provider types, writable app fields per section, provider test and model discovery support, and the tenant's QuilrQL authority. Use it to build forms and to hide actions the caller cannot perform.",
        "operationId": "Read_capabilities",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app_fields": {
                    "limits": [
                      "concurrency_per_minute",
                      "model_rate_limits",
                      "rate_limit",
                      "rate_limit_per_minute",
                      "timeout",
                      "token_limits"
                    ]
                  },
                  "app_top_level_fields": [
                    "access",
                    "alerting",
                    "detection",
                    "enabled",
                    "limits",
                    "prompts",
                    "provider_labels",
                    "routing",
                    "self_service",
                    "smart_group_policies",
                    "tags",
                    "transformations"
                  ],
                  "budget_policy_updates": true,
                  "caller": {
                    "scopes": [
                      "config:write",
                      "providers:write",
                      "read"
                    ]
                  },
                  "completely_no_gpu": false,
                  "configuration_propagation": "asynchronous",
                  "connection_test_provider_types": [
                    "anthropic",
                    "openai"
                  ],
                  "draft_settings_tests_available": true,
                  "managed_controls": {
                    "domains": [
                      "destinations",
                      "failover-default",
                      "routes"
                    ],
                    "enabled": true,
                    "limits": null,
                    "renderer_version": "managed-controls-render-v1"
                  },
                  "model_discovery_provider_types": [
                    "anthropic",
                    "openai"
                  ],
                  "model_test_provider_types": [
                    "anthropic",
                    "openai"
                  ],
                  "model_tests_available": true,
                  "modes": [
                    "gateway",
                    "sdk",
                    "copilot_studio"
                  ],
                  "policy_authority": {
                    "active_checksum": null,
                    "active_revision": null,
                    "enabled": false
                  },
                  "policy_updates": false,
                  "provider_delete_available": true,
                  "provider_list_filters": [
                    "provider_name",
                    "enabled",
                    "tag",
                    "model",
                    "include_deleted"
                  ],
                  "provider_saves_call_upstream": false,
                  "provider_types": [
                    "openai",
                    "azureopenai",
                    "anthropic",
                    "bedrock",
                    "vertex_ai"
                  ],
                  "quota_pools_available": true,
                  "request_id": "8d0f6c1e-2a4b-4c9d-9e7f-1a2b3c4d5e6f",
                  "schema_version": "1",
                  "scopes": [
                    "budgets:grant",
                    "budgets:policy",
                    "budgets:read",
                    "config:write",
                    "credentials:read",
                    "credentials:write",
                    "hooks:write",
                    "incidents:read",
                    "incidents:write",
                    "keys:write",
                    "limits:grant",
                    "limits:read",
                    "limits:write",
                    "providers:write",
                    "read",
                    "routing:constraints",
                    "routing:read",
                    "routing:write"
                  ],
                  "writes_available": true
                },
                "schema": {
                  "$ref": "#/components/schemas/Capabilities"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read capabilities",
        "tags": [
          "Reference"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/_batch": {
      "post": {
        "description": "Up to 100 put, patch, delete or quick operations across every control collection, published as ONE revision, all or nothing. Each op may carry if_match; a failure names op_index. Each op needs its collection's write scope.",
        "operationId": "Apply_a_controls_batch",
        "parameters": [
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Routing constraints: routes left without candidates become a 422 instead of warnings.",
            "in": "query",
            "name": "strict",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Not needed with dry_run=true.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "ops": [
                  {
                    "body": {
                      "members": [
                        {
                          "model": "gpt-4.1",
                          "provider_label": "azure-eu",
                          "weight": 70
                        },
                        {
                          "model": "anthropic.claude-sonnet-4",
                          "provider_label": "bedrock-eu",
                          "weight": 30
                        }
                      ],
                      "mode": "request_count",
                      "type": "weighted"
                    },
                    "collection": "destinations",
                    "id": "eu-pool",
                    "op": "put"
                  },
                  {
                    "body": {
                      "mode": "observe"
                    },
                    "collection": "routes",
                    "id": "eu-smart",
                    "if_match": "\"r12-eu-smart-5e6f7a8b\"",
                    "op": "patch"
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "results": [
                    {
                      "changed": true,
                      "domain": "destinations",
                      "etag": "\"r13-eu-pool-1a2b3c4d\"",
                      "id": "eu-pool",
                      "op_index": 0
                    }
                  ],
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsBatchResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Apply a batch of control changes",
        "tags": [
          "Routing"
        ],
        "x-scopes": [],
        "x-scopes-per-op": true
      }
    },
    "/llmgateway/management/v1/controls/_capacity": {
      "get": {
        "description": "Rules, policies and policy bytes used against the tenant caps (2,500 rules, 1,000 policies, 1,000,000 bytes). A write that would exceed them is a 422 policy_capacity_exceeded.",
        "operationId": "Read_policy_capacity",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "limits": {
                    "policies_max": 1000,
                    "policies_used": 6,
                    "rules_max": 2500,
                    "rules_used": 42,
                    "source_bytes_max": 1000000,
                    "source_bytes_used": 18234
                  },
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsCapacity"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read policy capacity",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/access": {
      "get": {
        "description": "Every managed access control with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_access_controls",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "description": "Contractors: office network only",
                      "etag": "\"r13-contractors-office-only-1a2b3c4d\"",
                      "id": "contractors-office-only",
                      "scope": {
                        "smart_groups": [
                          "contractors"
                        ]
                      },
                      "settings": {
                        "allowed_source_ips": [
                          "203.0.113.0/24"
                        ],
                        "require_identity": true
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsAccessList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List access controls",
        "tags": [
          "Access"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/access/{resource_id}": {
      "delete": {
        "description": "Removes the access control; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_access_control",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "contractors-office-only",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete an access control",
        "tags": [
          "Access"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One access control and its ETag.",
        "operationId": "Read_access_control",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-contractors-office-only-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "description": "Contractors: office network only",
                    "etag": "\"r13-contractors-office-only-1a2b3c4d\"",
                    "id": "contractors-office-only",
                    "scope": {
                      "smart_groups": [
                        "contractors"
                      ]
                    },
                    "settings": {
                      "allowed_source_ips": [
                        "203.0.113.0/24"
                      ],
                      "require_identity": true
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsAccessItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read an access control",
        "tags": [
          "Access"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the access control (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_access_control",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsAccessPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-contractors-office-only-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "Contractors: office network only",
                    "etag": "\"r13-contractors-office-only-1a2b3c4d\"",
                    "id": "contractors-office-only",
                    "scope": {
                      "smart_groups": [
                        "contractors"
                      ]
                    },
                    "settings": {
                      "allowed_source_ips": [
                        "203.0.113.0/24"
                      ],
                      "require_identity": true
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update an access control",
        "tags": [
          "Access"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the access control. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_access_control",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "description": "Contractors: office network only",
                "scope": {
                  "smart_groups": [
                    "contractors"
                  ]
                },
                "settings": {
                  "allowed_source_ips": [
                    "203.0.113.0/24"
                  ],
                  "require_identity": true
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsAccess"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-contractors-office-only-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "Contractors: office network only",
                    "etag": "\"r13-contractors-office-only-1a2b3c4d\"",
                    "id": "contractors-office-only",
                    "scope": {
                      "smart_groups": [
                        "contractors"
                      ]
                    },
                    "settings": {
                      "allowed_source_ips": [
                        "203.0.113.0/24"
                      ],
                      "require_identity": true
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace an access control",
        "tags": [
          "Access"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/cache-warm": {
      "get": {
        "description": "Every managed cache warm setting with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_cache_warm_settings",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-agents-warm-1a2b3c4d\"",
                      "id": "agents-warm",
                      "scope": {
                        "app_tags": [
                          "coding-agents"
                        ]
                      },
                      "settings": {
                        "extend_cache_lifetime": true,
                        "stop_after_idle_minutes": 20
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsCacheWarmList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List cache warm settings",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/cache-warm/{resource_id}": {
      "delete": {
        "description": "Removes the cache warm setting; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_cache_warm_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "agents-warm",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a cache warm setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One cache warm setting and its ETag.",
        "operationId": "Read_cache_warm_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-agents-warm-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-agents-warm-1a2b3c4d\"",
                    "id": "agents-warm",
                    "scope": {
                      "app_tags": [
                        "coding-agents"
                      ]
                    },
                    "settings": {
                      "extend_cache_lifetime": true,
                      "stop_after_idle_minutes": 20
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsCacheWarmItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a cache warm setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the cache warm setting (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_cache_warm_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsCacheWarmPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-agents-warm-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-agents-warm-1a2b3c4d\"",
                    "id": "agents-warm",
                    "scope": {
                      "app_tags": [
                        "coding-agents"
                      ]
                    },
                    "settings": {
                      "extend_cache_lifetime": true,
                      "stop_after_idle_minutes": 20
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a cache warm setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the cache warm setting. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_cache_warm_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "scope": {
                  "app_tags": [
                    "coding-agents"
                  ]
                },
                "settings": {
                  "extend_cache_lifetime": true,
                  "stop_after_idle_minutes": 20
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsCacheWarm"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-agents-warm-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-agents-warm-1a2b3c4d\"",
                    "id": "agents-warm",
                    "scope": {
                      "app_tags": [
                        "coding-agents"
                      ]
                    },
                    "settings": {
                      "extend_cache_lifetime": true,
                      "stop_after_idle_minutes": 20
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a cache warm setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/complexity-levels": {
      "get": {
        "description": "Every managed complexity levels with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_complexity_levels",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "description": "Support complexity",
                      "etag": "\"r13-support-levels-1a2b3c4d\"",
                      "id": "support-levels",
                      "levels": {
                        "high": {
                          "description": "Multi-step reasoning or coding"
                        },
                        "low": {
                          "description": "Short factual questions",
                          "max_tokens": 200
                        },
                        "medium": {
                          "description": "Everyday drafting",
                          "max_tokens": 2000
                        },
                        "method": "ai"
                      },
                      "rank": 10,
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsComplexityLevelsList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List complexity levels",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/complexity-levels/{resource_id}": {
      "delete": {
        "description": "Removes the complexity levels; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_complexity_levels",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "support-levels",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a complexity levels",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "get": {
        "description": "One complexity levels and its ETag.",
        "operationId": "Read_complexity_levels",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-support-levels-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "description": "Support complexity",
                    "etag": "\"r13-support-levels-1a2b3c4d\"",
                    "id": "support-levels",
                    "levels": {
                      "high": {
                        "description": "Multi-step reasoning or coding"
                      },
                      "low": {
                        "description": "Short factual questions",
                        "max_tokens": 200
                      },
                      "medium": {
                        "description": "Everyday drafting",
                        "max_tokens": 2000
                      },
                      "method": "ai"
                    },
                    "rank": 10,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsComplexityLevelsItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a complexity levels",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the complexity levels (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_complexity_levels",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsComplexityLevelsPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-levels-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "Support complexity",
                    "etag": "\"r13-support-levels-1a2b3c4d\"",
                    "id": "support-levels",
                    "levels": {
                      "high": {
                        "description": "Multi-step reasoning or coding"
                      },
                      "low": {
                        "description": "Short factual questions",
                        "max_tokens": 200
                      },
                      "medium": {
                        "description": "Everyday drafting",
                        "max_tokens": 2000
                      },
                      "method": "ai"
                    },
                    "rank": 10,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a complexity levels",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the complexity levels. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_complexity_levels",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "description": "Support complexity",
                "levels": {
                  "high": {
                    "description": "Multi-step reasoning or coding"
                  },
                  "low": {
                    "description": "Short factual questions",
                    "max_tokens": 200
                  },
                  "medium": {
                    "description": "Everyday drafting",
                    "max_tokens": 2000
                  },
                  "method": "ai"
                },
                "rank": 10,
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsComplexityLevels"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-levels-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "Support complexity",
                    "etag": "\"r13-support-levels-1a2b3c4d\"",
                    "id": "support-levels",
                    "levels": {
                      "high": {
                        "description": "Multi-step reasoning or coding"
                      },
                      "low": {
                        "description": "Short factual questions",
                        "max_tokens": 200
                      },
                      "medium": {
                        "description": "Everyday drafting",
                        "max_tokens": 2000
                      },
                      "method": "ai"
                    },
                    "rank": 10,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a complexity levels",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/conversation-headers": {
      "get": {
        "description": "Every managed conversation header setting with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_conversation_header_settings",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-support-threads-1a2b3c4d\"",
                      "id": "support-threads",
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "settings": {
                        "id_headers": [
                          "x-thread-id"
                        ]
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsConversationHeadersList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List conversation header settings",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/conversation-headers/{resource_id}": {
      "delete": {
        "description": "Removes the conversation header setting; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_conversation_header_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "support-threads",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a conversation header setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One conversation header setting and its ETag.",
        "operationId": "Read_conversation_header_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-support-threads-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-threads-1a2b3c4d\"",
                    "id": "support-threads",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "id_headers": [
                        "x-thread-id"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsConversationHeadersItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a conversation header setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the conversation header setting (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_conversation_header_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsConversationHeadersPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-threads-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-threads-1a2b3c4d\"",
                    "id": "support-threads",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "id_headers": [
                        "x-thread-id"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a conversation header setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the conversation header setting. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_conversation_header_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                },
                "settings": {
                  "id_headers": [
                    "x-thread-id"
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsConversationHeaders"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-threads-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-threads-1a2b3c4d\"",
                    "id": "support-threads",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "id_headers": [
                        "x-thread-id"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a conversation header setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/destinations": {
      "get": {
        "description": "Every managed destination with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_destinations",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-eu-pool-1a2b3c4d\"",
                      "id": "eu-pool",
                      "members": [
                        {
                          "model": "gpt-4.1",
                          "provider_label": "azure-eu",
                          "weight": 70
                        },
                        {
                          "model": "anthropic.claude-sonnet-4",
                          "provider_label": "bedrock-eu",
                          "weight": 30
                        }
                      ],
                      "mode": "request_count",
                      "source": "managed",
                      "type": "weighted"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsDestinationsList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List destinations",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/destinations/{resource_id}": {
      "delete": {
        "description": "Removes the destination; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_destination",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "eu-pool",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a destination",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "get": {
        "description": "One destination and its ETag.",
        "operationId": "Read_destination",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-eu-pool-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eu-pool-1a2b3c4d\"",
                    "id": "eu-pool",
                    "members": [
                      {
                        "model": "gpt-4.1",
                        "provider_label": "azure-eu",
                        "weight": 70
                      },
                      {
                        "model": "anthropic.claude-sonnet-4",
                        "provider_label": "bedrock-eu",
                        "weight": 30
                      }
                    ],
                    "mode": "request_count",
                    "source": "managed",
                    "type": "weighted"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsDestinationsItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a destination",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the destination (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_destination",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsDestinationsPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-pool-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eu-pool-1a2b3c4d\"",
                    "id": "eu-pool",
                    "members": [
                      {
                        "model": "gpt-4.1",
                        "provider_label": "azure-eu",
                        "weight": 70
                      },
                      {
                        "model": "anthropic.claude-sonnet-4",
                        "provider_label": "bedrock-eu",
                        "weight": 30
                      }
                    ],
                    "mode": "request_count",
                    "source": "managed",
                    "type": "weighted"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a destination",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the destination. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_destination",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "members": [
                  {
                    "model": "gpt-4.1",
                    "provider_label": "azure-eu",
                    "weight": 70
                  },
                  {
                    "model": "anthropic.claude-sonnet-4",
                    "provider_label": "bedrock-eu",
                    "weight": 30
                  }
                ],
                "mode": "request_count",
                "type": "weighted"
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsDestinations"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-pool-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eu-pool-1a2b3c4d\"",
                    "id": "eu-pool",
                    "members": [
                      {
                        "model": "gpt-4.1",
                        "provider_label": "azure-eu",
                        "weight": 70
                      },
                      {
                        "model": "anthropic.claude-sonnet-4",
                        "provider_label": "bedrock-eu",
                        "weight": 30
                      }
                    ],
                    "mode": "request_count",
                    "source": "managed",
                    "type": "weighted"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a destination",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/destinations/{resource_id}:replace-member": {
      "post": {
        "description": "Swaps one provider/model for another in the destination, and so in every route that uses it. If-Match and Idempotency-Key are required; changed false when nothing changes.",
        "operationId": "Replace_member_destination",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Not needed with dry_run=true.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "from": {
                  "model": "anthropic.claude-sonnet-4",
                  "provider_label": "bedrock-eu"
                },
                "to": {
                  "model": "gpt-4.1-mini",
                  "provider_label": "azure-eu"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsDestinationsReplaceMember"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-pool-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eu-pool-1a2b3c4d\"",
                    "id": "eu-pool",
                    "members": [
                      {
                        "model": "gpt-4.1",
                        "provider_label": "azure-eu",
                        "weight": 70
                      },
                      {
                        "model": "anthropic.claude-sonnet-4",
                        "provider_label": "bedrock-eu",
                        "weight": 30
                      }
                    ],
                    "mode": "request_count",
                    "source": "managed",
                    "type": "weighted"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Replace member of a destination",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/destinations/{resource_id}:set-weights": {
      "post": {
        "description": "Replaces the members' weights (they must total 100); every route that uses the destination changes in the same revision. New conversations use the new weights; existing ones keep their pin unless repin=drop. If-Match and Idempotency-Key are required; changed false when nothing changes.",
        "operationId": "Set_weights_destination",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Not needed with dry_run=true.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "members": [
                  {
                    "model": "gpt-4.1",
                    "provider_label": "azure-eu",
                    "weight": 50
                  },
                  {
                    "model": "anthropic.claude-sonnet-4",
                    "provider_label": "bedrock-eu",
                    "weight": 50
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsDestinationsSetWeights"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-pool-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eu-pool-1a2b3c4d\"",
                    "id": "eu-pool",
                    "members": [
                      {
                        "model": "gpt-4.1",
                        "provider_label": "azure-eu",
                        "weight": 70
                      },
                      {
                        "model": "anthropic.claude-sonnet-4",
                        "provider_label": "bedrock-eu",
                        "weight": 30
                      }
                    ],
                    "mode": "request_count",
                    "source": "managed",
                    "type": "weighted"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Set weights of a destination",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/error-messages": {
      "get": {
        "description": "Every managed error message setting with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_error_message_settings",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-support-errors-1a2b3c4d\"",
                      "id": "support-errors",
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "settings": {
                        "mappings": [
                          {
                            "id": "busy",
                            "match": {
                              "class": [
                                "rate_limit"
                              ],
                              "source": "provider"
                            },
                            "message": "The assistant is busy; try again in a minute.",
                            "url": "https://help.example.com/busy"
                          }
                        ]
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsErrorMessagesList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List error message settings",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/error-messages/{resource_id}": {
      "delete": {
        "description": "Removes the error message setting; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_error_message_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "support-errors",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete an error message setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One error message setting and its ETag.",
        "operationId": "Read_error_message_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-support-errors-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-errors-1a2b3c4d\"",
                    "id": "support-errors",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "mappings": [
                        {
                          "id": "busy",
                          "match": {
                            "class": [
                              "rate_limit"
                            ],
                            "source": "provider"
                          },
                          "message": "The assistant is busy; try again in a minute.",
                          "url": "https://help.example.com/busy"
                        }
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsErrorMessagesItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read an error message setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the error message setting (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_error_message_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsErrorMessagesPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-errors-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-errors-1a2b3c4d\"",
                    "id": "support-errors",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "mappings": [
                        {
                          "id": "busy",
                          "match": {
                            "class": [
                              "rate_limit"
                            ],
                            "source": "provider"
                          },
                          "message": "The assistant is busy; try again in a minute.",
                          "url": "https://help.example.com/busy"
                        }
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update an error message setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the error message setting. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_error_message_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                },
                "settings": {
                  "mappings": [
                    {
                      "id": "busy",
                      "match": {
                        "class": [
                          "rate_limit"
                        ],
                        "source": "provider"
                      },
                      "message": "The assistant is busy; try again in a minute.",
                      "url": "https://help.example.com/busy"
                    }
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsErrorMessages"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-errors-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-errors-1a2b3c4d\"",
                    "id": "support-errors",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "mappings": [
                        {
                          "id": "busy",
                          "match": {
                            "class": [
                              "rate_limit"
                            ],
                            "source": "provider"
                          },
                          "message": "The assistant is busy; try again in a minute.",
                          "url": "https://help.example.com/busy"
                        }
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace an error message setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/failover-default": {
      "delete": {
        "description": "Removes it, so the built-in default applies. If-Match is required.",
        "operationId": "Reset_failover_default",
        "parameters": [
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "default",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Reset the failover default",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "get": {
        "description": "One failover default and its ETag. resource is null while the built-in default applies.",
        "operationId": "Read_failover_default",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-default-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-default-1a2b3c4d\"",
                    "failover": {
                      "candidate_scope": "same_model",
                      "max_attempts": 2
                    },
                    "id": "default",
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsFailoverDefaultItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read the failover default",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the failover default. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_failover_default",
        "parameters": [
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "failover": {
                  "candidate_scope": "same_model",
                  "max_attempts": 2
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsFailoverDefault"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-default-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-default-1a2b3c4d\"",
                    "failover": {
                      "candidate_scope": "same_model",
                      "max_attempts": 2
                    },
                    "id": "default",
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace the failover default",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/failover-profiles": {
      "get": {
        "description": "Every managed failover profile with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_failover_profiles",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "candidate_scope": "route",
                      "description": "Two tries, then the mini model",
                      "etag": "\"r13-standard-1a2b3c4d\"",
                      "fallbacks": [
                        {
                          "model": "gpt-4.1-mini",
                          "provider_label": "azure-eu"
                        }
                      ],
                      "id": "standard",
                      "max_attempts": 2,
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsFailoverProfilesList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List failover profiles",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/failover-profiles/{resource_id}": {
      "delete": {
        "description": "Removes the failover profile; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_failover_profile",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "standard",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a failover profile",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "get": {
        "description": "One failover profile and its ETag.",
        "operationId": "Read_failover_profile",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-standard-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "candidate_scope": "route",
                    "description": "Two tries, then the mini model",
                    "etag": "\"r13-standard-1a2b3c4d\"",
                    "fallbacks": [
                      {
                        "model": "gpt-4.1-mini",
                        "provider_label": "azure-eu"
                      }
                    ],
                    "id": "standard",
                    "max_attempts": 2,
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsFailoverProfilesItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a failover profile",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the failover profile (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_failover_profile",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsFailoverProfilesPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-standard-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "candidate_scope": "route",
                    "description": "Two tries, then the mini model",
                    "etag": "\"r13-standard-1a2b3c4d\"",
                    "fallbacks": [
                      {
                        "model": "gpt-4.1-mini",
                        "provider_label": "azure-eu"
                      }
                    ],
                    "id": "standard",
                    "max_attempts": 2,
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a failover profile",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the failover profile. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_failover_profile",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "candidate_scope": "route",
                "description": "Two tries, then the mini model",
                "fallbacks": [
                  {
                    "model": "gpt-4.1-mini",
                    "provider_label": "azure-eu"
                  }
                ],
                "max_attempts": 2
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsFailoverProfiles"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-standard-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "candidate_scope": "route",
                    "description": "Two tries, then the mini model",
                    "etag": "\"r13-standard-1a2b3c4d\"",
                    "fallbacks": [
                      {
                        "model": "gpt-4.1-mini",
                        "provider_label": "azure-eu"
                      }
                    ],
                    "id": "standard",
                    "max_attempts": 2,
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a failover profile",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/failover-rules": {
      "get": {
        "description": "Every managed failover rule with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_failover_rules",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-eu-staff-failover-1a2b3c4d\"",
                      "failover": {
                        "ref": "standard"
                      },
                      "id": "eu-staff-failover",
                      "rank": 10,
                      "scope": {
                        "smart_groups": [
                          "eu-staff"
                        ]
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsFailoverRulesList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List failover rules",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/failover-rules/{resource_id}": {
      "delete": {
        "description": "Removes the failover rule; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_failover_rule",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "eu-staff-failover",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a failover rule",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "get": {
        "description": "One failover rule and its ETag.",
        "operationId": "Read_failover_rule",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-eu-staff-failover-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eu-staff-failover-1a2b3c4d\"",
                    "failover": {
                      "ref": "standard"
                    },
                    "id": "eu-staff-failover",
                    "rank": 10,
                    "scope": {
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsFailoverRulesItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a failover rule",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the failover rule (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_failover_rule",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsFailoverRulesPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-staff-failover-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eu-staff-failover-1a2b3c4d\"",
                    "failover": {
                      "ref": "standard"
                    },
                    "id": "eu-staff-failover",
                    "rank": 10,
                    "scope": {
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a failover rule",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the failover rule. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_failover_rule",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "failover": {
                  "ref": "standard"
                },
                "rank": 10,
                "scope": {
                  "smart_groups": [
                    "eu-staff"
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsFailoverRules"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-staff-failover-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eu-staff-failover-1a2b3c4d\"",
                    "failover": {
                      "ref": "standard"
                    },
                    "id": "eu-staff-failover",
                    "rank": 10,
                    "scope": {
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a failover rule",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/hooks": {
      "get": {
        "description": "Every managed hook with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_hooks",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "description": "ACME prompt policy check",
                      "endpoint": {
                        "headers": [
                          {
                            "name": "X-Api-Key",
                            "value": "{{secret.api_key}}"
                          },
                          {
                            "name": "X-Agent",
                            "omit_if_empty": true,
                            "value": "{{client.agent.name}}"
                          }
                        ],
                        "on_failure": "allow",
                        "signing": {
                          "secret": "hmac_key"
                        },
                        "timeout_ms": 1500,
                        "url": "https://guard.example.com/v1/check?app={{app.name}}"
                      },
                      "etag": "\"r13-acme-guard-1a2b3c4d\"",
                      "id": "acme-guard",
                      "match": {
                        "api_families": [
                          "openai.chat_completions",
                          "anthropic.messages"
                        ]
                      },
                      "mode": "observe",
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "secrets": {
                        "api_key": "********",
                        "hmac_key": "********"
                      },
                      "send": {
                        "preset": "standard",
                        "request_headers": [
                          "user-agent",
                          "x-team-id"
                        ]
                      },
                      "source": "managed",
                      "stage": "pre_call"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsHooksList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List hooks",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/hooks/field-catalog": {
      "get": {
        "description": "Every field a hook can request, with its type, the stages it is available at, whether it is sensitive, whether it fits a header or URL slot and the presets that include it, plus the fields of each preset per stage. stage narrows the list to one stage.",
        "operationId": "List_hook_fields",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "fields": [
                    {
                      "description": "Caller email.",
                      "path": "user.email",
                      "path_safe": false,
                      "presets": [
                        "standard",
                        "full_export"
                      ],
                      "sensitive": true,
                      "single_value": true,
                      "stages": [
                        "pre_call",
                        "post_call",
                        "on_complete"
                      ],
                      "type": "string"
                    }
                  ],
                  "presets": {
                    "standard": {
                      "pre_call": [
                        "user.email",
                        "app.name"
                      ]
                    }
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/HookFieldCatalog"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List the fields a hook can send",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/hooks/preview": {
      "post": {
        "description": "Validates a draft hook and renders the exact HTTP call it would make for a sample request of the chosen API family, with secrets masked. Nothing is saved or sent. Limited to 10 previews and tests per minute.",
        "operationId": "Preview_a_hook_call",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "api_family": "openai.chat_completions",
                "hook": {
                  "description": "ACME prompt policy check",
                  "endpoint": {
                    "headers": [
                      {
                        "name": "X-Api-Key",
                        "value": "{{secret.api_key}}"
                      },
                      {
                        "name": "X-Agent",
                        "omit_if_empty": true,
                        "value": "{{client.agent.name}}"
                      }
                    ],
                    "on_failure": "allow",
                    "signing": {
                      "secret": "hmac_key"
                    },
                    "timeout_ms": 1500,
                    "url": "https://guard.example.com/v1/check?app={{app.name}}"
                  },
                  "match": {
                    "api_families": [
                      "openai.chat_completions",
                      "anthropic.messages"
                    ]
                  },
                  "mode": "observe",
                  "scope": {
                    "apps": [
                      "support-bot"
                    ]
                  },
                  "secrets": {
                    "api_key": "sk_live_example",
                    "hmac_key": "whsec_example"
                  },
                  "send": {
                    "preset": "standard",
                    "request_headers": [
                      "user-agent",
                      "x-team-id"
                    ]
                  },
                  "stage": "pre_call"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/HookPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "api_family": "openai.chat_completions",
                  "call": {
                    "body": {
                      "request_id": "req_sample"
                    },
                    "body_bytes": 30,
                    "headers": {
                      "Content-Type": "application/json",
                      "X-Api-Key": "********"
                    },
                    "method": "POST",
                    "url": "https://guard.example.com/v1/check?app=support-bot"
                  },
                  "fields": [
                    "app.name",
                    "user.email"
                  ],
                  "request_id": "req_example",
                  "stage": "pre_call",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/HookPreview"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Preview the call a hook would make",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/hooks/{resource_id}": {
      "delete": {
        "description": "Removes the hook; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_hook",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "acme-guard",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a hook",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "hooks:write"
        ]
      },
      "get": {
        "description": "One hook and its ETag.",
        "operationId": "Read_hook",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-acme-guard-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "description": "ACME prompt policy check",
                    "endpoint": {
                      "headers": [
                        {
                          "name": "X-Api-Key",
                          "value": "{{secret.api_key}}"
                        },
                        {
                          "name": "X-Agent",
                          "omit_if_empty": true,
                          "value": "{{client.agent.name}}"
                        }
                      ],
                      "on_failure": "allow",
                      "signing": {
                        "secret": "hmac_key"
                      },
                      "timeout_ms": 1500,
                      "url": "https://guard.example.com/v1/check?app={{app.name}}"
                    },
                    "etag": "\"r13-acme-guard-1a2b3c4d\"",
                    "id": "acme-guard",
                    "match": {
                      "api_families": [
                        "openai.chat_completions",
                        "anthropic.messages"
                      ]
                    },
                    "mode": "observe",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "secrets": {
                      "api_key": "********",
                      "hmac_key": "********"
                    },
                    "send": {
                      "preset": "standard",
                      "request_headers": [
                        "user-agent",
                        "x-team-id"
                      ]
                    },
                    "source": "managed",
                    "stage": "pre_call"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsHooksItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a hook",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the hook (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_hook",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsHooksPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-acme-guard-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "ACME prompt policy check",
                    "endpoint": {
                      "headers": [
                        {
                          "name": "X-Api-Key",
                          "value": "{{secret.api_key}}"
                        },
                        {
                          "name": "X-Agent",
                          "omit_if_empty": true,
                          "value": "{{client.agent.name}}"
                        }
                      ],
                      "on_failure": "allow",
                      "signing": {
                        "secret": "hmac_key"
                      },
                      "timeout_ms": 1500,
                      "url": "https://guard.example.com/v1/check?app={{app.name}}"
                    },
                    "etag": "\"r13-acme-guard-1a2b3c4d\"",
                    "id": "acme-guard",
                    "match": {
                      "api_families": [
                        "openai.chat_completions",
                        "anthropic.messages"
                      ]
                    },
                    "mode": "observe",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "secrets": {
                      "api_key": "********",
                      "hmac_key": "********"
                    },
                    "send": {
                      "preset": "standard",
                      "request_headers": [
                        "user-agent",
                        "x-team-id"
                      ]
                    },
                    "source": "managed",
                    "stage": "pre_call"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a hook",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "hooks:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the hook. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_hook",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "description": "ACME prompt policy check",
                "endpoint": {
                  "headers": [
                    {
                      "name": "X-Api-Key",
                      "value": "{{secret.api_key}}"
                    },
                    {
                      "name": "X-Agent",
                      "omit_if_empty": true,
                      "value": "{{client.agent.name}}"
                    }
                  ],
                  "on_failure": "allow",
                  "signing": {
                    "secret": "hmac_key"
                  },
                  "timeout_ms": 1500,
                  "url": "https://guard.example.com/v1/check?app={{app.name}}"
                },
                "match": {
                  "api_families": [
                    "openai.chat_completions",
                    "anthropic.messages"
                  ]
                },
                "mode": "observe",
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                },
                "secrets": {
                  "api_key": "sk_live_example",
                  "hmac_key": "whsec_example"
                },
                "send": {
                  "preset": "standard",
                  "request_headers": [
                    "user-agent",
                    "x-team-id"
                  ]
                },
                "stage": "pre_call"
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsHooks"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-acme-guard-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "ACME prompt policy check",
                    "endpoint": {
                      "headers": [
                        {
                          "name": "X-Api-Key",
                          "value": "{{secret.api_key}}"
                        },
                        {
                          "name": "X-Agent",
                          "omit_if_empty": true,
                          "value": "{{client.agent.name}}"
                        }
                      ],
                      "on_failure": "allow",
                      "signing": {
                        "secret": "hmac_key"
                      },
                      "timeout_ms": 1500,
                      "url": "https://guard.example.com/v1/check?app={{app.name}}"
                    },
                    "etag": "\"r13-acme-guard-1a2b3c4d\"",
                    "id": "acme-guard",
                    "match": {
                      "api_families": [
                        "openai.chat_completions",
                        "anthropic.messages"
                      ]
                    },
                    "mode": "observe",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "secrets": {
                      "api_key": "********",
                      "hmac_key": "********"
                    },
                    "send": {
                      "preset": "standard",
                      "request_headers": [
                        "user-agent",
                        "x-team-id"
                      ]
                    },
                    "source": "managed",
                    "stage": "pre_call"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a hook",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "hooks:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/hooks/{resource_id}/stats": {
      "get": {
        "description": "This server's view of one hook: whether its circuit breaker (shared by the server's processes) is open and, for on_complete hooks, the export queue (queued records and bytes, delivered, dropped, failed batches, last error and last success).",
        "operationId": "Read_hook_stats",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "breaker_open": false,
                  "export": null,
                  "id": "acme-guard",
                  "request_id": "req_example",
                  "scope": "node",
                  "stage": "pre_call"
                },
                "schema": {
                  "$ref": "#/components/schemas/HookStats"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read hook delivery stats",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/hooks/{resource_id}/test": {
      "post": {
        "description": "Sends one sample call with the saved hook to your endpoint and returns the HTTP status, latency and the parsed decision (pre_call, post_call) or whether the batch was accepted (on_complete). post_call and on_complete samples use sample_response_body (or the family's sample). Limited to 10 previews and tests per minute.",
        "operationId": "Test_a_hook",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "api_family": "openai.chat_completions"
              },
              "schema": {
                "$ref": "#/components/schemas/HookTestRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "api_family": "openai.chat_completions",
                  "decision": "allow",
                  "error_code": null,
                  "http_status": 200,
                  "labels": [],
                  "latency_ms": 84.2,
                  "metadata": {},
                  "ok": true,
                  "reason": null,
                  "request_id": "req_example",
                  "stage": "pre_call",
                  "user_message": null
                },
                "schema": {
                  "$ref": "#/components/schemas/HookTestResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Send a test call with a saved hook",
        "tags": [
          "Hooks"
        ],
        "x-scopes": [
          "hooks:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/limit-exemptions": {
      "get": {
        "description": "Every managed limit exemption with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_limit_exemptions",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-oncall-1a2b3c4d\"",
                      "expires_at": "2027-01-01T00:00:00Z",
                      "id": "oncall",
                      "quotas": "all",
                      "reason": "on call",
                      "scope": {
                        "users": [
                          "oncall@example.com"
                        ]
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsLimitExemptionsList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List limit exemptions",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/limit-exemptions/{resource_id}": {
      "delete": {
        "description": "Removes the limit exemption; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_limit_exemption",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "oncall",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a limit exemption",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "get": {
        "description": "One limit exemption and its ETag.",
        "operationId": "Read_limit_exemption",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-oncall-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-oncall-1a2b3c4d\"",
                    "expires_at": "2027-01-01T00:00:00Z",
                    "id": "oncall",
                    "quotas": "all",
                    "reason": "on call",
                    "scope": {
                      "users": [
                        "oncall@example.com"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsLimitExemptionsItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a limit exemption",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the limit exemption (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_limit_exemption",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsLimitExemptionsPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-oncall-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-oncall-1a2b3c4d\"",
                    "expires_at": "2027-01-01T00:00:00Z",
                    "id": "oncall",
                    "quotas": "all",
                    "reason": "on call",
                    "scope": {
                      "users": [
                        "oncall@example.com"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a limit exemption",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the limit exemption. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_limit_exemption",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_at": "2027-01-01T00:00:00Z",
                "quotas": "all",
                "reason": "on call",
                "scope": {
                  "users": [
                    "oncall@example.com"
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsLimitExemptions"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-oncall-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-oncall-1a2b3c4d\"",
                    "expires_at": "2027-01-01T00:00:00Z",
                    "id": "oncall",
                    "quotas": "all",
                    "reason": "on call",
                    "scope": {
                      "users": [
                        "oncall@example.com"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a limit exemption",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/limit-responses": {
      "get": {
        "description": "Every managed limit response with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_limit_responses",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-friendly-limit-1a2b3c4d\"",
                      "id": "friendly-limit",
                      "message": "Limit {limit} reached; resets {reset}",
                      "retry": "never",
                      "source": "managed",
                      "url": "https://help.example.com/limits"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsLimitResponsesList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List limit responses",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/limit-responses/{resource_id}": {
      "delete": {
        "description": "Removes the limit response; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_limit_response",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "friendly-limit",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a limit response",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "get": {
        "description": "One limit response and its ETag.",
        "operationId": "Read_limit_response",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-friendly-limit-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-friendly-limit-1a2b3c4d\"",
                    "id": "friendly-limit",
                    "message": "Limit {limit} reached; resets {reset}",
                    "retry": "never",
                    "source": "managed",
                    "url": "https://help.example.com/limits"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsLimitResponsesItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a limit response",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the limit response (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_limit_response",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsLimitResponsesPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-friendly-limit-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-friendly-limit-1a2b3c4d\"",
                    "id": "friendly-limit",
                    "message": "Limit {limit} reached; resets {reset}",
                    "retry": "never",
                    "source": "managed",
                    "url": "https://help.example.com/limits"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a limit response",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the limit response. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_limit_response",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "message": "Limit {limit} reached; resets {reset}",
                "retry": "never",
                "url": "https://help.example.com/limits"
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsLimitResponses"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-friendly-limit-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-friendly-limit-1a2b3c4d\"",
                    "id": "friendly-limit",
                    "message": "Limit {limit} reached; resets {reset}",
                    "retry": "never",
                    "source": "managed",
                    "url": "https://help.example.com/limits"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a limit response",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/model-access": {
      "get": {
        "description": "Every managed model access rule with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_model_access_rules",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "allow": [
                        "gpt-4.1"
                      ],
                      "deny": [
                        "gpt-4o"
                      ],
                      "etag": "\"r13-support-models-1a2b3c4d\"",
                      "id": "support-models",
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsModelAccessList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List model access rules",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/model-access/{resource_id}": {
      "delete": {
        "description": "Removes the model access rule; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_model_access_rule",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "support-models",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a model access rule",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "get": {
        "description": "One model access rule and its ETag.",
        "operationId": "Read_model_access_rule",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-support-models-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "allow": [
                      "gpt-4.1"
                    ],
                    "deny": [
                      "gpt-4o"
                    ],
                    "etag": "\"r13-support-models-1a2b3c4d\"",
                    "id": "support-models",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsModelAccessItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a model access rule",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the model access rule (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_model_access_rule",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsModelAccessPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-models-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "allow": [
                      "gpt-4.1"
                    ],
                    "deny": [
                      "gpt-4o"
                    ],
                    "etag": "\"r13-support-models-1a2b3c4d\"",
                    "id": "support-models",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a model access rule",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the model access rule. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_model_access_rule",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "allow": [
                  "gpt-4.1"
                ],
                "deny": [
                  "gpt-4o"
                ],
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsModelAccess"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-models-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "allow": [
                      "gpt-4.1"
                    ],
                    "deny": [
                      "gpt-4o"
                    ],
                    "etag": "\"r13-support-models-1a2b3c4d\"",
                    "id": "support-models",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a model access rule",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/model-limits": {
      "get": {
        "description": "Every managed model limit with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_model_limits",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-gpt41-caps-1a2b3c4d\"",
                      "id": "gpt41-caps",
                      "limits": [
                        {
                          "max_tokens_per_request": 4000,
                          "model": "gpt-4.1"
                        }
                      ],
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsModelLimitsList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List model limits",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/model-limits/{resource_id}": {
      "delete": {
        "description": "Removes the model limit; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_model_limit",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "gpt41-caps",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a model limit",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "get": {
        "description": "One model limit and its ETag.",
        "operationId": "Read_model_limit",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-gpt41-caps-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-gpt41-caps-1a2b3c4d\"",
                    "id": "gpt41-caps",
                    "limits": [
                      {
                        "max_tokens_per_request": 4000,
                        "model": "gpt-4.1"
                      }
                    ],
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsModelLimitsItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a model limit",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the model limit (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_model_limit",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsModelLimitsPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-gpt41-caps-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-gpt41-caps-1a2b3c4d\"",
                    "id": "gpt41-caps",
                    "limits": [
                      {
                        "max_tokens_per_request": 4000,
                        "model": "gpt-4.1"
                      }
                    ],
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a model limit",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the model limit. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_model_limit",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "limits": [
                  {
                    "max_tokens_per_request": 4000,
                    "model": "gpt-4.1"
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsModelLimits"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-gpt41-caps-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-gpt41-caps-1a2b3c4d\"",
                    "id": "gpt41-caps",
                    "limits": [
                      {
                        "max_tokens_per_request": 4000,
                        "model": "gpt-4.1"
                      }
                    ],
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a model limit",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/model-visibility": {
      "get": {
        "description": "Every managed model visibility setting with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_model_visibility_settings",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-contractor-models-1a2b3c4d\"",
                      "id": "contractor-models",
                      "scope": {
                        "smart_groups": [
                          "contractors"
                        ]
                      },
                      "settings": {
                        "hide_aliases": true,
                        "show_only": [
                          {
                            "models": [
                              "gpt-4.1*"
                            ],
                            "providers": [
                              "openai"
                            ]
                          }
                        ]
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsModelVisibilityList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List model visibility settings",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/model-visibility/{resource_id}": {
      "delete": {
        "description": "Removes the model visibility setting; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_model_visibility_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "contractor-models",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a model visibility setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One model visibility setting and its ETag.",
        "operationId": "Read_model_visibility_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-contractor-models-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-contractor-models-1a2b3c4d\"",
                    "id": "contractor-models",
                    "scope": {
                      "smart_groups": [
                        "contractors"
                      ]
                    },
                    "settings": {
                      "hide_aliases": true,
                      "show_only": [
                        {
                          "models": [
                            "gpt-4.1*"
                          ],
                          "providers": [
                            "openai"
                          ]
                        }
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsModelVisibilityItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a model visibility setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the model visibility setting (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_model_visibility_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsModelVisibilityPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-contractor-models-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-contractor-models-1a2b3c4d\"",
                    "id": "contractor-models",
                    "scope": {
                      "smart_groups": [
                        "contractors"
                      ]
                    },
                    "settings": {
                      "hide_aliases": true,
                      "show_only": [
                        {
                          "models": [
                            "gpt-4.1*"
                          ],
                          "providers": [
                            "openai"
                          ]
                        }
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a model visibility setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the model visibility setting. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_model_visibility_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "scope": {
                  "smart_groups": [
                    "contractors"
                  ]
                },
                "settings": {
                  "hide_aliases": true,
                  "show_only": [
                    {
                      "models": [
                        "gpt-4.1*"
                      ],
                      "providers": [
                        "openai"
                      ]
                    }
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsModelVisibility"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-contractor-models-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-contractor-models-1a2b3c4d\"",
                    "id": "contractor-models",
                    "scope": {
                      "smart_groups": [
                        "contractors"
                      ]
                    },
                    "settings": {
                      "hide_aliases": true,
                      "show_only": [
                        {
                          "models": [
                            "gpt-4.1*"
                          ],
                          "providers": [
                            "openai"
                          ]
                        }
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a model visibility setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/prompt-enforcement": {
      "get": {
        "description": "Every managed prompt enforcement setting with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_prompt_enforcement_settings",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-support-prompts-1a2b3c4d\"",
                      "id": "support-prompts",
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "settings": {
                        "require_system_from_store": true,
                        "universal_system_prompt": {
                          "enabled": true,
                          "prompt_id": "support-guidelines"
                        }
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsPromptEnforcementList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List prompt enforcement settings",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/prompt-enforcement/{resource_id}": {
      "delete": {
        "description": "Removes the prompt enforcement setting; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_prompt_enforcement_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "support-prompts",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a prompt enforcement setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One prompt enforcement setting and its ETag.",
        "operationId": "Read_prompt_enforcement_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-support-prompts-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-prompts-1a2b3c4d\"",
                    "id": "support-prompts",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "require_system_from_store": true,
                      "universal_system_prompt": {
                        "enabled": true,
                        "prompt_id": "support-guidelines"
                      }
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsPromptEnforcementItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a prompt enforcement setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the prompt enforcement setting (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_prompt_enforcement_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsPromptEnforcementPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-prompts-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-prompts-1a2b3c4d\"",
                    "id": "support-prompts",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "require_system_from_store": true,
                      "universal_system_prompt": {
                        "enabled": true,
                        "prompt_id": "support-guidelines"
                      }
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a prompt enforcement setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the prompt enforcement setting. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_prompt_enforcement_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                },
                "settings": {
                  "require_system_from_store": true,
                  "universal_system_prompt": {
                    "enabled": true,
                    "prompt_id": "support-guidelines"
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsPromptEnforcement"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-prompts-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-prompts-1a2b3c4d\"",
                    "id": "support-prompts",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "require_system_from_store": true,
                      "universal_system_prompt": {
                        "enabled": true,
                        "prompt_id": "support-guidelines"
                      }
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a prompt enforcement setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/rate-limits": {
      "get": {
        "description": "Every managed rate limit with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_rate_limits",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "adjustments": {
                        "ceiling": 120,
                        "max_duration": "2d"
                      },
                      "etag": "\"r13-support-rpm-1a2b3c4d\"",
                      "group_by": [
                        "user.email"
                      ],
                      "id": "support-rpm",
                      "label": "Support requests per minute",
                      "limit": 60,
                      "metric": "requests",
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "source": "managed",
                      "window": {
                        "kind": "rolling",
                        "unit": "minute"
                      }
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRateLimitsList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List rate limits",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/rate-limits/{resource_id}": {
      "delete": {
        "description": "Removes the rate limit; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_rate_limit",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "support-rpm",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a rate limit",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "get": {
        "description": "One rate limit and its ETag.",
        "operationId": "Read_rate_limit",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-support-rpm-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "adjustments": {
                      "ceiling": 120,
                      "max_duration": "2d"
                    },
                    "etag": "\"r13-support-rpm-1a2b3c4d\"",
                    "group_by": [
                      "user.email"
                    ],
                    "id": "support-rpm",
                    "label": "Support requests per minute",
                    "limit": 60,
                    "metric": "requests",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed",
                    "window": {
                      "kind": "rolling",
                      "unit": "minute"
                    }
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRateLimitsItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a rate limit",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the rate limit (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_rate_limit",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsRateLimitsPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-rpm-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "adjustments": {
                      "ceiling": 120,
                      "max_duration": "2d"
                    },
                    "etag": "\"r13-support-rpm-1a2b3c4d\"",
                    "group_by": [
                      "user.email"
                    ],
                    "id": "support-rpm",
                    "label": "Support requests per minute",
                    "limit": 60,
                    "metric": "requests",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed",
                    "window": {
                      "kind": "rolling",
                      "unit": "minute"
                    }
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a rate limit",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the rate limit. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_rate_limit",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "adjustments": {
                  "ceiling": 120,
                  "max_duration": "2d"
                },
                "group_by": [
                  "user.email"
                ],
                "label": "Support requests per minute",
                "limit": 60,
                "metric": "requests",
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                },
                "window": {
                  "kind": "rolling",
                  "unit": "minute"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsRateLimits"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-rpm-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "adjustments": {
                      "ceiling": 120,
                      "max_duration": "2d"
                    },
                    "etag": "\"r13-support-rpm-1a2b3c4d\"",
                    "group_by": [
                      "user.email"
                    ],
                    "id": "support-rpm",
                    "label": "Support requests per minute",
                    "limit": 60,
                    "metric": "requests",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "source": "managed",
                    "window": {
                      "kind": "rolling",
                      "unit": "minute"
                    }
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a rate limit",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/rate-limits/{resource_id}/grants": {
      "get": {
        "description": "Temporary raises of one rate limit.",
        "operationId": "List_rate_limit_grants",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "bucket": "user.email=alex",
                      "etag": "\"3f1c0a9e5b7d\"",
                      "expires_at": "2026-11-01T00:00:00Z",
                      "id": "gr_1",
                      "limit": 120,
                      "quota_id": "rl_support-rpm",
                      "rate_limit_id": "support-rpm",
                      "reason": "launch",
                      "status": "active",
                      "subject": {
                        "user": "alex@example.com"
                      }
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/RateLimitGrantList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List rate limit grants",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      },
      "post": {
        "description": "Raises one subject's limit until expires_at (extra adds to the limit, limit sets it), capped by the rate limit's adjustments. A new grant supersedes the bucket's previous one.",
        "operationId": "Grant_a_rate_limit_raise",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Not needed with dry_run=true.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "expires_at": "2026-11-01T00:00:00Z",
                "extra": 60,
                "reason": "launch",
                "subject": {
                  "user": "alex@example.com"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/RateLimitGrantCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"3f1c0a9e5b7d\"",
                  "grant": {
                    "bucket": "user.email=alex",
                    "etag": "\"3f1c0a9e5b7d\"",
                    "expires_at": "2026-11-01T00:00:00Z",
                    "id": "gr_1",
                    "limit": 120,
                    "quota_id": "rl_support-rpm",
                    "rate_limit_id": "support-rpm",
                    "reason": "launch",
                    "status": "active",
                    "subject": {
                      "user": "alex@example.com"
                    }
                  },
                  "request_id": "req_example",
                  "superseded": null
                },
                "schema": {
                  "$ref": "#/components/schemas/RateLimitGrantResult"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Grant a temporary raise",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:grant"
        ]
      }
    },
    "/llmgateway/management/v1/controls/rate-limits/{resource_id}/grants/{grant_id}": {
      "delete": {
        "description": "Ends the grant now. If-Match (the grant ETag) is required.",
        "operationId": "Revoke_a_rate_limit_grant",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "example": "grt_4f9a2c1b7e3d",
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Grant ETag from the latest read (428 when missing, 412 when stale).",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Recorded with the revocation.",
            "in": "query",
            "name": "reason",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"4a2b0c9e5b7d\"",
                  "grant": {
                    "bucket": "user.email=alex",
                    "etag": "\"3f1c0a9e5b7d\"",
                    "expires_at": "2026-11-01T00:00:00Z",
                    "id": "gr_1",
                    "limit": 120,
                    "quota_id": "rl_support-rpm",
                    "rate_limit_id": "support-rpm",
                    "reason": "launch",
                    "status": "revoked",
                    "subject": {
                      "user": "alex@example.com"
                    }
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/RateLimitGrantResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Revoke a grant",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:grant"
        ]
      }
    },
    "/llmgateway/management/v1/controls/rate-limits/{resource_id}/usage": {
      "get": {
        "description": "Live counters of one rate limit: one subject's bucket, or the busiest buckets.",
        "operationId": "Read_rate_limit_usage",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One user's bucket.",
            "in": "query",
            "name": "subject.user",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One app's bucket.",
            "in": "query",
            "name": "subject.app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A bucket in canonical form.",
            "in": "query",
            "name": "bucket",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Busiest buckets listed when no subject is given.",
            "in": "query",
            "name": "top",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "buckets": [],
                  "group_by": [
                    "user.email"
                  ],
                  "metric": "requests",
                  "mode": "enforce",
                  "observed_at": "2026-10-27T10:00:00+00:00",
                  "quota_id": "rl_support-rpm",
                  "rate_limit_id": "support-rpm",
                  "request_id": "req_example",
                  "revision": 13,
                  "scope": "regional",
                  "window": {
                    "kind": "rolling",
                    "unit": "minute"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/RateLimitUsage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read rate limit usage",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/rate-limits:migrate-legacy": {
      "post": {
        "description": "Converts the deprecated per-app window limits to rate limits in one revision. dry_run=true previews the quotas and diff.",
        "operationId": "Migrate_legacy_limits",
        "parameters": [
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Not needed with dry_run=true.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {},
              "schema": {
                "$ref": "#/components/schemas/LimitsMigrateLegacy"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "diagnostics": [],
                  "diff": "",
                  "dropped": [],
                  "dry_run": true,
                  "quotas": [],
                  "request_id": "req_example",
                  "revision": 13,
                  "warnings": [],
                  "would_publish": true
                },
                "schema": {
                  "$ref": "#/components/schemas/LimitsMigrateLegacyResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Migrate legacy limits",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/references": {
      "get": {
        "description": "Every route, destination, failover profile, failover rule, failover default, routing constraint, model access entry and limit (with limits:read) that names the provider label (or one model of it), following destination and failover-profile refs, plus console rules that name it. Use it before deleting or renaming a provider.",
        "operationId": "List_provider_references",
        "parameters": [
          {
            "description": "Provider label.",
            "example": "azure-eu",
            "in": "query",
            "name": "provider_label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One model of the label.",
            "example": "gpt-4.1",
            "in": "query",
            "name": "model",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "count": 2,
                  "items": [
                    {
                      "collection": "destinations",
                      "etag": "\"r13-eu-pool-1a2b3c4d\"",
                      "fields": [
                        "members[0]"
                      ],
                      "id": "eu-pool",
                      "source": "managed"
                    },
                    {
                      "collection": "routes",
                      "etag": "\"r13-eu-smart-5e6f7a8b\"",
                      "fields": [
                        "destination(ref eu-pool).members[0]"
                      ],
                      "id": "eu-smart",
                      "source": "managed"
                    }
                  ],
                  "model": null,
                  "provider_label": "azure-eu",
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsReferences"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List references to a provider label",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/request-guards": {
      "get": {
        "description": "Every managed request guard with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_request_guards",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-eng-guard-1a2b3c4d\"",
                      "id": "eng-guard",
                      "max_tokens_per_request": 8000,
                      "scope": {
                        "smart_groups": [
                          "eng"
                        ]
                      },
                      "source": "managed",
                      "timeout_s": 30
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRequestGuardsList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List request guards",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/request-guards/{resource_id}": {
      "delete": {
        "description": "Removes the request guard; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_request_guard",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "eng-guard",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a request guard",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "get": {
        "description": "One request guard and its ETag.",
        "operationId": "Read_request_guard",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-eng-guard-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eng-guard-1a2b3c4d\"",
                    "id": "eng-guard",
                    "max_tokens_per_request": 8000,
                    "scope": {
                      "smart_groups": [
                        "eng"
                      ]
                    },
                    "source": "managed",
                    "timeout_s": 30
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRequestGuardsItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a request guard",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the request guard (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_request_guard",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsRequestGuardsPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eng-guard-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eng-guard-1a2b3c4d\"",
                    "id": "eng-guard",
                    "max_tokens_per_request": 8000,
                    "scope": {
                      "smart_groups": [
                        "eng"
                      ]
                    },
                    "source": "managed",
                    "timeout_s": 30
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a request guard",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the request guard. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_request_guard",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "max_tokens_per_request": 8000,
                "scope": {
                  "smart_groups": [
                    "eng"
                  ]
                },
                "timeout_s": 30
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsRequestGuards"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eng-guard-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-eng-guard-1a2b3c4d\"",
                    "id": "eng-guard",
                    "max_tokens_per_request": 8000,
                    "scope": {
                      "smart_groups": [
                        "eng"
                      ]
                    },
                    "source": "managed",
                    "timeout_s": 30
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a request guard",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/response-cache": {
      "get": {
        "description": "Every managed response cache setting with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_response_cache_settings",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-support-cache-1a2b3c4d\"",
                      "id": "support-cache",
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "settings": {
                        "enabled": true
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsResponseCacheList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List response cache settings",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/response-cache/{resource_id}": {
      "delete": {
        "description": "Removes the response cache setting; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_response_cache_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "support-cache",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a response cache setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One response cache setting and its ETag.",
        "operationId": "Read_response_cache_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-support-cache-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-cache-1a2b3c4d\"",
                    "id": "support-cache",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "enabled": true
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsResponseCacheItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a response cache setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the response cache setting (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_response_cache_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsResponseCachePatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-cache-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-cache-1a2b3c4d\"",
                    "id": "support-cache",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "enabled": true
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a response cache setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the response cache setting. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_response_cache_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                },
                "settings": {
                  "enabled": true
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsResponseCache"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-cache-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-cache-1a2b3c4d\"",
                    "id": "support-cache",
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "enabled": true
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a response cache setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/revisions": {
      "get": {
        "description": "Policy revisions newest first, with who made them, the operation id, the kind of writer and the managed-controls collections each changed.",
        "operationId": "List_policy_revisions",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "active_revision": 13,
                  "items": [
                    {
                      "actor": "management_key:key-1",
                      "created_at": "2026-10-27 10:00:00",
                      "domains_changed": [
                        "routes"
                      ],
                      "kind": "managed",
                      "message": "Management API: routes",
                      "operation_id": "op_example",
                      "revision": 13
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRevisionList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List policy revisions",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/revisions/{revision}/resources/{collection}/{resource_id}": {
      "get": {
        "description": "One control (or console row) as it was at that revision. Needs the collection's read scope.",
        "operationId": "Read_a_resource_at_a_revision",
        "parameters": [
          {
            "description": "Policy revision number.",
            "example": "13",
            "in": "path",
            "name": "revision",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Managed-controls collection path, for example routes, destinations or rate-limits.",
            "example": "routes",
            "in": "path",
            "name": "collection",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "collection": "routes",
                  "created_at": "2026-10-26 18:00:00",
                  "etag": "\"r12-eu-smart-5e6f7a8b\"",
                  "request_id": "req_example",
                  "resource": {
                    "description": "EU staff smart alias",
                    "destination": {
                      "ref": "eu-pool"
                    },
                    "enabled": true,
                    "etag": "\"r13-eu-smart-1a2b3c4d\"",
                    "failover": {
                      "ref": "standard"
                    },
                    "historical": true,
                    "id": "eu-smart",
                    "match": {
                      "requested_models": [
                        "smart"
                      ]
                    },
                    "mode": "active",
                    "priority": 400,
                    "rank": 120,
                    "rank_source": "explicit",
                    "rule_index": 0,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ],
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "session": {
                      "route_decision": "per_conversation"
                    },
                    "shadowed_by": [],
                    "source": "managed",
                    "surface_family": "chat_completion"
                  },
                  "revision": 12
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRevisionResource"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a resource at a revision",
        "tags": [
          "Routing"
        ],
        "x-scopes": [],
        "x-scopes-per-op": true
      }
    },
    "/llmgateway/management/v1/controls/revisions/{revision}/status": {
      "get": {
        "description": "How many gateway processes that served traffic for the tenant run this revision, and which lag.",
        "operationId": "Read_revision_rollout",
        "parameters": [
          {
            "description": "Policy revision number.",
            "example": "13",
            "in": "path",
            "name": "revision",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "active_revision": 13,
                  "available": true,
                  "complete": true,
                  "lagging": [],
                  "processes_on_rev": 4,
                  "processes_reporting": 4,
                  "request_id": "req_example",
                  "revision": 13,
                  "scope": "processes that served traffic for this tenant in the last 60 minutes"
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRevisionStatus"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read revision rollout",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/revisions/{revision}:restore": {
      "post": {
        "description": "Puts every managed-controls collection (or the named domains) back to its state at that revision in one new revision; console rules are untouched. If-Match is the collection ETag and Idempotency-Key is required. A resource that would fail validation now (for example one naming a deleted provider) refuses the restore with 409 restore_conflict listing the problems; dry_run shows them. Needs the write scope of every restored domain.",
        "operationId": "Restore_controls_from_a_revision",
        "parameters": [
          {
            "description": "Policy revision number.",
            "example": "13",
            "in": "path",
            "name": "revision",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Collection ETag \"r<active revision>\" from the latest read (428 when missing, 412 when stale).",
            "example": "\"r13\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Not needed with dry_run=true.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "domains": [
                  "routes"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsRestoreRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "restore": {
                    "domains": [
                      "routes"
                    ],
                    "restore_of": 12
                  },
                  "results": [
                    {
                      "changed": true,
                      "domain": "routes",
                      "id": "eu-smart",
                      "op_index": 0
                    }
                  ],
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRestoreResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Restore controls from a revision",
        "tags": [
          "Routing"
        ],
        "x-scopes": [],
        "x-scopes-per-op": true
      }
    },
    "/llmgateway/management/v1/controls/routes": {
      "get": {
        "description": "Every managed route with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_routes",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "description": "EU staff smart alias",
                      "destination": {
                        "ref": "eu-pool"
                      },
                      "enabled": true,
                      "etag": "\"r13-eu-smart-1a2b3c4d\"",
                      "failover": {
                        "ref": "standard"
                      },
                      "id": "eu-smart",
                      "match": {
                        "requested_models": [
                          "smart"
                        ]
                      },
                      "mode": "active",
                      "priority": 400,
                      "rank": 120,
                      "rank_source": "explicit",
                      "rule_index": 0,
                      "scope": {
                        "apps": [
                          "support-bot"
                        ],
                        "smart_groups": [
                          "eu-staff"
                        ]
                      },
                      "session": {
                        "route_decision": "per_conversation"
                      },
                      "shadowed_by": [],
                      "source": "managed",
                      "surface_family": "chat_completion"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRoutesList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List routes",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/routes/{resource_id}": {
      "delete": {
        "description": "Removes the route; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_route",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "eu-smart",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a route",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "get": {
        "description": "One route and its ETag.",
        "operationId": "Read_route",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-eu-smart-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "description": "EU staff smart alias",
                    "destination": {
                      "ref": "eu-pool"
                    },
                    "enabled": true,
                    "etag": "\"r13-eu-smart-1a2b3c4d\"",
                    "failover": {
                      "ref": "standard"
                    },
                    "id": "eu-smart",
                    "match": {
                      "requested_models": [
                        "smart"
                      ]
                    },
                    "mode": "active",
                    "priority": 400,
                    "rank": 120,
                    "rank_source": "explicit",
                    "rule_index": 0,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ],
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "session": {
                      "route_decision": "per_conversation"
                    },
                    "shadowed_by": [],
                    "source": "managed",
                    "surface_family": "chat_completion"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRoutesItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a route",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the route (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_route",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsRoutesPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-smart-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "EU staff smart alias",
                    "destination": {
                      "ref": "eu-pool"
                    },
                    "enabled": true,
                    "etag": "\"r13-eu-smart-1a2b3c4d\"",
                    "failover": {
                      "ref": "standard"
                    },
                    "id": "eu-smart",
                    "match": {
                      "requested_models": [
                        "smart"
                      ]
                    },
                    "mode": "active",
                    "priority": 400,
                    "rank": 120,
                    "rank_source": "explicit",
                    "rule_index": 0,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ],
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "session": {
                      "route_decision": "per_conversation"
                    },
                    "shadowed_by": [],
                    "source": "managed",
                    "surface_family": "chat_completion"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a route",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the route. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_route",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "description": "EU staff smart alias",
                "destination": {
                  "ref": "eu-pool"
                },
                "failover": {
                  "ref": "standard"
                },
                "match": {
                  "requested_models": [
                    "smart"
                  ]
                },
                "mode": "active",
                "rank": 120,
                "scope": {
                  "apps": [
                    "support-bot"
                  ],
                  "smart_groups": [
                    "eu-staff"
                  ]
                },
                "session": {
                  "route_decision": "per_conversation"
                },
                "surface_family": "chat_completion"
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsRoutes"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-smart-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "EU staff smart alias",
                    "destination": {
                      "ref": "eu-pool"
                    },
                    "enabled": true,
                    "etag": "\"r13-eu-smart-1a2b3c4d\"",
                    "failover": {
                      "ref": "standard"
                    },
                    "id": "eu-smart",
                    "match": {
                      "requested_models": [
                        "smart"
                      ]
                    },
                    "mode": "active",
                    "priority": 400,
                    "rank": 120,
                    "rank_source": "explicit",
                    "rule_index": 0,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ],
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "session": {
                      "route_decision": "per_conversation"
                    },
                    "shadowed_by": [],
                    "source": "managed",
                    "surface_family": "chat_completion"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a route",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/routes/{resource_id}:set-mode": {
      "post": {
        "description": "active routes traffic, observe evaluates the route without routing (shadow), disabled keeps the route but removes its rule. If-Match and Idempotency-Key are required; changed false when nothing changes.",
        "operationId": "Set_mode_route",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Not needed with dry_run=true.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "mode": "observe"
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsRoutesSetMode"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-smart-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "EU staff smart alias",
                    "destination": {
                      "ref": "eu-pool"
                    },
                    "enabled": true,
                    "etag": "\"r13-eu-smart-1a2b3c4d\"",
                    "failover": {
                      "ref": "standard"
                    },
                    "id": "eu-smart",
                    "match": {
                      "requested_models": [
                        "smart"
                      ]
                    },
                    "mode": "active",
                    "priority": 400,
                    "rank": 120,
                    "rank_source": "explicit",
                    "rule_index": 0,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ],
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "session": {
                      "route_decision": "per_conversation"
                    },
                    "shadowed_by": [],
                    "source": "managed",
                    "surface_family": "chat_completion"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Set mode of a route",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:write"
        ]
      }
    },
    "/llmgateway/management/v1/controls/routing-constraints": {
      "get": {
        "description": "Every managed routing constraint with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_routing_constraints",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "description": "EU residency",
                      "etag": "\"r13-eu-residency-1a2b3c4d\"",
                      "id": "eu-residency",
                      "match": [
                        {
                          "in": [
                            "eu"
                          ],
                          "tag": "provider.geo"
                        }
                      ],
                      "providers": {
                        "not_in": [
                          "openai-direct"
                        ]
                      },
                      "require": [
                        {
                          "name": "context_at_least",
                          "tokens": 128000
                        }
                      ],
                      "scope": {
                        "smart_groups": [
                          "eu-staff"
                        ]
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRoutingConstraintsList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List routing constraints",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/routing-constraints/{resource_id}": {
      "delete": {
        "description": "Removes the routing constraint; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_routing_constraint",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing constraints: routes left without candidates become a 422 instead of warnings.",
            "in": "query",
            "name": "strict",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "eu-residency",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a routing constraint",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:constraints"
        ]
      },
      "get": {
        "description": "One routing constraint and its ETag.",
        "operationId": "Read_routing_constraint",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-eu-residency-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "description": "EU residency",
                    "etag": "\"r13-eu-residency-1a2b3c4d\"",
                    "id": "eu-residency",
                    "match": [
                      {
                        "in": [
                          "eu"
                        ],
                        "tag": "provider.geo"
                      }
                    ],
                    "providers": {
                      "not_in": [
                        "openai-direct"
                      ]
                    },
                    "require": [
                      {
                        "name": "context_at_least",
                        "tokens": 128000
                      }
                    ],
                    "scope": {
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsRoutingConstraintsItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a routing constraint",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the routing constraint (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_routing_constraint",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Routing constraints: routes left without candidates become a 422 instead of warnings.",
            "in": "query",
            "name": "strict",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsRoutingConstraintsPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-residency-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "EU residency",
                    "etag": "\"r13-eu-residency-1a2b3c4d\"",
                    "id": "eu-residency",
                    "match": [
                      {
                        "in": [
                          "eu"
                        ],
                        "tag": "provider.geo"
                      }
                    ],
                    "providers": {
                      "not_in": [
                        "openai-direct"
                      ]
                    },
                    "require": [
                      {
                        "name": "context_at_least",
                        "tokens": 128000
                      }
                    ],
                    "scope": {
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a routing constraint",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:constraints"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the routing constraint. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_routing_constraint",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          },
          {
            "description": "Routing constraints: routes left without candidates become a 422 instead of warnings.",
            "in": "query",
            "name": "strict",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Routing writes: drop applies the change to existing conversations too by invalidating the session pins of the affected apps (keep: new conversations only). dry_run shows the apps as impact.pins.",
            "in": "query",
            "name": "repin",
            "required": false,
            "schema": {
              "default": "keep",
              "enum": [
                "keep",
                "drop"
              ]
            }
          },
          {
            "description": "With repin=drop: tenant confirms a drop of EVERY session pin of the tenant, needed when the change is not limited to named apps (else 422 repin_scope_confirmation_required).",
            "in": "query",
            "name": "repin_scope",
            "required": false,
            "schema": {
              "default": "apps",
              "enum": [
                "apps",
                "tenant"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "description": "EU residency",
                "match": [
                  {
                    "in": [
                      "eu"
                    ],
                    "tag": "provider.geo"
                  }
                ],
                "providers": {
                  "not_in": [
                    "openai-direct"
                  ]
                },
                "require": [
                  {
                    "name": "context_at_least",
                    "tokens": 128000
                  }
                ],
                "scope": {
                  "smart_groups": [
                    "eu-staff"
                  ]
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsRoutingConstraints"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-eu-residency-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "description": "EU residency",
                    "etag": "\"r13-eu-residency-1a2b3c4d\"",
                    "id": "eu-residency",
                    "match": [
                      {
                        "in": [
                          "eu"
                        ],
                        "tag": "provider.geo"
                      }
                    ],
                    "providers": {
                      "not_in": [
                        "openai-direct"
                      ]
                    },
                    "require": [
                      {
                        "name": "context_at_least",
                        "tokens": 128000
                      }
                    ],
                    "scope": {
                      "smart_groups": [
                        "eu-staff"
                      ]
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a routing constraint",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:constraints"
        ]
      }
    },
    "/llmgateway/management/v1/controls/token-saving": {
      "get": {
        "description": "Every managed token saving setting with its ETag, then the console policy rules of the same kind as read-only rows (source console, policy, rule_index, view). Console rows cannot be written here (409 rule_not_api_managed). Paginated (limit, cursor bound to the revision) and filtered by source, app, requested_model, mode and references.",
        "operationId": "List_token_saving_settings",
        "parameters": [
          {
            "description": "Page size.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor of the previous page; bound to the revision (409 collection_changed when the policy changed).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only managed resources or only console rows.",
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "enum": [
                "managed",
                "console"
              ]
            }
          },
          {
            "description": "Rows that can apply to this app (rows scoped only by smart group, user or tag are kept). app_name is a deprecated alias.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows that can apply to this requested model. model is a deprecated alias.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Rows with this mode (routes: active, observe, disabled; limits: enforce, alert, paused).",
            "in": "query",
            "name": "mode",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "<provider_label> or <provider_label>/<model>: rows that name it, following destination and failover-profile refs (adds references [paths]).",
            "example": "azure-eu/gpt-4.1",
            "in": "query",
            "name": "references",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13\"",
                  "items": [
                    {
                      "etag": "\"r13-support-token-saving-1a2b3c4d\"",
                      "id": "support-token-saving",
                      "rank": 10,
                      "scope": {
                        "apps": [
                          "support-bot"
                        ]
                      },
                      "settings": {
                        "json_minification": true,
                        "tool_output_cleanup": true
                      },
                      "source": "managed"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsTokenSavingList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List token saving settings",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/controls/token-saving/{resource_id}": {
      "delete": {
        "description": "Removes the token saving setting; refused while other controls reference it. If-Match is required.",
        "operationId": "Delete_token_saving_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "deleted": true,
                  "id": "support-token-saving",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "revision": 14,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a token saving setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One token saving setting and its ETag.",
        "operationId": "Read_token_saving_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"r13-support-token-saving-1a2b3c4d\"",
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-token-saving-1a2b3c4d\"",
                    "id": "support-token-saving",
                    "rank": 10,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "json_minification": true,
                      "tool_output_cleanup": true
                    },
                    "source": "managed"
                  },
                  "revision": 13
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsTokenSavingItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a token saving setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "JSON merge patch of the token saving setting (null removes a field); the result is validated as a whole. If-Match is required. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Update_token_saving_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlsTokenSavingPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-token-saving-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-token-saving-1a2b3c4d\"",
                    "id": "support-token-saving",
                    "rank": 10,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "json_minification": true,
                      "tool_output_cleanup": true
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a token saving setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the token saving setting. Changing an existing one needs If-Match; If-None-Match: * creates only. Writes publish one policy revision. A PUT whose content equals the stored resource returns changed false and publishes nothing.",
        "operationId": "Set_token_saving_setting",
        "parameters": [
          {
            "description": "Client-chosen control ID, ^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$ (console rules read as console:<policy>:<rule_index>).",
            "example": "eu-pool",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview: spec and policy diff, diagnostics, warnings, would_publish and impact; nothing is saved.",
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Resource ETag \"r<revision>-<id>-<hash8>\" from the latest read, or the collection ETag \"r<revision>\". Required to change or delete an existing resource (428 when missing, 412 when stale); an unrelated publish does not invalidate it.",
            "example": "\"r12-eu-pool-1a2b3c4d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body returns the original result, including after a crash once the revision was published. Optional on PUT, PATCH and DELETE.",
            "example": "eu-routing-change-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Create only: 412 when the resource exists with different content.",
            "in": "header",
            "name": "If-None-Match",
            "required": false,
            "schema": {
              "const": "*"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "rank": 10,
                "scope": {
                  "apps": [
                    "support-bot"
                  ]
                },
                "settings": {
                  "json_minification": true,
                  "tool_output_cleanup": true
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ControlsTokenSaving"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"r13-support-token-saving-1a2b3c4d\"",
                  "impact": {
                    "apps": [
                      "support-bot"
                    ],
                    "models": [],
                    "routes": []
                  },
                  "operation_id": "op_example",
                  "propagation": {
                    "poll_seconds": 10,
                    "session_pins": "kept",
                    "status": "/controls/revisions/13/status"
                  },
                  "request_id": "req_example",
                  "resource": {
                    "etag": "\"r13-support-token-saving-1a2b3c4d\"",
                    "id": "support-token-saving",
                    "rank": 10,
                    "scope": {
                      "apps": [
                        "support-bot"
                      ]
                    },
                    "settings": {
                      "json_minification": true,
                      "tool_output_cleanup": true
                    },
                    "source": "managed"
                  },
                  "revision": 13,
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/ControlsWriteResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create or replace a token saving setting",
        "tags": [
          "Gateway features"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/custom-definitions": {
      "get": {
        "description": "Custom detection definitions that apps can select by `edm_id` in detection.custom_definitions. Definitions are authored in the console; this API only references them.",
        "operationId": "List_custom_definitions",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/CustomDefinitionList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List custom definitions",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/custom-definitions/{definition_id}": {
      "get": {
        "description": "One custom definition by its stable ID.",
        "operationId": "Read_a_custom_definition",
        "parameters": [
          {
            "example": "employee_id",
            "in": "path",
            "name": "definition_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "definition": {
                    "definition_id": "employee_id",
                    "display_name": "Employee ID",
                    "edm_id": "employee_id",
                    "enabled": true,
                    "globally_enabled": true,
                    "name": "Employee ID",
                    "reference": "employee_id",
                    "type": "precision"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/CustomDefinitionResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a custom definition",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/failover/summary": {
      "get": {
        "description": "Retries, failovers and outcomes per target over a window.",
        "operationId": "Read_failover_summary",
        "parameters": [
          {
            "description": "Start (RFC 3339 or epoch seconds); default 24 h ago. The window always ends now.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Must be now (or omitted): 422 time_range_not_supported for an earlier end.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One app only.",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated alias of from (a look-back window such as 24h).",
            "in": "query",
            "name": "window",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated alias of app.",
            "in": "query",
            "name": "app_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "from": "2026-10-26T00:00:00+00:00",
                  "request_id": "req_example",
                  "to": "2026-10-27T00:00:00+00:00"
                },
                "schema": {
                  "$ref": "#/components/schemas/FailoverSummary"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read the failover summary",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/features/summary": {
      "get": {
        "description": "How the gateway's features performed on the tenant's traffic: response cache hits, misses, bypasses, hit rate and what hits saved; token saving per method; the provider's prompt caching; retries and failover; streaming share and HTTP status classes. `totals` also lists the most frequent error codes (at most 20).\n\nGroup by up to two of `app`, `model`, `provider` and `surface`, and bucket by `granularity`: total (the default), or UTC `month`, `week` (starting Monday), `day` or `hour` (a range of at most 14 days). `from` defaults to UTC midnight 30 days before `to`; the range is at most 92 days. Requests refused by rate limits, quotas or access rules and background cache-refresh requests are not counted.\n\nResults can be up to 60 seconds old. Recent requests appear within a few minutes. At most 5000 rows are returned (`truncated`). Queries are limited to 20 seconds. 503 `query_timeout` when the query exceeds its time or read limits (narrow it and retry); 503 `data_unavailable` when the data cannot be read right now. 429 `report_busy` (with a Retry-After header) when too many reports are being computed at once; retry after that many seconds.",
        "operationId": "Read_feature_metrics_summary",
        "parameters": [
          {
            "description": "Inclusive start: a date (YYYY-MM-DD, UTC midnight) or an RFC 3339 timestamp with a timezone. Omitted: UTC midnight 30 days before `to` (or today).",
            "example": "2026-10-01",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exclusive end: an RFC 3339 timestamp with a timezone, or a date (YYYY-MM-DD) to include that whole UTC day. Omitted: now.",
            "example": "2026-10-31",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Period of each row: total (one row per group), or UTC month, week (starting Monday), day or hour. hour needs `from` and `to` at most 14 days apart.",
            "in": "query",
            "name": "granularity",
            "schema": {
              "default": "total",
              "enum": [
                "total",
                "month",
                "week",
                "day",
                "hour"
              ],
              "type": "string"
            }
          },
          {
            "description": "Up to 2 of: app, model, provider, surface. Repeat the parameter (group_by=a&group_by=b) or separate values with commas (group_by=a,b).",
            "example": [
              "app"
            ],
            "explode": true,
            "in": "query",
            "name": "group_by",
            "schema": {
              "items": {
                "enum": [
                  "app",
                  "model",
                  "provider",
                  "surface"
                ],
                "type": "string"
              },
              "maxItems": 2,
              "type": "array",
              "uniqueItems": true
            },
            "style": "form"
          },
          {
            "description": "Only this app (exact name, case-insensitive).",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this served model (exact).",
            "in": "query",
            "name": "model",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this provider name (exact).",
            "in": "query",
            "name": "provider",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this API surface (exact, for example chat).",
            "in": "query",
            "name": "surface",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size: 1 to 200, default 50.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "coverage": {
                    "response_cache_from": "2026-09-15T00:00:00Z"
                  },
                  "data_through": "2026-11-01T00:00:00Z",
                  "filters": {
                    "app": "Support Bot"
                  },
                  "from": "2026-10-01T00:00:00Z",
                  "generated_at": "2026-11-01T09:15:02Z",
                  "granularity": "total",
                  "group_by": [],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "rows": [
                    {
                      "failover": {
                        "exhausted": 12,
                        "recovered": 281,
                        "requests_moved": 96,
                        "requests_retried": 214
                      },
                      "prompt_cache": {
                        "cache_write_tokens": 4100000,
                        "cached_input_pct": 37.01,
                        "cached_input_tokens": 22650000,
                        "input_tokens": 61204000
                      },
                      "requests": 48210,
                      "response_cache": {
                        "bypassed": 2210,
                        "hit_rate_pct": 24.76,
                        "hits": 3120,
                        "misses": 9480,
                        "saved_cost_usd": 18.42,
                        "saved_input_tokens": 2954000,
                        "saved_output_tokens": 611000
                      },
                      "status_classes": {
                        "2xx": 47120,
                        "3xx": 0,
                        "4xx": 812,
                        "5xx": 263,
                        "none": 15
                      },
                      "streaming": {
                        "requests": 20113,
                        "share_pct": 41.72
                      },
                      "token_saving": {
                        "by_method": {
                          "base64_blob_elision": 0,
                          "html_to_text": 0,
                          "json_minification": 0,
                          "markdown_to_text": 0,
                          "smart_json_compression": 182400,
                          "text_compression": 0,
                          "tool_output_cleanup": 0
                        },
                        "requests": 5102,
                        "tokens_saved": 182400
                      }
                    }
                  ],
                  "timezone": "UTC",
                  "to": "2026-11-01T00:00:00Z",
                  "totals": {
                    "failover": {
                      "exhausted": 12,
                      "recovered": 281,
                      "requests_moved": 96,
                      "requests_retried": 214
                    },
                    "prompt_cache": {
                      "cache_write_tokens": 4100000,
                      "cached_input_pct": 37.01,
                      "cached_input_tokens": 22650000,
                      "input_tokens": 61204000
                    },
                    "requests": 48210,
                    "response_cache": {
                      "bypassed": 2210,
                      "hit_rate_pct": 24.76,
                      "hits": 3120,
                      "misses": 9480,
                      "saved_cost_usd": 18.42,
                      "saved_input_tokens": 2954000,
                      "saved_output_tokens": 611000
                    },
                    "status_classes": {
                      "2xx": 47120,
                      "3xx": 0,
                      "4xx": 812,
                      "5xx": 263,
                      "none": 15
                    },
                    "streaming": {
                      "requests": 20113,
                      "share_pct": 41.72
                    },
                    "token_saving": {
                      "by_method": {
                        "base64_blob_elision": 0,
                        "html_to_text": 0,
                        "json_minification": 0,
                        "markdown_to_text": 0,
                        "smart_json_compression": 182400,
                        "text_compression": 0,
                        "tool_output_cleanup": 0
                      },
                      "requests": 5102,
                      "tokens_saved": 182400
                    },
                    "top_error_codes": [
                      {
                        "code": "rate_limit_error",
                        "requests": 402
                      },
                      {
                        "code": "invalid_request_error",
                        "requests": 351
                      }
                    ]
                  },
                  "truncated": false
                },
                "schema": {
                  "$ref": "#/components/schemas/FeatureMetricsSummary"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Summarize gateway feature metrics",
        "tags": [
          "Monitoring"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/guardrails/summary": {
      "get": {
        "description": "Counts what the gateway guardrails did to the tenant's traffic: requests scanned, flagged, blocked, redacted and monitored, and the detections behind them. Group by up to two of `category`, `action`, `direction`, `app`, `user` and `model`, and bucket by `granularity`: total (the default), or UTC `month`, `week` (starting Monday), `day` or `hour` (a range of at most 14 days). `from` is inclusive and `to` exclusive; a date `to` includes that whole UTC day.\n\nOnly counts and identifiers are returned, never prompt or response text or the detected values. Categories are `{id, name, type}`: the ids and display names from app settings and policies; custom definitions use their id and the name you gave them. Actions are `blocked`, `redacted` (masked or partially masked) and `monitored` (allowed and recorded, including advisory notes). Requests refused by rate limits, quotas or access rules before they were scanned are not counted, and neither are the background cache-refresh requests or requests from apps with guardrails off.\n\n`totals` always covers the whole selection, whatever the page. With a category, action or direction filter, the flagged, blocked, redacted, monitored and detection counts include only matching detections, while `requests_scanned` still counts every scanned request in scope. Rows grouped by `category`, `action` or `direction` count detections, so their `requests_scanned` is null (as in the example, grouped by category and action); `totals.requests_scanned` is always set. Results can be up to 60 seconds old. Recent requests appear within a few minutes. Pages are ordered by period and then group keys; a cursor stops working (409) when the set of rows changes between pages. At most 5000 rows are returned (`truncated`). Queries are limited to 20 seconds. 503 `query_timeout` when the query exceeds its time or read limits (narrow it and retry); 503 `data_unavailable` when the data cannot be read right now. 429 `report_busy` (with a Retry-After header) when too many reports are being computed at once; retry after that many seconds.",
        "operationId": "Read_guardrail_activity_summary",
        "parameters": [
          {
            "description": "Inclusive start: a date (YYYY-MM-DD, UTC midnight) or an RFC 3339 timestamp with a timezone. Omitted: UTC midnight 30 days before `to` (or today); pass an early date for all history.",
            "example": "2026-10-01",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exclusive end: an RFC 3339 timestamp with a timezone, or a date (YYYY-MM-DD) to include that whole UTC day. Omitted: now.",
            "example": "2026-10-31",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Period of each row: total (one row per group), or UTC month, week (starting Monday), day or hour. hour needs `from` and `to` at most 14 days apart.",
            "in": "query",
            "name": "granularity",
            "schema": {
              "default": "total",
              "enum": [
                "total",
                "month",
                "week",
                "day",
                "hour"
              ],
              "type": "string"
            }
          },
          {
            "description": "Up to 2 of: category, action, direction, app, user, model. Repeat the parameter (group_by=a&group_by=b) or separate values with commas (group_by=a,b).",
            "example": [
              "category",
              "action"
            ],
            "explode": true,
            "in": "query",
            "name": "group_by",
            "schema": {
              "items": {
                "enum": [
                  "category",
                  "action",
                  "direction",
                  "app",
                  "user",
                  "model"
                ],
                "type": "string"
              },
              "maxItems": 2,
              "type": "array",
              "uniqueItems": true
            },
            "style": "form"
          },
          {
            "description": "Only this app (exact name, case-insensitive).",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this user email (case-insensitive).",
            "in": "query",
            "name": "user",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this served model (exact).",
            "in": "query",
            "name": "model",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only detections of this category: its id or display name (case-insensitive), a custom definition's id or name, or `unattributed`.",
            "in": "query",
            "name": "category",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only detections handled with this action.",
            "in": "query",
            "name": "action",
            "schema": {
              "enum": [
                "blocked",
                "redacted",
                "monitored"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only detections in requests (prompts) or responses.",
            "in": "query",
            "name": "direction",
            "schema": {
              "enum": [
                "request",
                "response"
              ],
              "type": "string"
            }
          },
          {
            "description": "Page size: 1 to 200, default 50.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "data_through": "2026-11-01T00:00:00Z",
                  "filters": {
                    "app": "Support Bot"
                  },
                  "from": "2026-10-01T00:00:00Z",
                  "generated_at": "2026-11-01T09:15:02Z",
                  "granularity": "total",
                  "group_by": [
                    "category",
                    "action"
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "rows": [
                    {
                      "action": "blocked",
                      "category": {
                        "id": "adversarial_risk_category_direct_prompt_injection",
                        "name": "Direct Prompt Injection",
                        "type": "adversarial"
                      },
                      "detections": 187,
                      "requests_blocked": 187,
                      "requests_flagged": 187,
                      "requests_monitored": 0,
                      "requests_redacted": 0,
                      "requests_scanned": null
                    },
                    {
                      "action": "redacted",
                      "category": {
                        "id": "data_risk_category_pii",
                        "name": "Personally Identifiable Information (PII)",
                        "type": "data_risk"
                      },
                      "detections": 845,
                      "requests_blocked": 0,
                      "requests_flagged": 812,
                      "requests_monitored": 0,
                      "requests_redacted": 812,
                      "requests_scanned": null
                    },
                    {
                      "action": "monitored",
                      "category": {
                        "id": "8f14e45f-ceea-4e7a-9f3b-2c1d5e6a7b80",
                        "name": "Project Falcon",
                        "type": "custom"
                      },
                      "detections": 96,
                      "requests_blocked": 0,
                      "requests_flagged": 96,
                      "requests_monitored": 96,
                      "requests_redacted": 0,
                      "requests_scanned": null
                    }
                  ],
                  "timezone": "UTC",
                  "to": "2026-11-01T00:00:00Z",
                  "totals": {
                    "detections": 1530,
                    "requests_blocked": 212,
                    "requests_flagged": 1375,
                    "requests_monitored": 301,
                    "requests_redacted": 904,
                    "requests_scanned": 48210
                  },
                  "truncated": false
                },
                "schema": {
                  "$ref": "#/components/schemas/GuardrailActivitySummary"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Summarize guardrail activity",
        "tags": [
          "Monitoring"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/incidents/drop-pins": {
      "post": {
        "description": "Every session pin (any kind) of the selected apps becomes invalid, so the next request of each conversation routes again. Same body, scoping and Idempotency-Key replay as reset-cooldowns; `provider_label` (+ `model`) narrows it to pins on those targets.",
        "operationId": "Drop_incident_session_pins",
        "parameters": [
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "apps": [
                  "Support Bot"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/IncidentAction"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "action": "drop_pins",
                  "applies_to": "targets with provider_label azure-eu in the selected apps",
                  "apps": "*",
                  "changed": true,
                  "generations": {
                    "app_health_generations": {},
                    "app_pin_generations": {},
                    "health_generation": 3,
                    "pin_generation": 2,
                    "target_health_generations": [],
                    "target_pin_generations": []
                  },
                  "model": null,
                  "operation_id": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
                  "propagation": {
                    "applied_on_this_server": true,
                    "nodes": "every gateway node applies it on its next tenant configuration sync",
                    "poll_seconds": 65,
                    "record_version": 4,
                    "session_pins": "kept unless a pin's target is marked down or pins are dropped",
                    "status": "GET /incidents/status?record_version=4",
                    "written": "central configuration store, then this server"
                  },
                  "provider_label": "azure-eu",
                  "record_version": 5,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/IncidentActionResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Drop session pins",
        "tags": [
          "Incidents"
        ],
        "x-scopes": [
          "incidents:write"
        ]
      }
    },
    "/llmgateway/management/v1/incidents/mark-downs": {
      "get": {
        "description": "Active tenant mark-downs (expired ones are not listed) and the tenant-level cooldown and pin generations. Per-app mark-downs set in the console are listed too, read-only, with source \"app\".",
        "operationId": "List_incident_mark_downs",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "generations": {
                    "app_health_generations": {},
                    "app_pin_generations": {},
                    "health_generation": 3,
                    "pin_generation": 1,
                    "target_health_generations": [],
                    "target_pin_generations": []
                  },
                  "items": [
                    {
                      "active": true,
                      "actor": "management_key:mk_example",
                      "apps": "*",
                      "expires_at": "2026-10-28T18:00:00Z",
                      "expires_in": 86400,
                      "id": "inc-123-azure-eu",
                      "model": null,
                      "provider_label": "azure-eu",
                      "read_only": false,
                      "reason": "Azure EU outage",
                      "set_at": "2026-10-27T18:00:00Z",
                      "source": "tenant",
                      "ticket": "INC-123",
                      "version": "9c2f5d0e7a41b3c8"
                    }
                  ],
                  "next_cursor": null,
                  "record_version": 4,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/IncidentMarkDownList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List mark-downs",
        "tags": [
          "Incidents"
        ],
        "x-scopes": [
          "incidents:read"
        ]
      }
    },
    "/llmgateway/management/v1/incidents/mark-downs/{mark_down_id}": {
      "delete": {
        "description": "Removes the mark-down. If-Match is optional and checked when sent. An absent id is 404 mark_down_not_found, which scripts may treat as success (already restored or expired).",
        "operationId": "Restore_an_incident_mark_down",
        "parameters": [
          {
            "description": "Client-chosen mark-down ID, ^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$.",
            "example": "inc-123-azure-eu",
            "in": "path",
            "name": "mark_down_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted mark-down version. Required on PUT only to change an existing mark-down (the same body again is a no-op); optional on DELETE, checked when sent.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "deleted": true,
                  "id": "inc-123-azure-eu",
                  "mark_down": {
                    "active": true,
                    "actor": "management_key:mk_example",
                    "apps": "*",
                    "expires_at": "2026-10-28T18:00:00Z",
                    "expires_in": 86400,
                    "id": "inc-123-azure-eu",
                    "model": null,
                    "provider_label": "azure-eu",
                    "read_only": false,
                    "reason": "Azure EU outage",
                    "set_at": "2026-10-27T18:00:00Z",
                    "source": "tenant",
                    "ticket": "INC-123",
                    "version": "9c2f5d0e7a41b3c8"
                  },
                  "propagation": {
                    "applied_on_this_server": true,
                    "nodes": "every gateway node applies it on its next tenant configuration sync",
                    "poll_seconds": 65,
                    "record_version": 4,
                    "session_pins": "kept unless a pin's target is marked down or pins are dropped",
                    "status": "GET /incidents/status?record_version=4",
                    "written": "central configuration store, then this server"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/IncidentMarkDownDeleted"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Restore a provider",
        "tags": [
          "Incidents"
        ],
        "x-scopes": [
          "incidents:write"
        ]
      },
      "get": {
        "description": "One active mark-down with its propagation state. `version` is its ETag.",
        "operationId": "Read_an_incident_mark_down",
        "parameters": [
          {
            "description": "Client-chosen mark-down ID, ^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$.",
            "example": "inc-123-azure-eu",
            "in": "path",
            "name": "mark_down_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "etag": "\"9c2f5d0e7a41b3c8\"",
                  "mark_down": {
                    "active": true,
                    "actor": "management_key:mk_example",
                    "apps": "*",
                    "expires_at": "2026-10-28T18:00:00Z",
                    "expires_in": 86400,
                    "id": "inc-123-azure-eu",
                    "model": null,
                    "provider_label": "azure-eu",
                    "read_only": false,
                    "reason": "Azure EU outage",
                    "set_at": "2026-10-27T18:00:00Z",
                    "source": "tenant",
                    "ticket": "INC-123",
                    "version": "9c2f5d0e7a41b3c8"
                  },
                  "propagation": {
                    "applied_on_this_server": true,
                    "nodes": "every gateway node applies it on its next tenant configuration sync",
                    "poll_seconds": 65,
                    "record_version": 4,
                    "session_pins": "kept unless a pin's target is marked down or pins are dropped",
                    "status": "GET /incidents/status?record_version=4",
                    "written": "central configuration store, then this server"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/IncidentMarkDownResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a mark-down",
        "tags": [
          "Incidents"
        ],
        "x-scopes": [
          "incidents:read"
        ]
      },
      "put": {
        "description": "Creates (201) or replaces (200) the mark-down with this client-chosen ID. Sending the same body again is a no-op (200, changed false); changing an existing mark-down requires If-Match with its version. `provider_label` must be a tenant provider or an app's provider label; `apps` is \"*\" (every app, including apps created later) or app names. `expires_at` is required, at most 72 hours ahead, and enforced on read; `expires_in_seconds` may be sent instead. A retry with the Idempotency-Key of the PUT that set the mark-down replays its result. A mark-down also invalidates session pins on that target. Applies whether or not policy governs the app, at most 64 active per tenant.",
        "operationId": "Set_an_incident_mark_down",
        "parameters": [
          {
            "description": "Client-chosen mark-down ID, ^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$.",
            "example": "inc-123-azure-eu",
            "in": "path",
            "name": "mark_down_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted mark-down version. Required on PUT only to change an existing mark-down (the same body again is a no-op); optional on DELETE, checked when sent.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "apps": "*",
                "expires_at": "2026-10-28T18:00:00Z",
                "model": null,
                "provider_label": "azure-eu",
                "reason": "Azure EU outage",
                "ticket": "INC-123"
              },
              "schema": {
                "$ref": "#/components/schemas/IncidentMarkDownPut"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentMarkDownResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "changed": true,
                  "etag": "\"9c2f5d0e7a41b3c8\"",
                  "mark_down": {
                    "active": true,
                    "actor": "management_key:mk_example",
                    "apps": "*",
                    "expires_at": "2026-10-28T18:00:00Z",
                    "expires_in": 86400,
                    "id": "inc-123-azure-eu",
                    "model": null,
                    "provider_label": "azure-eu",
                    "read_only": false,
                    "reason": "Azure EU outage",
                    "set_at": "2026-10-27T18:00:00Z",
                    "source": "tenant",
                    "ticket": "INC-123",
                    "version": "9c2f5d0e7a41b3c8"
                  },
                  "propagation": {
                    "applied_on_this_server": true,
                    "nodes": "every gateway node applies it on its next tenant configuration sync",
                    "poll_seconds": 65,
                    "record_version": 4,
                    "session_pins": "kept unless a pin's target is marked down or pins are dropped",
                    "status": "GET /incidents/status?record_version=4",
                    "written": "central configuration store, then this server"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/IncidentMarkDownResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Mark a provider down",
        "tags": [
          "Incidents"
        ],
        "x-scopes": [
          "incidents:write"
        ]
      }
    },
    "/llmgateway/management/v1/incidents/mark-downs:preview": {
      "post": {
        "description": "Takes the same body as the mark-down PUT (expires_at optional) and writes nothing. Returns the apps whose routes use the provider, the routes left with no usable fallback, and where the others would fail over. Health and cooldowns are this server's view; traffic share is not computed.",
        "operationId": "Preview_an_incident_mark_down",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "apps": "*",
                "expires_at": "2026-10-28T18:00:00Z",
                "model": null,
                "provider_label": "azure-eu",
                "reason": "Azure EU outage",
                "ticket": "INC-123"
              },
              "schema": {
                "$ref": "#/components/schemas/IncidentMarkDownPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "apps_affected": [
                    {
                      "app": "Support Bot",
                      "matching_routes": 2,
                      "policy_authority": true
                    }
                  ],
                  "fallback_destinations": [
                    {
                      "app": "Support Bot",
                      "fallback": {
                        "model": "gpt-4.1-mini",
                        "provider_label": "Production OpenAI",
                        "tier": "same_model"
                      },
                      "kind": "default",
                      "primary": {
                        "model": "gpt-4.1-mini",
                        "provider_label": "azure-eu"
                      },
                      "route_id": "default:gpt-4.1-mini",
                      "surface": "chat"
                    }
                  ],
                  "health_scope": "this_node",
                  "mark_down": {
                    "apps": "*",
                    "expires_at": "2026-10-28T18:00:00Z",
                    "model": null,
                    "provider_label": "azure-eu",
                    "reason": "Azure EU outage",
                    "ticket": "INC-123"
                  },
                  "not_computed": [
                    "traffic_share_15m",
                    "constraint_blocked"
                  ],
                  "request_id": "req_example",
                  "routes_losing_all_candidates": [],
                  "truncated": false
                },
                "schema": {
                  "$ref": "#/components/schemas/IncidentMarkDownPreview"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Preview a mark-down",
        "tags": [
          "Incidents"
        ],
        "x-scopes": [
          "incidents:write"
        ]
      }
    },
    "/llmgateway/management/v1/incidents/reset-cooldowns": {
      "post": {
        "description": "Every gateway server forgets the cooldown and circuit-breaker state of the selected apps' targets on its next sync. `provider_label` (+ `model`) narrows the reset to those targets; without it, every target of the selected apps is reset. A retry with the same Idempotency-Key returns the original result without resetting again.",
        "operationId": "Reset_incident_cooldowns",
        "parameters": [
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "apps": "*",
                "provider_label": "azure-eu"
              },
              "schema": {
                "$ref": "#/components/schemas/IncidentAction"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "action": "reset_cooldowns",
                  "applies_to": "targets with provider_label azure-eu in the selected apps",
                  "apps": "*",
                  "changed": true,
                  "generations": {
                    "app_health_generations": {},
                    "app_pin_generations": {},
                    "health_generation": 3,
                    "pin_generation": 1,
                    "target_health_generations": [],
                    "target_pin_generations": []
                  },
                  "model": null,
                  "operation_id": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
                  "propagation": {
                    "applied_on_this_server": true,
                    "nodes": "every gateway node applies it on its next tenant configuration sync",
                    "poll_seconds": 65,
                    "record_version": 4,
                    "session_pins": "kept unless a pin's target is marked down or pins are dropped",
                    "status": "GET /incidents/status?record_version=4",
                    "written": "central configuration store, then this server"
                  },
                  "provider_label": "azure-eu",
                  "record_version": 5,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/IncidentActionResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Reset cooldowns",
        "tags": [
          "Incidents"
        ],
        "x-scopes": [
          "incidents:write"
        ]
      }
    },
    "/llmgateway/management/v1/incidents/status": {
      "get": {
        "description": "Whether incident record version `record_version` (default: the current one) is in force on this server: its stored copy and this process. Other nodes are not polled; each applies a version within `fleet.bound_seconds` (about 65 s) of its write, stated as `fleet.applied_everywhere_by`.",
        "operationId": "Read_incident_status",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "current_record_version": 4,
                  "fleet": {
                    "applied_everywhere_by": "2026-10-27T18:01:05Z",
                    "bound_seconds": 65,
                    "confirmed": false,
                    "note": "every gateway node applies a record version within bound_seconds of its write",
                    "scope": "this_server"
                  },
                  "record_version": 4,
                  "request_id": "req_example",
                  "this_server": {
                    "applied": true,
                    "host": "gw-1",
                    "pid": 4242,
                    "process_record_version": 4,
                    "stored_record_version": 4
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/IncidentStatus"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Incident propagation status",
        "tags": [
          "Incidents"
        ],
        "x-scopes": [
          "incidents:read"
        ]
      }
    },
    "/llmgateway/management/v1/latency": {
      "get": {
        "description": "Latency distributions of the tenant's gateway requests, for building your own dashboards. Each row and `totals` carry five measures: `total` (end to end), `upstream` (waiting on the provider), `gateway_overhead` (time the gateway added, guardrails included), `guardrails` and `time_to_first_token` (streams only). Every measure has a count, mean, p50/p90/p95/p99 (estimated), maximum and an exact histogram over the fixed `histogram_buckets_ms`. A request without a recorded value for a measure is not counted in it.\n\nGroup by up to two of `app`, `model`, `provider`, `surface`, `stream` and `outcome`, and bucket by `granularity`: total (the default), or UTC `month`, `week` (starting Monday), `day` or `hour` (a range of at most 14 days). `from` defaults to UTC midnight 7 days before `to`; the range is at most 92 days. `outcome` selects successful requests by default; pass `error`, `blocked` or `all`. Requests refused by rate limits, quotas or access rules and background cache-refresh requests are not counted. Percentiles of different rows cannot be combined; query with the grouping you need instead.\n\nResults can be up to 60 seconds old. Recent requests appear within a few minutes. At most 5000 rows are returned (`truncated`). Queries are limited to 20 seconds. 503 `query_timeout` when the query exceeds its time or read limits (narrow it and retry); 503 `data_unavailable` when the data cannot be read right now. 429 `report_busy` (with a Retry-After header) when too many reports are being computed at once; retry after that many seconds.",
        "operationId": "Read_latency_summary",
        "parameters": [
          {
            "description": "Inclusive start: a date (YYYY-MM-DD, UTC midnight) or an RFC 3339 timestamp with a timezone. Omitted: UTC midnight 7 days before `to` (or today).",
            "example": "2026-11-01",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exclusive end: an RFC 3339 timestamp with a timezone, or a date (YYYY-MM-DD) to include that whole UTC day. Omitted: now.",
            "example": "2026-11-01",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Period of each row: total (one row per group), or UTC month, week (starting Monday), day or hour. hour needs `from` and `to` at most 14 days apart.",
            "in": "query",
            "name": "granularity",
            "schema": {
              "default": "total",
              "enum": [
                "total",
                "month",
                "week",
                "day",
                "hour"
              ],
              "type": "string"
            }
          },
          {
            "description": "Up to 2 of: app, model, provider, surface, stream, outcome. Repeat the parameter (group_by=a&group_by=b) or separate values with commas (group_by=a,b).",
            "example": [
              "model"
            ],
            "explode": true,
            "in": "query",
            "name": "group_by",
            "schema": {
              "items": {
                "enum": [
                  "app",
                  "model",
                  "provider",
                  "surface",
                  "stream",
                  "outcome"
                ],
                "type": "string"
              },
              "maxItems": 2,
              "type": "array",
              "uniqueItems": true
            },
            "style": "form"
          },
          {
            "description": "Only this app (exact name, case-insensitive).",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this served model (exact).",
            "in": "query",
            "name": "model",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this provider name (exact).",
            "in": "query",
            "name": "provider",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this API surface (exact, for example chat).",
            "in": "query",
            "name": "surface",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only streaming (true) or non-streaming (false) requests.",
            "in": "query",
            "name": "stream",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Which requests to measure: success (default), error, blocked or all.",
            "in": "query",
            "name": "outcome",
            "schema": {
              "default": "success",
              "enum": [
                "success",
                "error",
                "blocked",
                "all"
              ],
              "type": "string"
            }
          },
          {
            "description": "Page size: 1 to 200, default 50.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "data_through": "2026-11-02T00:00:00Z",
                  "filters": {
                    "app": "Support Bot",
                    "outcome": "success"
                  },
                  "from": "2026-11-01T00:00:00Z",
                  "generated_at": "2026-11-02T09:15:02Z",
                  "granularity": "total",
                  "group_by": [
                    "model"
                  ],
                  "histogram_buckets_ms": [
                    {
                      "from": 0,
                      "to": 25
                    },
                    {
                      "from": 25,
                      "to": 50
                    },
                    {
                      "from": 50,
                      "to": 100
                    },
                    {
                      "from": 100,
                      "to": 250
                    },
                    {
                      "from": 250,
                      "to": 500
                    },
                    {
                      "from": 500,
                      "to": 1000
                    },
                    {
                      "from": 1000,
                      "to": 2500
                    },
                    {
                      "from": 2500,
                      "to": 5000
                    },
                    {
                      "from": 5000,
                      "to": 10000
                    },
                    {
                      "from": 10000,
                      "to": 30000
                    },
                    {
                      "from": 30000,
                      "to": 60000
                    },
                    {
                      "from": 60000,
                      "to": null
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "rows": [
                    {
                      "latency": {
                        "gateway_overhead": {
                          "avg_ms": 96.4,
                          "count": 1200,
                          "histogram": [
                            41,
                            260,
                            480,
                            352,
                            51,
                            12,
                            4,
                            0,
                            0,
                            0,
                            0,
                            0
                          ],
                          "max_ms": 1980.0,
                          "p50_ms": 71.0,
                          "p90_ms": 160.2,
                          "p95_ms": 240.8,
                          "p99_ms": 610.0
                        },
                        "guardrails": {
                          "avg_ms": 63.1,
                          "count": 1180,
                          "histogram": [
                            120,
                            410,
                            420,
                            200,
                            22,
                            6,
                            2,
                            0,
                            0,
                            0,
                            0,
                            0
                          ],
                          "max_ms": 1720.0,
                          "p50_ms": 48.0,
                          "p90_ms": 120.5,
                          "p95_ms": 180.0,
                          "p99_ms": 450.2
                        },
                        "time_to_first_token": {
                          "avg_ms": 610.8,
                          "count": 640,
                          "histogram": [
                            0,
                            0,
                            0,
                            40,
                            260,
                            250,
                            82,
                            8,
                            0,
                            0,
                            0,
                            0
                          ],
                          "max_ms": 7400.0,
                          "p50_ms": 480.0,
                          "p90_ms": 1100.0,
                          "p95_ms": 1450.2,
                          "p99_ms": 2600.0
                        },
                        "total": {
                          "avg_ms": 1840.2,
                          "count": 1200,
                          "histogram": [
                            0,
                            0,
                            0,
                            12,
                            61,
                            233,
                            588,
                            214,
                            79,
                            13,
                            0,
                            0
                          ],
                          "max_ms": 28411.0,
                          "p50_ms": 1320.0,
                          "p90_ms": 3410.5,
                          "p95_ms": 4870.0,
                          "p99_ms": 9120.3
                        },
                        "upstream": {
                          "avg_ms": 1702.6,
                          "count": 1200,
                          "histogram": [
                            0,
                            0,
                            0,
                            20,
                            70,
                            260,
                            570,
                            198,
                            70,
                            12,
                            0,
                            0
                          ],
                          "max_ms": 28102.0,
                          "p50_ms": 1205.0,
                          "p90_ms": 3260.1,
                          "p95_ms": 4700.4,
                          "p99_ms": 8980.0
                        }
                      },
                      "model": "gpt-4.1",
                      "requests": 1200
                    }
                  ],
                  "timezone": "UTC",
                  "to": "2026-11-02T00:00:00Z",
                  "totals": {
                    "latency": {
                      "gateway_overhead": {
                        "avg_ms": 96.4,
                        "count": 1200,
                        "histogram": [
                          41,
                          260,
                          480,
                          352,
                          51,
                          12,
                          4,
                          0,
                          0,
                          0,
                          0,
                          0
                        ],
                        "max_ms": 1980.0,
                        "p50_ms": 71.0,
                        "p90_ms": 160.2,
                        "p95_ms": 240.8,
                        "p99_ms": 610.0
                      },
                      "guardrails": {
                        "avg_ms": 63.1,
                        "count": 1180,
                        "histogram": [
                          120,
                          410,
                          420,
                          200,
                          22,
                          6,
                          2,
                          0,
                          0,
                          0,
                          0,
                          0
                        ],
                        "max_ms": 1720.0,
                        "p50_ms": 48.0,
                        "p90_ms": 120.5,
                        "p95_ms": 180.0,
                        "p99_ms": 450.2
                      },
                      "time_to_first_token": {
                        "avg_ms": 610.8,
                        "count": 640,
                        "histogram": [
                          0,
                          0,
                          0,
                          40,
                          260,
                          250,
                          82,
                          8,
                          0,
                          0,
                          0,
                          0
                        ],
                        "max_ms": 7400.0,
                        "p50_ms": 480.0,
                        "p90_ms": 1100.0,
                        "p95_ms": 1450.2,
                        "p99_ms": 2600.0
                      },
                      "total": {
                        "avg_ms": 1840.2,
                        "count": 1200,
                        "histogram": [
                          0,
                          0,
                          0,
                          12,
                          61,
                          233,
                          588,
                          214,
                          79,
                          13,
                          0,
                          0
                        ],
                        "max_ms": 28411.0,
                        "p50_ms": 1320.0,
                        "p90_ms": 3410.5,
                        "p95_ms": 4870.0,
                        "p99_ms": 9120.3
                      },
                      "upstream": {
                        "avg_ms": 1702.6,
                        "count": 1200,
                        "histogram": [
                          0,
                          0,
                          0,
                          20,
                          70,
                          260,
                          570,
                          198,
                          70,
                          12,
                          0,
                          0
                        ],
                        "max_ms": 28102.0,
                        "p50_ms": 1205.0,
                        "p90_ms": 3260.1,
                        "p95_ms": 4700.4,
                        "p99_ms": 8980.0
                      }
                    },
                    "requests": 1200
                  },
                  "truncated": false
                },
                "schema": {
                  "$ref": "#/components/schemas/LatencySummary"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Summarize request latency",
        "tags": [
          "Monitoring"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/limits/effective": {
      "get": {
        "description": "Every quota, request guard and model limit that applies to an app, user and model, the binding one, exemptions and grants, with live counters.",
        "operationId": "Read_effective_limits",
        "parameters": [
          {
            "description": "App name.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "User email.",
            "example": "alex@example.com",
            "in": "query",
            "name": "user",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Requested model.",
            "example": "gpt-4.1",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated alias of requested_model.",
            "in": "query",
            "name": "model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Provider label of the target.",
            "in": "query",
            "name": "provider_label",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Add live counters.",
            "in": "query",
            "name": "include_usage",
            "required": false,
            "schema": {
              "default": true,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": "support-bot",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/LimitsEffective"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read effective limits",
        "tags": [
          "Limits"
        ],
        "x-scopes": [
          "limits:read"
        ]
      }
    },
    "/llmgateway/management/v1/operations/{operation_id}": {
      "get": {
        "description": "State of an idempotent write started by the same management key (other keys get 404). An operation left pending by an interruption can be finished with recover.",
        "operationId": "Get_operation",
        "parameters": [
          {
            "example": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
            "in": "path",
            "name": "operation_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "created_at": 1790251200.0,
                  "operation_id": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
                  "request_id": "req_example",
                  "state": "complete"
                },
                "schema": {
                  "$ref": "#/components/schemas/OperationStatus"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read operation status",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/operations/{operation_id}/recover": {
      "post": {
        "description": "Finishes an interrupted app write (a 503 operation_pending response names its operation_id). Only the key that started it can recover it. Interrupted creations are not recovered here: retry the original POST with the same Idempotency-Key (409 retry_original_request).",
        "operationId": "Post_recover",
        "parameters": [
          {
            "example": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
            "in": "path",
            "name": "operation_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": {
                    "access": {},
                    "detection": {
                      "custom_definitions": [],
                      "enabled_categories": {}
                    },
                    "enabled": true,
                    "limits": {},
                    "mode": "gateway",
                    "name": "Support Bot",
                    "policy_authority": {
                      "active_checksum": null,
                      "active_revision": null,
                      "enabled": false
                    },
                    "prompts": {
                      "universal_system_prompt": {
                        "content": "",
                        "enabled": false
                      }
                    },
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "provider_mode": "shared",
                    "routing": {
                      "custom_routing": [],
                      "routing_groups": [],
                      "token_based_routing_groups": []
                    },
                    "self_service": {},
                    "tags": [
                      "production"
                    ],
                    "transformations": {},
                    "version": "3f1c0a9e5b7d"
                  },
                  "operation_id": "5b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
                  "request_id": "req_example",
                  "state": "complete",
                  "warnings": []
                },
                "schema": {
                  "$ref": "#/components/schemas/RecoverResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Recover a pending operation",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/outbound-ips": {
      "get": {
        "description": "The account-wide Quilr outbound IP setting and every region's addresses. A provider's own use_outbound_ips setting (in its provider_settings) always wins: a region code or true calls it from the Quilr outbound IPs, false calls it directly. A provider without one follows this account-wide setting; with neither set, the provider is called directly. Outbound IPs work for a provider on a public host over https on port 443; a provider linked to a connector keeps its connector. region picks which Quilr region's outbound IPs are used (GET lists every region's addresses). The setting is kept per region.",
        "operationId": "Get_outbound_ips",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "outbound_ips": {
                    "applies_within_seconds": 120,
                    "available": true,
                    "enabled": true,
                    "region": "in",
                    "regions": [
                      {
                        "available": true,
                        "code": "in",
                        "ips": [
                          "203.0.113.10"
                        ],
                        "name": "India"
                      }
                    ],
                    "updated_at": "2026-11-16T10:00:00Z",
                    "updated_by": "management_key:mk_example"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/OutboundIpsResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read the outbound IP setting",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "put": {
        "description": "Set the account-wide setting: enabled true, false, or null to clear it, and the region. A provider's own use_outbound_ips setting (in its provider_settings) always wins: a region code or true calls it from the Quilr outbound IPs, false calls it directly. A provider without one follows this account-wide setting; with neither set, the provider is called directly. Outbound IPs work for a provider on a public host over https on port 443; a provider linked to a connector keeps its connector. region picks which Quilr region's outbound IPs are used (GET lists every region's addresses). The setting is kept per region.",
        "operationId": "Set_outbound_ips",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "enabled": true,
                "region": "in"
              },
              "schema": {
                "$ref": "#/components/schemas/OutboundIpsUpdate"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "outbound_ips": {
                    "applies_within_seconds": 120,
                    "available": true,
                    "enabled": true,
                    "region": "in",
                    "regions": [
                      {
                        "available": true,
                        "code": "in",
                        "ips": [
                          "203.0.113.10"
                        ],
                        "name": "India"
                      }
                    ],
                    "updated_at": "2026-11-16T10:00:00Z",
                    "updated_by": "management_key:mk_example"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/OutboundIpsResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Turn Quilr outbound IPs on or off",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/provider-health": {
      "get": {
        "description": "Health of your providers and models: traffic outcomes over a window and how routing treats each target right now. Per provider label and model: served requests, success rate, errors by class (rate_limited, timeout_or_connection, upstream_5xx, auth_or_permission, client_4xx, other; the same classes request explanations report), upstream latency and time to first token (p50, p95), and how often a failed attempt moved a request to another target. Guardrail blocks, limit rejections and background cache-refresh requests are not provider traffic and are excluded. Choose window (1h, 24h, 7d, 30d; default 24h, ending now) or from and to (`from` inclusive, `to` exclusive; a date `to` includes that whole UTC day; at most 30 days, starting within the last year); filter by provider label, model or app. routing_state combines admin mark-downs with the cooldown and circuit-breaker state routing on this server sees (routing_state_scope); when some apps' state cannot be read (routing_state_scope.complete false), targets without a state report `unknown`, never healthy. `generated_at` says when the traffic outcomes were read. Configured providers without traffic are listed with zero requests. At most 500 provider and model pairs are returned (`truncated`). Results can be up to 60 seconds old. For failover totals and recovery see GET /failover/summary; to take a target out of rotation see the Incidents operations. Queries are limited to 20 seconds. 503 `query_timeout` when the query exceeds its time or read limits (narrow it and retry); 503 `data_unavailable` when the data cannot be read right now.",
        "operationId": "Read_provider_health",
        "parameters": [
          {
            "description": "Window ending now. Not combined with from/to.",
            "in": "query",
            "name": "window",
            "schema": {
              "default": "24h",
              "enum": [
                "1h",
                "24h",
                "7d",
                "30d"
              ],
              "type": "string"
            }
          },
          {
            "description": "Inclusive start: a date (YYYY-MM-DD, UTC midnight) or an RFC 3339 timestamp with a timezone. Omitted: the start of window. Not combined with window; with to, at most 30 days.",
            "example": "2026-11-01T00:00:00Z",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exclusive end: an RFC 3339 timestamp with a timezone, or a date (YYYY-MM-DD) to include that whole UTC day. Omitted: now.",
            "example": "2026-11-02T00:00:00Z",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact provider label.",
            "in": "query",
            "name": "provider",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact model id.",
            "in": "query",
            "name": "model",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this app's traffic, routing state and mark-downs (case-insensitive name).",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "filters": {
                    "app": null,
                    "model": null,
                    "provider": null
                  },
                  "from": "2026-11-01T10:00:00Z",
                  "generated_at": "2026-11-02T09:59:30Z",
                  "providers": [
                    {
                      "configured": true,
                      "errors": {
                        "auth_or_permission": 0,
                        "client_4xx": 2,
                        "other": 0,
                        "rate_limited": 14,
                        "timeout_or_connection": 3,
                        "upstream_5xx": 4
                      },
                      "failovers_away": 9,
                      "failures": 23,
                      "latency_ms": {
                        "p50": 812.4,
                        "p95": 2950.0
                      },
                      "models": [
                        {
                          "errors": {
                            "auth_or_permission": 0,
                            "client_4xx": 2,
                            "other": 0,
                            "rate_limited": 14,
                            "timeout_or_connection": 3,
                            "upstream_5xx": 4
                          },
                          "failovers_away": 9,
                          "failures": 23,
                          "last_request_at": "2026-11-02T09:58:41Z",
                          "latency_ms": {
                            "p50": 812.4,
                            "p95": 2950.0
                          },
                          "model": "gpt-5.2",
                          "requests": 1840,
                          "routing_state": {
                            "mark_downs": [],
                            "state": "cooling_down",
                            "until": "2026-11-02T10:00:20Z"
                          },
                          "success_rate_pct": 98.75,
                          "time_to_first_token_ms": {
                            "p50": 410.2,
                            "p95": 1302.7,
                            "streamed_requests": 1210
                          }
                        }
                      ],
                      "provider_label": "Production OpenAI",
                      "provider_name": "openai",
                      "requests": 1840,
                      "routing_state": {
                        "mark_downs": [],
                        "state": "cooling_down"
                      },
                      "success_rate_pct": 98.75,
                      "time_to_first_token_ms": {
                        "p50": 410.2,
                        "p95": 1302.7,
                        "streamed_requests": 1210
                      }
                    }
                  ],
                  "request_id": "req_example",
                  "routing_state_scope": {
                    "apps_attempted": 3,
                    "apps_evaluated": 3,
                    "apps_failed": 0,
                    "apps_total": 3,
                    "complete": true,
                    "note": "Cooldown and circuit state is what routing on this server sees now; every gateway server keeps its own. Admin mark-downs apply on every server.",
                    "scope": "this_server"
                  },
                  "to": "2026-11-02T10:00:00Z",
                  "truncated": false,
                  "window": "24h"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderHealth"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read provider health",
        "tags": [
          "Monitoring"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/provider-model-reviews": {
      "get": {
        "description": "Models your providers started offering after the gateway began watching them, one item per model, with status pending, approved or rejected. A provider with a model list serves only listed models, so a pending model is not callable until approved. Providers without a model list serve every model and are not reviewed; models already offered when watching began are never listed. Filter by status, provider label or app (an app's own provider keys). Newest first; page with `limit` (1 to 200, default 50) and `cursor`. settings reports the background check switch.",
        "operationId": "List_provider_model_reviews",
        "parameters": [
          {
            "description": "Only models in this state; omit for all three.",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "pending",
                "approved",
                "rejected"
              ]
            }
          },
          {
            "description": "Exact provider label.",
            "in": "query",
            "name": "provider",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only providers this app holds with its own keys (case-insensitive name).",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size: 1 to 200, default 50.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "available": true,
                  "items": [
                    {
                      "app_name": null,
                      "decided_at": null,
                      "decided_by": null,
                      "display_name": "GPT-5.2 mini",
                      "first_seen_at": "2026-10-30T08:00:00Z",
                      "label": "Production OpenAI",
                      "model_id": "gpt-5.2-mini",
                      "model_type": "chat",
                      "provider_name": "openai",
                      "status": "pending"
                    }
                  ],
                  "next_cursor": null,
                  "pending_count": 1,
                  "request_id": "req_example",
                  "settings": {
                    "background_checks": true,
                    "check_interval_seconds": 21600,
                    "enabled": false
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderModelReviewPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List new-model reviews",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/provider-model-reviews/{label}": {
      "get": {
        "description": "The last model listing of one provider and its pending, approved and rejected models. Without app_name the label names a shared provider; with app_name, a provider that app holds with its own keys.",
        "operationId": "Read_a_provider_model_review",
        "parameters": [
          {
            "description": "Provider label, URL-encoded: a shared provider's label, or with app_name the label of a provider that app holds with its own keys.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Name of the app holding the provider with its own keys; omit for a shared provider.",
            "in": "query",
            "name": "app_name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "provider": {
                    "app_name": null,
                    "approved": [],
                    "label": "Production OpenAI",
                    "last_checked_at": "2026-11-02T06:00:00Z",
                    "last_error": null,
                    "last_success_at": "2026-11-02T06:00:00Z",
                    "listing_status": "ok",
                    "pending": [
                      {
                        "decided_at": null,
                        "decided_by": null,
                        "display_name": "GPT-5.2 mini",
                        "first_seen_at": "2026-10-30T08:00:00Z",
                        "model_id": "gpt-5.2-mini",
                        "model_type": "chat",
                        "status": "pending"
                      }
                    ],
                    "pending_count": 1,
                    "provider_name": "openai",
                    "rejected": []
                  },
                  "request_id": "req_example",
                  "settings": {
                    "background_checks": true,
                    "check_interval_seconds": 21600,
                    "enabled": false
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderModelReviewProvider"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read one provider's new-model reviews",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/provider-model-reviews/{label}/app-decisions": {
      "post": {
        "description": "For a provider an app holds with its own keys: `{label}` is that provider's label and app_name the app. approved adds the models to that provider's model list in one versioned app save (a new configuration version; 409 if the app changed meanwhile), then closes the reviews. rejected and pending work as for shared providers. An app that uses shared providers has no own providers: decide on the shared provider instead. Writes need an Idempotency-Key: a retry with the same key and body replays the first result for 24 hours. Every model must be a reviewed model of this provider in a state the decision can leave (422 otherwise); a decision that already holds is accepted and changes nothing.",
        "operationId": "Approve_or_reject_app_provider_models",
        "parameters": [
          {
            "description": "The app's own provider label, URL-encoded: the label of a provider the app named by app_name holds with its own keys (not a shared provider).",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "approve-gpt-5-2-mini-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "app_name": "Support Bot",
                "models": [
                  "gpt-5.2-mini"
                ],
                "status": "approved"
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderModelReviewAppDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "added_to_model_list": [
                    "gpt-5.2-mini"
                  ],
                  "app_name": "Support Bot",
                  "label": "Team OpenAI",
                  "models": [
                    "gpt-5.2-mini"
                  ],
                  "operation_id": "0d9b2f7a-1c4e-4b8f-a3d2-5e6f7a8b9c0d",
                  "request_id": "req_example",
                  "status": "approved"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderModelReviewDecisionResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Approve or reject new models of an app's own provider",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/provider-model-reviews/{label}/decisions": {
      "post": {
        "description": "approved adds the models to the shared provider's model list (optionally with prices) through the same save as updating the provider, then closes the reviews; the response carries the provider's new version. A provider without a model list cannot be approved on (409). rejected rejects pending models; pending restores rejected ones. Neither changes what the provider serves. Writes need an Idempotency-Key: a retry with the same key and body replays the first result for 24 hours. Every model must be a reviewed model of this provider in a state the decision can leave (422 otherwise); a decision that already holds is accepted and changes nothing.",
        "operationId": "Approve_or_reject_provider_models",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "approve-gpt-5-2-mini-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "model_costs": {
                  "gpt-5.2-mini": {
                    "input_per_1m": 0.25,
                    "output_per_1m": 2.0
                  }
                },
                "models": [
                  "gpt-5.2-mini"
                ],
                "status": "approved"
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderModelReviewDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "added_to_model_list": [
                    "gpt-5.2-mini"
                  ],
                  "app_name": null,
                  "label": "Production OpenAI",
                  "models": [
                    "gpt-5.2-mini"
                  ],
                  "operation_id": "6f0c3c1e-8f3a-4c43-9d7e-2a1b5c9d0e11",
                  "provider_version": "3f1c0a9e5b7d",
                  "request_id": "req_example",
                  "status": "approved"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderModelReviewDecisionResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Approve or reject new models of a shared provider",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/providers": {
      "get": {
        "description": "Shared providers of the tenant with secret settings omitted. Filter by provider type, enabled state, tags (repeatable, ANDed) and selected models (repeatable, ANDed); deleted providers are included only with include_deleted=true.",
        "operationId": "List_shared_providers",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact provider type.",
            "in": "query",
            "name": "provider_name",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "enabled",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Repeatable (ANDed). `key` matches a present, non-empty tag value; `key:value` (split at the first colon) matches a string exactly, a list member, or a boolean/number as JSON (true, 42). Each condition matches the provider's public tags (with presets) or any selected model's public model_metadata tags (including the derived canonical_model).",
            "explode": true,
            "in": "query",
            "name": "tag",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "style": "form"
          },
          {
            "description": "Repeatable (ANDed). Exact ID in selected_models.",
            "explode": true,
            "in": "query",
            "name": "model",
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "style": "form"
          },
          {
            "in": "query",
            "name": "include_deleted",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "configured_secret_fields": [
                        "api_key"
                      ],
                      "connection": {},
                      "credential_configured": true,
                      "credentials_updated_at": "2026-09-24T12:00:00Z",
                      "enabled": true,
                      "is_active": true,
                      "label": "Production OpenAI",
                      "model_costs": {},
                      "model_metadata": {},
                      "provider_id": "prv_7c2d9e",
                      "provider_name": "openai",
                      "selected_models": [
                        "gpt-4.1-mini"
                      ],
                      "tags": {},
                      "upstream_limits": {},
                      "version": "9a8b7c6d5e4f"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List shared providers",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "Creates a tenant-wide provider that apps can attach. `label` and `provider_name` are immutable. Credentials go in `provider_settings` and are never returned. Saving never calls the upstream; use the test and available-models operations to check settings.",
        "operationId": "Create_a_shared_provider",
        "parameters": [
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "bedrock": {
                  "summary": "Amazon Bedrock with an assumed role",
                  "value": {
                    "label": "Bedrock US",
                    "provider_name": "bedrock",
                    "provider_settings": {
                      "aws_auth_mode": "assume_role",
                      "aws_external_id": "<external-id>",
                      "aws_region": "us-east-1",
                      "aws_role_arn": "arn:aws:iam::123456789012:role/gateway"
                    },
                    "selected_models": [
                      "anthropic.claude-sonnet-4-20250514-v1:0"
                    ],
                    "tags": {
                      "region": "us-east-1"
                    }
                  }
                },
                "openai": {
                  "summary": "OpenAI with an API key",
                  "value": {
                    "label": "Production OpenAI",
                    "provider_name": "openai",
                    "provider_settings": {
                      "api_key": "<provider-api-key>"
                    },
                    "selected_models": [
                      "gpt-4.1-mini"
                    ]
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "provider": {
                    "configured_secret_fields": [
                      "api_key"
                    ],
                    "connection": {},
                    "credential_configured": true,
                    "credentials_updated_at": "2026-09-24T12:00:00Z",
                    "enabled": true,
                    "is_active": true,
                    "label": "Production OpenAI",
                    "model_costs": {},
                    "model_metadata": {},
                    "provider_id": "prv_7c2d9e",
                    "provider_name": "openai",
                    "selected_models": [
                      "gpt-4.1-mini"
                    ],
                    "tags": {},
                    "upstream_limits": {},
                    "version": "9a8b7c6d5e4f"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create a shared provider",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/providers/available-models": {
      "post": {
        "description": "Lists the models the upstream offers for draft settings, before the provider is saved. `validate: true` also probes every listed model (slower, can incur upstream usage). Providers that cannot list models return outcome manual_entry. Nothing is saved.",
        "operationId": "Discover_models_for_draft_settings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "provider_name": "openai",
                "provider_settings": {
                  "api_key": "<provider-api-key>"
                },
                "validate": false
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderDraftAvailableModels"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "discovery": {
                    "based_on_version": null,
                    "code": "models_listed",
                    "completed_at": 1790251200.0,
                    "count": 2,
                    "label": null,
                    "latency_ms": 410.2,
                    "message": null,
                    "models": [
                      {
                        "id": "gpt-4.1-mini"
                      },
                      {
                        "id": "gpt-4.1"
                      }
                    ],
                    "outcome": "passed",
                    "provider_name": "openai",
                    "validation_completed": false,
                    "validation_requested": false,
                    "warnings": []
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderDiscoveryResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Discover models for draft settings",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/providers/test-settings": {
      "post": {
        "description": "Tests settings for a provider that does not exist yet, before saving it: a connection check plus one probe per listed model. Nothing is saved. Outcomes include timeout and skipped (with a reason code) in addition to passed, failed and unsupported.",
        "operationId": "Test_draft_provider_settings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "models": [
                  "gpt-4.1-mini"
                ],
                "provider_name": "openai",
                "provider_settings": {
                  "api_key": "<provider-api-key>"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderDraftTestSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "test": {
                    "based_on_version": null,
                    "completed_at": 1790251200.0,
                    "connection": {
                      "code": "probe_passed",
                      "latency_ms": 280.1,
                      "message": null,
                      "outcome": "passed"
                    },
                    "label": null,
                    "models": [
                      {
                        "code": "probe_passed",
                        "latency_ms": 280.1,
                        "message": null,
                        "model": "gpt-4.1-mini",
                        "outcome": "passed"
                      }
                    ],
                    "models_truncated": false,
                    "provider_name": "openai"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderTestSettingsResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Test draft provider settings",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/providers/{label}": {
      "delete": {
        "description": "Deletes the provider. Refused with 409 provider_in_use while any app attaches it; detach it first. Send the quoted version from the latest read in If-Match.",
        "operationId": "Delete_a_shared_provider",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "deleted": true,
                  "label": "Production OpenAI",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderDeleted"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a shared provider",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      },
      "get": {
        "description": "One shared provider with secret settings omitted. `version` is its ETag.",
        "operationId": "Read_a_shared_provider",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "provider": {
                    "configured_secret_fields": [
                      "api_key"
                    ],
                    "connection": {},
                    "credential_configured": true,
                    "credentials_updated_at": "2026-09-24T12:00:00Z",
                    "enabled": true,
                    "is_active": true,
                    "label": "Production OpenAI",
                    "model_costs": {},
                    "model_metadata": {},
                    "provider_id": "prv_7c2d9e",
                    "provider_name": "openai",
                    "selected_models": [
                      "gpt-4.1-mini"
                    ],
                    "tags": {},
                    "upstream_limits": {},
                    "version": "9a8b7c6d5e4f"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a shared provider",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Partial update. Omitted secret settings keep their stored value; `enabled: false` disables the provider for every app. `model_metadata_reset` and `tags_reset` return values to their catalog or derived defaults. Send the quoted version from the latest read in If-Match.",
        "operationId": "Update_or_disable_a_provider",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "disable": {
                  "summary": "Disable",
                  "value": {
                    "enabled": false
                  }
                },
                "models": {
                  "summary": "Change selected models",
                  "value": {
                    "selected_models": [
                      "gpt-4.1-mini",
                      "gpt-4.1"
                    ]
                  }
                },
                "rotate": {
                  "summary": "Rotate the API key",
                  "value": {
                    "provider_settings": {
                      "api_key": "<new-provider-api-key>"
                    }
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "provider": {
                    "configured_secret_fields": [
                      "api_key"
                    ],
                    "connection": {},
                    "credential_configured": true,
                    "credentials_updated_at": "2026-09-24T12:00:00Z",
                    "enabled": false,
                    "is_active": true,
                    "label": "Production OpenAI",
                    "model_costs": {},
                    "model_metadata": {},
                    "provider_id": "prv_7c2d9e",
                    "provider_name": "openai",
                    "selected_models": [
                      "gpt-4.1-mini"
                    ],
                    "tags": {},
                    "upstream_limits": {},
                    "version": "9a8b7c6d5e4f"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update or disable a provider",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/providers/{label}/available-models": {
      "post": {
        "description": "Lists the models the upstream offers for a stored provider, optionally with draft settings merged on top. Nothing is saved; update `selected_models` separately.",
        "operationId": "Discover_provider_models",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "validate": false
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderAvailableModels"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "discovery": {
                    "based_on_version": "9a8b7c6d5e4f",
                    "code": "models_listed",
                    "completed_at": 1790251200.0,
                    "count": 1,
                    "label": "Production OpenAI",
                    "latency_ms": 390.0,
                    "message": null,
                    "models": [
                      {
                        "id": "gpt-4.1-mini"
                      }
                    ],
                    "outcome": "passed",
                    "provider_name": "openai",
                    "validation_completed": false,
                    "validation_requested": false,
                    "warnings": []
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderDiscoveryResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Discover provider models",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/providers/{label}/test": {
      "post": {
        "description": "Tests the stored configuration. `kind: model` sends one small request to a selected model; `kind: connection` probes the selected models (up to a fixed number) and reports each. Outcomes are passed, failed or unsupported (provider types outside `model_test_provider_types`). Probes can incur upstream usage. Nothing is saved.",
        "operationId": "Test_connection_or_model",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "connection": {
                  "summary": "Connection",
                  "value": {
                    "kind": "connection"
                  }
                },
                "model": {
                  "summary": "One model",
                  "value": {
                    "kind": "model",
                    "model": "gpt-4.1-mini"
                  }
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderTest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "test": {
                    "code": "probe_passed",
                    "completed_at": 1790251200.0,
                    "configuration_version": "9a8b7c6d5e4f",
                    "kind": "model",
                    "latency_ms": 320.5,
                    "message": null,
                    "model": "gpt-4.1-mini",
                    "outcome": "passed"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderTestResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Test connection or model",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/providers/{label}/test-settings": {
      "post": {
        "description": "Tests draft changes to a stored provider before saving them. Draft settings merge onto the stored ones; a blank secret keeps the stored value. With no body, tests the stored configuration. Nothing is saved.",
        "operationId": "Test_provider_settings",
        "parameters": [
          {
            "description": "Shared-provider label, URL-encoded.",
            "example": "Production OpenAI",
            "in": "path",
            "name": "label",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "models": [
                  "gpt-4.1"
                ],
                "provider_settings": {
                  "base_url": "https://api.openai.com/v1"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/ProviderTestSettings"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "test": {
                    "based_on_version": "9a8b7c6d5e4f",
                    "completed_at": 1790251200.0,
                    "connection": {
                      "code": "probe_passed",
                      "latency_ms": 280.1,
                      "message": null,
                      "outcome": "passed"
                    },
                    "label": "Production OpenAI",
                    "models": [],
                    "models_truncated": false,
                    "provider_name": "openai"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ProviderTestSettingsResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Test provider settings",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/quota-pools": {
      "get": {
        "description": "Registered pools with their member providers and models. `unregistered` lists pool IDs that providers reference but that were never registered; create one with that pool_id to adopt it.",
        "operationId": "List_quota_pools",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "created_at": "2026-09-24T12:00:00Z",
                      "description": "Shared OpenAI organization limits",
                      "last_verified_at": null,
                      "limits": {
                        "input_tpm": 2000000,
                        "max_inflight_requests": null,
                        "output_tpm": null,
                        "rpd": null,
                        "rpm": 5000,
                        "total_tpm": null
                      },
                      "members": {
                        "models": [],
                        "providers": [
                          "Production OpenAI"
                        ]
                      },
                      "name": "OpenAI organization",
                      "pool_id": "openai-org-main",
                      "source": "manual",
                      "source_url": null,
                      "updated_at": "2026-09-24T12:00:00Z",
                      "version": "1a2b3c4d5e6f"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "unregistered": []
                },
                "schema": {
                  "$ref": "#/components/schemas/QuotaPoolList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List quota pools",
        "tags": [
          "Quota pools"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "Registers a pool of upstream limits shared by several providers or models. Limits are descriptive ceilings (null means unknown). Membership is set on providers, not here.",
        "operationId": "Create_a_quota_pool",
        "parameters": [
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result for 24 hours; the same key with a different body is a 409.",
            "example": "create-support-bot-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "limits": {
                  "input_tpm": 2000000,
                  "rpm": 5000
                },
                "name": "OpenAI organization",
                "pool_id": "openai-org-main"
              },
              "schema": {
                "$ref": "#/components/schemas/QuotaPoolCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "pool": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "description": "Shared OpenAI organization limits",
                    "last_verified_at": null,
                    "limits": {
                      "input_tpm": 2000000,
                      "max_inflight_requests": null,
                      "output_tpm": null,
                      "rpd": null,
                      "rpm": 5000,
                      "total_tpm": null
                    },
                    "members": {
                      "models": [],
                      "providers": [
                        "Production OpenAI"
                      ]
                    },
                    "name": "OpenAI organization",
                    "pool_id": "openai-org-main",
                    "source": "manual",
                    "source_url": null,
                    "updated_at": "2026-09-24T12:00:00Z",
                    "version": "1a2b3c4d5e6f"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/QuotaPoolResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create a quota pool",
        "tags": [
          "Quota pools"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/quota-pools/{pool_id}": {
      "delete": {
        "description": "Deletes the pool. Refused with 409 quota_pool_in_use while providers or models reference it, unless detach=true, which first removes it from every member. Send the quoted version from the latest read in If-Match.",
        "operationId": "Delete_a_quota_pool",
        "parameters": [
          {
            "example": "openai-org-main",
            "in": "path",
            "name": "pool_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Remove the pool from every member provider/model first (409 quota_pool_in_use otherwise).",
            "in": "query",
            "name": "detach",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "deleted": true,
                  "detached": {
                    "models": [],
                    "providers": []
                  },
                  "pool_id": "openai-org-main",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/QuotaPoolDeleted"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a quota pool",
        "tags": [
          "Quota pools"
        ],
        "x-scopes": [
          "providers:write"
        ]
      },
      "get": {
        "description": "One pool with its members. `version` is its ETag.",
        "operationId": "Read_a_quota_pool",
        "parameters": [
          {
            "example": "openai-org-main",
            "in": "path",
            "name": "pool_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "pool": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "description": "Shared OpenAI organization limits",
                    "last_verified_at": null,
                    "limits": {
                      "input_tpm": 2000000,
                      "max_inflight_requests": null,
                      "output_tpm": null,
                      "rpd": null,
                      "rpm": 5000,
                      "total_tpm": null
                    },
                    "members": {
                      "models": [],
                      "providers": [
                        "Production OpenAI"
                      ]
                    },
                    "name": "OpenAI organization",
                    "pool_id": "openai-org-main",
                    "source": "manual",
                    "source_url": null,
                    "updated_at": "2026-09-24T12:00:00Z",
                    "version": "1a2b3c4d5e6f"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/QuotaPoolResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a quota pool",
        "tags": [
          "Quota pools"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Partial update; omitted limit keys keep their value. `pool_id` is immutable. Send the quoted version from the latest read in If-Match.",
        "operationId": "Update_a_quota_pool",
        "parameters": [
          {
            "example": "openai-org-main",
            "in": "path",
            "name": "pool_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the resource. Prompt, attachment, conversion and rollback writes use the app version.",
            "example": "\"3f1c0a9e5b7d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "limits": {
                  "rpm": 10000
                }
              },
              "schema": {
                "$ref": "#/components/schemas/QuotaPoolPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "pool": {
                    "created_at": "2026-09-24T12:00:00Z",
                    "description": "Shared OpenAI organization limits",
                    "last_verified_at": null,
                    "limits": {
                      "input_tpm": 2000000,
                      "max_inflight_requests": null,
                      "output_tpm": null,
                      "rpd": null,
                      "rpm": 10000,
                      "total_tpm": null
                    },
                    "members": {
                      "models": [],
                      "providers": [
                        "Production OpenAI"
                      ]
                    },
                    "name": "OpenAI organization",
                    "pool_id": "openai-org-main",
                    "source": "manual",
                    "source_url": null,
                    "updated_at": "2026-09-24T12:00:00Z",
                    "version": "1a2b3c4d5e6f"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/QuotaPoolResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a quota pool",
        "tags": [
          "Quota pools"
        ],
        "x-scopes": [
          "providers:write"
        ]
      }
    },
    "/llmgateway/management/v1/requests": {
      "get": {
        "description": "The tenant's individual gateway requests, newest first: app, key, user, requested and served model, provider, outcome, status and error code, latency, tokens, cost, response cache, failover and the guardrail categories and actions. Prompt and response text, detected values and provider error messages are never returned; follow `links.explain` for why one request behaved as it did.\n\n`from` defaults to 24 hours before `to` (or now); the range is at most 31 days. Requests refused by rate limits, quotas or access rules are included (see `outcome`); background cache-refresh requests are not. Filters combine with AND. Pages are ordered by time then request id and continue with `next_cursor`; new requests never shift a page, and a cursor only works with the same other parameters. Recent requests appear within a few minutes. Queries are limited to 20 seconds. 503 `query_timeout` when the query exceeds its time or read limits (narrow it and retry); 503 `data_unavailable` when the data cannot be read right now. 429 `report_busy` (with a Retry-After header) when too many reports are being computed at once; retry after that many seconds.",
        "operationId": "List_requests",
        "parameters": [
          {
            "description": "Inclusive start: a date (YYYY-MM-DD, UTC midnight) or an RFC 3339 timestamp with a timezone. Omitted: 24 hours before `to` (or now).",
            "example": "2026-11-05T09:00:00Z",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exclusive end: an RFC 3339 timestamp with a timezone, or a date (YYYY-MM-DD) to include that whole UTC day. Omitted: now.",
            "example": "2026-11-06",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this app (exact name, case-insensitive).",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this served model (exact).",
            "in": "query",
            "name": "model",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this provider name (exact).",
            "in": "query",
            "name": "provider",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this user email (case-insensitive).",
            "in": "query",
            "name": "user",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this app gateway key id.",
            "in": "query",
            "name": "key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this outcome.",
            "in": "query",
            "name": "outcome",
            "schema": {
              "enum": [
                "served",
                "blocked",
                "error",
                "rate_limited"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only this HTTP status code (429) or class (4xx).",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only requests with a detection of this category: its id or display name (case-insensitive), a custom definition's id or name, or `unattributed`.",
            "in": "query",
            "name": "category",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only requests the guardrails handled with this action.",
            "in": "query",
            "name": "action",
            "schema": {
              "enum": [
                "blocked",
                "redacted",
                "monitored"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only streaming (true) or non-streaming (false) requests.",
            "in": "query",
            "name": "stream",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Only requests whose total latency was at least this many milliseconds.",
            "in": "query",
            "name": "min_latency_ms",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Only this API surface (exact, for example chat).",
            "in": "query",
            "name": "surface",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size: 1 to 200, default 50.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "data_through": "2026-11-06T09:00:01Z",
                  "filters": {
                    "app": "Support Bot",
                    "outcome": "blocked"
                  },
                  "from": "2026-11-05T09:00:00Z",
                  "generated_at": "2026-11-06T09:00:01Z",
                  "items": [
                    {
                      "app": "Support Bot",
                      "cost_usd": null,
                      "error_code": "request_blocked_by_policy",
                      "failover": {
                        "moved": false,
                        "sends": null
                      },
                      "guardrails": {
                        "actions": [
                          "blocked"
                        ],
                        "detections": [
                          {
                            "action": "blocked",
                            "category": {
                              "id": "adversarial_risk_category_direct_prompt_injection",
                              "name": "Direct Prompt Injection",
                              "type": "adversarial"
                            },
                            "direction": "request"
                          }
                        ],
                        "scanned": true
                      },
                      "key_id": "00000000-0000-4000-8000-0000000000c1",
                      "latency": {
                        "gateway_overhead_ms": 212,
                        "guardrails_ms": 188,
                        "time_to_first_token_ms": null,
                        "total_ms": 212,
                        "upstream_ms": null
                      },
                      "links": {
                        "explain": "/llmgateway/management/v1/requests/4f9a2c1e-8b7d-4e3a-9c21-0d5e6f7a8b90/explain"
                      },
                      "model": "gpt-4.1",
                      "outcome": "blocked",
                      "provider": "Prod OpenAI",
                      "provider_type": "openai",
                      "request_id": "4f9a2c1e-8b7d-4e3a-9c21-0d5e6f7a8b90",
                      "requested_model": "gpt-4.1",
                      "response_cache": null,
                      "status_code": 403,
                      "stream": false,
                      "surface": "chat",
                      "timestamp": "2026-11-06T08:41:12.512000Z",
                      "tokens": {
                        "cache_write": null,
                        "cached_input": null,
                        "input": null,
                        "output": null,
                        "reasoning": null
                      },
                      "user": "dana@example.com"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "to": null
                },
                "schema": {
                  "$ref": "#/components/schemas/RequestList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List gateway requests",
        "tags": [
          "Monitoring"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/requests/{request_id}/explain": {
      "get": {
        "description": "Why one gateway request of your tenant behaved the way it did, without prompt or response content: a summary (app, user, models, provider, status, outcome, latency, tokens, cost, response cache), how the target was chosen (route source and rule with its public route id, content-routing verdicts, routing constraints, conversation pinning, upstream API mode), every failover attempt, guardrail categories and actions per direction with the rules that decided them, limit and budget outcomes with the charged amounts, and the error code with whether a friendly error message replaced it. Detected values, message text and original provider error messages are never returned. Sections that do not apply, or that the gateway did not record for this request, are omitted. Actions use the guardrail summary's `blocked`, `redacted` and `monitored` with the same category objects, and failure classes match GET /provider-health. `gateway_request_id` is the explained request; the top-level `request_id` identifies this management call.\n\n`request_id` is the value of the `x-quilr-request-id` response header. Provider response ids are not accepted. Requests are searched in the last 30 days; for an older request pass `timestamp` (any time within a day of the request). Explanations are available a short time after the request completes. 404 `request_not_found` when no request with this id exists in your tenant within the searched window. 503 `query_timeout` when the query exceeds its time or read limits (narrow it and retry); 503 `data_unavailable` when the data cannot be read right now.",
        "operationId": "Explain_a_request",
        "parameters": [
          {
            "description": "The gateway request id returned in the x-quilr-request-id response header.",
            "example": "6f1c2a9e-1b2c-4d3e-8f90-1234567890ab",
            "in": "path",
            "name": "request_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Approximate request time (RFC 3339 with a timezone, or epoch seconds). The search covers one day either side of it instead of the last 30 days.",
            "example": "2026-11-01T14:03:22Z",
            "in": "query",
            "name": "timestamp",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "failover": {
                    "attempts": [
                      {
                        "duration_ms": 420,
                        "failure_class": "upstream_5xx",
                        "index": 0,
                        "model": "gpt-4.1",
                        "outcome": "failover",
                        "provider_label": "openai-primary",
                        "provider_type": "openai",
                        "retry_number": 0,
                        "status_code": 500,
                        "tier": "first"
                      },
                      {
                        "duration_ms": 900,
                        "index": 1,
                        "kind": "response",
                        "model": "gpt-4.1",
                        "outcome": "served",
                        "provider_label": "azure-eu",
                        "provider_type": "azure",
                        "retry_number": 0,
                        "tier": "same_model"
                      }
                    ],
                    "configured_by": "default",
                    "exhausted": false,
                    "failovers": 1,
                    "retries": 0,
                    "sends": 2,
                    "served_tier": "same_model"
                  },
                  "gateway_request_id": "6f1c2a9e-1b2c-4d3e-8f90-1234567890ab",
                  "guardrails": {
                    "outcome": "redacted",
                    "request": {
                      "actions": [
                        {
                          "action": "redacted",
                          "categories": [
                            {
                              "id": "EMAIL",
                              "name": "Email Address",
                              "type": "data_risk"
                            }
                          ]
                        }
                      ],
                      "decided_by_rules": [
                        {
                          "managed": false,
                          "policy": "pii_controls",
                          "rule_index": 2
                        }
                      ]
                    },
                    "response": {
                      "actions": [],
                      "decided_by_rules": []
                    }
                  },
                  "limits": {
                    "budget_evaluation": "evaluated",
                    "charge_status": "complete",
                    "charges": [
                      {
                        "budget_id": "team-monthly",
                        "charged": {
                          "input_tokens": 812,
                          "output_tokens": 164,
                          "requests": 1,
                          "spend_usd": 0.002936
                        },
                        "limit_type": "budget",
                        "mode": "enforce",
                        "over_limit": false,
                        "window": "calendar:month:2026-11-01T00:00:00Z"
                      }
                    ]
                  },
                  "request_id": "req_example",
                  "routing": {
                    "content": {
                      "complexity": {
                        "current_level": "medium",
                        "effective_level": "medium",
                        "escalated": true,
                        "stored_level": "low"
                      }
                    },
                    "route_id": "r_5d1c9a7e0b3f2468",
                    "routing_group": "eu-chat",
                    "rule": {
                      "managed": false,
                      "policy": "eu_routing",
                      "route_id": "r_5d1c9a7e0b3f2468",
                      "rule_index": 0
                    },
                    "session": {
                      "age_seconds": 0,
                      "key_source": "conversation_id",
                      "pin_target": "azure-eu",
                      "pinned": false
                    },
                    "source": "policy_rule",
                    "upstream": {
                      "client_api": "chat",
                      "fields_dropped": 0,
                      "mode": "native",
                      "upstream_api": "chat"
                    }
                  },
                  "summary": {
                    "app": "Support Bot",
                    "cost": {
                      "status": "priced",
                      "usd": 0.002936
                    },
                    "endpoint": "/v1/chat/completions",
                    "latency_ms": {
                      "first_token": 1290,
                      "guardrails": 210,
                      "total": 1840,
                      "upstream": 1310
                    },
                    "outcome": "served",
                    "provider_label": "azure-eu",
                    "request_kind": "client",
                    "requested_model": "support-default",
                    "response_cache": {
                      "status": "miss"
                    },
                    "served_model": "gpt-4.1",
                    "status_code": 200,
                    "stream": false,
                    "surface": "chat_completions",
                    "tokens": {
                      "cache_read": 512,
                      "input": 812,
                      "output": 164,
                      "source": "provider"
                    },
                    "user_email": "dana@example.com"
                  },
                  "timestamp": "2026-11-01T14:03:22.418Z"
                },
                "schema": {
                  "$ref": "#/components/schemas/RequestExplanation"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Explain a request",
        "tags": [
          "Monitoring"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/routing/effective": {
      "get": {
        "description": "Which rule routes a sample request (app, requested model, user, surface family), its destination, the failover owner and resolved failover config from the same evaluation, other matching rules it outranked (shadowed), constraints and candidates left, active mark-downs and this server's health scope, for the evaluated revision. Content checks are not evaluated; nothing is sent upstream.",
        "operationId": "Explain_effective_routing",
        "parameters": [
          {
            "description": "App name.",
            "example": "support-bot",
            "in": "query",
            "name": "app",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Model the client asks for.",
            "example": "smart",
            "in": "query",
            "name": "requested_model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "User email for user and smart-group scopes.",
            "example": "alex@example.com",
            "in": "query",
            "name": "user",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Route surface family. anthropic_messages and realtime answer 422 surface_not_supported_for_explain. Aliases (deprecated): chat, responses, vertex, bedrock.",
            "in": "query",
            "name": "surface",
            "required": false,
            "schema": {
              "default": "chat_completion",
              "enum": [
                "chat_completion",
                "responses",
                "vertex_ai",
                "bedrock_runtime",
                "anthropic_messages",
                "realtime"
              ]
            }
          },
          {
            "description": "Report pin state (pins are not read by the dry run).",
            "in": "query",
            "name": "session_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated alias of app.",
            "in": "query",
            "name": "app_name",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated alias of requested_model.",
            "in": "query",
            "name": "model",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated alias of user.",
            "in": "query",
            "name": "user_email",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app": "support-bot",
                  "app_name": "support-bot",
                  "destination": {
                    "group": "eu-pool",
                    "kind": "group"
                  },
                  "failover": {
                    "candidate_scope": "route",
                    "enabled": true,
                    "max_attempts": 2,
                    "scope": "route",
                    "source": "policy"
                  },
                  "failover_owner": {
                    "kind": "route",
                    "managed": {
                      "collection": "routes",
                      "domain": "routes",
                      "id": "eu-smart"
                    },
                    "policy": null,
                    "priority": 400,
                    "rule_index": 0,
                    "source": "managed"
                  },
                  "health": {
                    "node": "guardrails-europe-1",
                    "scope": "this_node"
                  },
                  "mark_downs_applied": [],
                  "request_id": "req_example",
                  "requested_model": "smart",
                  "revision": 13,
                  "revision_current": true,
                  "route": {
                    "managed": {
                      "collection": "routes",
                      "domain": "routes",
                      "id": "eu-smart"
                    },
                    "policy": null,
                    "priority": 400,
                    "rank": 120,
                    "rule_index": 0,
                    "source": "managed"
                  },
                  "shadowed": [
                    {
                      "managed": {
                        "collection": "routes",
                        "domain": "routes",
                        "id": "smart-default"
                      },
                      "policy": null,
                      "priority": 400,
                      "rank": 20,
                      "rule_index": 1,
                      "source": "managed"
                    }
                  ],
                  "surface": "chat_completion"
                },
                "schema": {
                  "$ref": "#/components/schemas/RoutingEffective"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Explain the effective route",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/routing/summary": {
      "get": {
        "description": "Traffic per route and per routing group member over a window, with each member's share against its configured weight.",
        "operationId": "Read_routing_summary",
        "parameters": [
          {
            "description": "Start (RFC 3339 or epoch seconds); default 24 h ago.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End; default now.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One app only.",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated alias of app.",
            "in": "query",
            "name": "app_name",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "from": "2026-10-26T00:00:00+00:00",
                  "groups": [],
                  "request_id": "req_example",
                  "routes": [],
                  "to": "2026-10-27T00:00:00+00:00"
                },
                "schema": {
                  "$ref": "#/components/schemas/RoutingSummary"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read the routing summary",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/routing/target-check": {
      "post": {
        "description": "Whether each provider label and model can serve each client API for an app (native, converted or cannot serve), with the connection's state.",
        "operationId": "Check_routing_targets",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "app_name": "support-bot",
                "client_apis": [
                  "chat"
                ],
                "targets": [
                  {
                    "model": "gpt-4.1",
                    "provider_label": "azure-eu"
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/RoutingTargetCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app_name": "support-bot",
                  "client_apis": [
                    "chat"
                  ],
                  "request_id": "req_example",
                  "results": []
                },
                "schema": {
                  "$ref": "#/components/schemas/RoutingTargetCheckResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Check routing targets",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/routing/test": {
      "post": {
        "description": "Runs the routing dry run for a sample body, optionally with proposed controls ({collection: {id: resource or null}}) rendered in memory. Nothing is published, pinned or sent upstream.",
        "operationId": "Test_routing",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "app": "support-bot",
                "body": {
                  "messages": [
                    {
                      "content": "hi",
                      "role": "user"
                    }
                  ],
                  "model": "smart"
                },
                "proposed": {
                  "routes": {
                    "eu-smart": {
                      "description": "EU staff smart alias",
                      "destination": {
                        "ref": "eu-pool"
                      },
                      "failover": {
                        "ref": "standard"
                      },
                      "match": {
                        "requested_models": [
                          "smart"
                        ]
                      },
                      "mode": "active",
                      "rank": 120,
                      "scope": {
                        "apps": [
                          "support-bot"
                        ],
                        "smart_groups": [
                          "eu-staff"
                        ]
                      },
                      "session": {
                        "route_decision": "per_conversation"
                      },
                      "surface_family": "chat_completion"
                    }
                  }
                },
                "surface": "chat_completion"
              },
              "schema": {
                "$ref": "#/components/schemas/RoutingTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app_name": "support-bot",
                  "policy": "draft",
                  "proposed": {
                    "changes": [],
                    "warnings": []
                  },
                  "request_id": "req_example",
                  "turns": []
                },
                "schema": {
                  "$ref": "#/components/schemas/RoutingTestResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Test routing for a sample request",
        "tags": [
          "Routing"
        ],
        "x-scopes": [
          "routing:read"
        ]
      }
    },
    "/llmgateway/management/v1/self-service-keys": {
      "get": {
        "description": "Personal (self-service) API keys of every app, newest first, metadata only: never a key value. Each item names its app. Filter by app_name, owner_email and status (active, expired or revoked); page with limit (1 to 200, default 50) and cursor.",
        "operationId": "List_all_personal_api_keys",
        "parameters": [
          {
            "description": "Only this app's keys (any capitalization); 404 when there is no such app.",
            "in": "query",
            "name": "app_name",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this person's keys (case-insensitive).",
            "in": "query",
            "name": "owner_email",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only keys in this state; omit for all.",
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "active",
                "expired",
                "revoked"
              ]
            }
          },
          {
            "description": "Page size: 1 to 200, default 50.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "app_name": "Support Bot",
                      "created_at": "2026-11-03T09:00:00.000Z",
                      "created_via": "management_api",
                      "expires_at": "2027-02-01T09:00:00.000Z",
                      "key_id": "3d6f1c2a-9e1b-4c3d-8f90-1234567890ab",
                      "key_name": "laptop-cli",
                      "last_used_at": null,
                      "revoked_at": null,
                      "status": "active",
                      "user_email": "dana@example.com",
                      "version": "9b2e4f0c7a1d"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "status_counts": {
                    "active": 1,
                    "expired": 0,
                    "revoked": 0
                  },
                  "total": 1
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceKeyTenantPage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List personal API keys across apps",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/blueprint_eligibility": {
      "get": {
        "description": "Read-only: for each named app, whether it exists and whether any of your policy rules could match it by its identity (its group key, name or key). Such an app cannot be a blueprint: those rules would not govern the copies developers create. Check before adding apps to the blueprints in PUT /self-service/settings. 503 when your policies cannot be read; an app is never reported eligible then.",
        "operationId": "Check_self_service_blueprint_eligibility",
        "parameters": [
          {
            "description": "Repeatable: 1 to 50 app names (any capitalization; duplicates collapse).",
            "explode": true,
            "in": "query",
            "name": "app",
            "required": true,
            "schema": {
              "items": {
                "type": "string"
              },
              "maxItems": 50,
              "minItems": 1,
              "type": "array"
            },
            "style": "form"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "apps": [
                    {
                      "app_name": "Developer sandbox",
                      "app_scoped_policies": false,
                      "app_scoped_policy_names": [],
                      "eligible": true,
                      "found": true
                    },
                    {
                      "app_name": "Support Bot",
                      "app_scoped_policies": true,
                      "app_scoped_policy_names": [
                        "support_bot_guard"
                      ],
                      "eligible": false,
                      "found": true
                    }
                  ],
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceBlueprintEligibility"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Check whether apps can be blueprints",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/coverage": {
      "get": {
        "description": "Read-only: how many people each profile applies to (winning) or matches, how many people match no profile, and what turning on deny_without_profile would cut off: people without a profile who hold personal keys or self-service access to an app. People are the members of enabled Smart Groups (the only people a profile can match), your user directory when it is connected, and everyone holding personal keys or named in an app's self-service access list. Suspended people are counted apart. Apps whose access list allows everyone are listed: people only they reach are counted only when known otherwise.",
        "operationId": "Count_self_service_profile_coverage",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "deny_without_profile": {
                    "allow_all_apps": [],
                    "cut_off": {
                      "people": 6,
                      "personal_keys": 9,
                      "with_app_access": 5,
                      "with_personal_keys": 4
                    },
                    "enabled": false
                  },
                  "draft": null,
                  "exact": true,
                  "key_impact": null,
                  "limits": {
                    "personal_keys_limit": 20000,
                    "personal_keys_truncated": false
                  },
                  "matched": 80,
                  "people": {
                    "directory": {
                      "available": true,
                      "outside_smart_groups": 15,
                      "people": 110
                    },
                    "in_smart_groups": 100,
                    "outside_smart_groups": 20,
                    "total": 120
                  },
                  "profiles": [
                    {
                      "matching": 92,
                      "name": "Developers",
                      "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                      "winning": 80
                    }
                  ],
                  "request_id": "req_example",
                  "state_fingerprint": "0123456789abcdef0123456789abcdef",
                  "suspended": 3,
                  "unmatched": {
                    "in_smart_groups": 18,
                    "outside_smart_groups": 19,
                    "total": 37
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceCoverage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Count people per profile",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "The same counts as GET, as if draft_profile were saved (in place of replaces_profile_id, or as a new profile), remove_profile_id were deleted, deny_without_profile had the given value, and draft_apps' self-service settings were saved. With any of these, key_impact lists the people whose active personal keys would stop (lost) or start (gained) working on an app compared with today. Nothing is stored. An empty body counts the saved profiles.",
        "operationId": "Count_self_service_profile_coverage_for_a_draft",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "draft_profile": {
                  "ceiling": {
                    "apps": "all",
                    "roles": [
                      "self_service_viewer",
                      "show_api_key"
                    ]
                  },
                  "default_app": "Developer sandbox",
                  "description": "",
                  "grants": [],
                  "keys": {
                    "max_active_per_person": 3,
                    "max_lifetime_days": 90
                  },
                  "llm_apps": "hidden",
                  "name": "Developers",
                  "sections": [
                    "my_usage",
                    "llm_gateway"
                  ],
                  "smart_groups": [
                    "engineering"
                  ]
                },
                "replaces_profile_id": "ssp_0123456789abcdef0123456789abcdef"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceCoverageRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "deny_without_profile": {
                    "allow_all_apps": [],
                    "cut_off": {
                      "people": 5,
                      "personal_keys": 7,
                      "with_app_access": 4,
                      "with_personal_keys": 3
                    },
                    "enabled": false
                  },
                  "draft": {
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "replaces_profile_id": "ssp_0123456789abcdef0123456789abcdef"
                  },
                  "exact": true,
                  "key_impact": {
                    "entries_limit": 50,
                    "exact": true,
                    "gained": {
                      "apps": 0,
                      "entries": [],
                      "people": 0,
                      "personal_keys": 0,
                      "truncated": false
                    },
                    "lost": {
                      "apps": 1,
                      "entries": [
                        {
                          "app_name": "Developer sandbox",
                          "email": "dana@example.com",
                          "personal_keys": 2
                        }
                      ],
                      "people": 1,
                      "personal_keys": 2,
                      "truncated": false
                    }
                  },
                  "limits": {
                    "personal_keys_limit": 20000,
                    "personal_keys_truncated": false
                  },
                  "matched": 85,
                  "people": {
                    "directory": {
                      "available": false,
                      "outside_smart_groups": 0,
                      "people": 0
                    },
                    "in_smart_groups": 100,
                    "outside_smart_groups": 20,
                    "total": 120
                  },
                  "profiles": [
                    {
                      "draft": true,
                      "matching": 97,
                      "name": "Developers",
                      "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                      "winning": 85
                    }
                  ],
                  "request_id": "req_example",
                  "state_fingerprint": "0123456789abcdef0123456789abcdef",
                  "suspended": 3,
                  "unmatched": {
                    "in_smart_groups": 13,
                    "outside_smart_groups": 19,
                    "total": 32
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceCoverage"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Count people per profile for a draft",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/evaluate": {
      "post": {
        "description": "Read-only: the winning profile, every matching profile with its rank, the sections and per-app roles with where they came from (from_app, from_profile) and what the ceiling removed; also the person's model tiers, personal key limits (overall and per app), the default app's status, app creation allowance and their approved and pending exception requests. Send draft_profile (and replaces_profile_id to stand in for a saved profile) to see the answer as if that draft were saved; nothing is stored.",
        "operationId": "Evaluate_self_service_access",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "email": "dana@example.com"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceEvaluateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "app_creation": null,
                  "apps": [
                    {
                      "app_name": "Developer sandbox",
                      "from_app": [],
                      "from_profile": [
                        "self_service_viewer"
                      ],
                      "outside_ceiling": false,
                      "removed_by_ceiling": [],
                      "roles": [
                        "self_service_viewer"
                      ]
                    }
                  ],
                  "blocked": false,
                  "denied": false,
                  "deny_without_profile": false,
                  "draft": null,
                  "email": "dana@example.com",
                  "exceptions": {
                    "active": [],
                    "pending_count": 0
                  },
                  "keys": {
                    "apps": [
                      {
                        "app_max_lifetime_days": null,
                        "app_name": "Developer sandbox",
                        "max_active_per_person": 3,
                        "max_lifetime_days": 90
                      }
                    ],
                    "key_lifetime_exception_days": null,
                    "lifetime_source": "profile",
                    "limit_max_active_per_person": 10,
                    "limit_max_lifetime_days": 3650,
                    "max_active_per_person": 3,
                    "max_lifetime_days": 90,
                    "profile": {
                      "max_active_per_person": 3,
                      "max_lifetime_days": 90
                    }
                  },
                  "llm_apps": {
                    "default_app": {
                      "app_name": "Developer sandbox",
                      "personal_keys_available": true,
                      "reason": null
                    },
                    "mode": "hidden"
                  },
                  "matched": [],
                  "models": null,
                  "profile": {
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "rank": 10,
                    "via_group": "engineering",
                    "via_group_name": "Engineering"
                  },
                  "request_id": "req_example",
                  "sections": [
                    "my_usage",
                    "llm_gateway"
                  ],
                  "suspended": false,
                  "suspension": null
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceEvaluation"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Explain a person's self-service access",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/exceptions": {
      "get": {
        "description": "Requests people made for more than their profile gives: a budget increase or app access (reviewed by the app's owners, or admins when it has none), a stronger model tier, a longer key lifetime or another app (reviewed by admins). Filter with status (pending, approved, rejected, cancelled, revoked, failed or expired), kind, requester and app.",
        "operationId": "List_self_service_exceptions",
        "parameters": [
          {
            "description": "pending, approved, rejected, cancelled, revoked, failed or expired",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "budget_increase, app_access, tier_upgrade, key_lifetime or app_create",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The requester's email",
            "in": "query",
            "name": "requester",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "App name",
            "in": "query",
            "name": "app",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "exceptions": [
                    {
                      "app_name": null,
                      "applied": null,
                      "created_at": "2026-11-13T09:00:00Z",
                      "decided_at": null,
                      "decided_by": null,
                      "decision_comment": null,
                      "ends_at": null,
                      "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                      "failure_reason": null,
                      "justification": "Evaluating a long-context feature",
                      "kind": "tier_upgrade",
                      "payload": {
                        "tier_id": "high"
                      },
                      "requested_until": "2026-12-31T23:59:59Z",
                      "requester": "dana@example.com",
                      "reviewer_pool": "admins",
                      "revision": 1,
                      "status": "pending",
                      "updated_at": "2026-11-13T09:00:00Z"
                    }
                  ],
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceExceptionList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List exception requests",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/exceptions/{exception_id}": {
      "get": {
        "description": "One request, with the same fields as the list. 404 self_service_exception_not_found when there is no such request in your organization.",
        "operationId": "Read_a_self_service_exception",
        "parameters": [
          {
            "example": "exception_id_example",
            "in": "path",
            "name": "exception_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "exception": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": null,
                    "decided_by": null,
                    "decision_comment": null,
                    "ends_at": null,
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 1,
                    "status": "pending",
                    "updated_at": "2026-11-13T09:00:00Z"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceExceptionItem"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read an exception request",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/exceptions/{exception_id}/approve": {
      "post": {
        "description": "Every approval ends: ends_at defaults to the date the person asked for and is at most 365 days away. A budget increase becomes a temporary raise on the person's budget until then; another app is created now (and kept: it has no end). The API key decides as an administrator, so it may decide any request, including those the app's owners review.",
        "operationId": "Approve_a_self_service_exception",
        "parameters": [
          {
            "example": "exception_id_example",
            "in": "path",
            "name": "exception_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "comment": "For the evaluation only",
                "ends_at": "2026-12-31"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceExceptionApprove"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "after": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": "2026-11-14T10:00:00Z",
                    "decided_by": "management_key:mk_example",
                    "decision_comment": null,
                    "ends_at": "2026-12-31T23:59:59Z",
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 2,
                    "status": "approved",
                    "updated_at": "2026-11-14T10:00:00Z"
                  },
                  "before": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": null,
                    "decided_by": null,
                    "decision_comment": null,
                    "ends_at": null,
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 1,
                    "status": "pending",
                    "updated_at": "2026-11-13T09:00:00Z"
                  },
                  "exception": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": "2026-11-14T10:00:00Z",
                    "decided_by": "management_key:mk_example",
                    "decision_comment": null,
                    "ends_at": "2026-12-31T23:59:59Z",
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 2,
                    "status": "approved",
                    "updated_at": "2026-11-14T10:00:00Z"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceExceptionResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Approve an exception request",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/exceptions/{exception_id}/reject": {
      "post": {
        "description": "A reason is required; the person sees it.",
        "operationId": "Reject_a_self_service_exception",
        "parameters": [
          {
            "example": "exception_id_example",
            "in": "path",
            "name": "exception_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "reason": "Use the medium tier for this work"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceExceptionReject"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "after": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": null,
                    "decided_by": null,
                    "decision_comment": null,
                    "ends_at": null,
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 1,
                    "status": "rejected",
                    "updated_at": "2026-11-13T09:00:00Z"
                  },
                  "before": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": null,
                    "decided_by": null,
                    "decision_comment": null,
                    "ends_at": null,
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 1,
                    "status": "pending",
                    "updated_at": "2026-11-13T09:00:00Z"
                  },
                  "exception": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": null,
                    "decided_by": null,
                    "decision_comment": null,
                    "ends_at": null,
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 1,
                    "status": "rejected",
                    "updated_at": "2026-11-13T09:00:00Z"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceExceptionResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Reject an exception request",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/exceptions/{exception_id}/revoke": {
      "post": {
        "description": "Ends an approved request now. A budget raise is withdrawn; an app it created stays (disable or delete it separately).",
        "operationId": "Revoke_a_self_service_exception",
        "parameters": [
          {
            "example": "exception_id_example",
            "in": "path",
            "name": "exception_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "reason": "Evaluation finished"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceExceptionRevoke"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "after": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": "2026-11-14T10:00:00Z",
                    "decided_by": "management_key:mk_example",
                    "decision_comment": null,
                    "ends_at": "2026-12-31T23:59:59Z",
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 2,
                    "status": "revoked",
                    "updated_at": "2026-11-14T10:00:00Z"
                  },
                  "before": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": "2026-11-14T10:00:00Z",
                    "decided_by": "management_key:mk_example",
                    "decision_comment": null,
                    "ends_at": "2026-12-31T23:59:59Z",
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 2,
                    "status": "approved",
                    "updated_at": "2026-11-14T10:00:00Z"
                  },
                  "exception": {
                    "app_name": null,
                    "applied": null,
                    "created_at": "2026-11-13T09:00:00Z",
                    "decided_at": "2026-11-14T10:00:00Z",
                    "decided_by": "management_key:mk_example",
                    "decision_comment": null,
                    "ends_at": "2026-12-31T23:59:59Z",
                    "exception_id": "ssx_0123456789abcdef0123456789abcdef",
                    "failure_reason": null,
                    "justification": "Evaluating a long-context feature",
                    "kind": "tier_upgrade",
                    "payload": {
                      "tier_id": "high"
                    },
                    "requested_until": "2026-12-31T23:59:59Z",
                    "requester": "dana@example.com",
                    "reviewer_pool": "admins",
                    "revision": 2,
                    "status": "revoked",
                    "updated_at": "2026-11-14T10:00:00Z"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceExceptionResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Revoke an approved exception",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/profiles": {
      "get": {
        "description": "Profiles in rank order (each profile's best Smart Group priority, then name), the organization setting, suspended people and every Smart Group's display name and effective priority.",
        "operationId": "List_self_service_profiles",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "groups": {
                    "engineering": {
                      "effective_priority": 10,
                      "name": "Engineering"
                    }
                  },
                  "profiles": [
                    {
                      "ceiling": {
                        "apps": "all",
                        "roles": [
                          "self_service_viewer",
                          "show_api_key"
                        ]
                      },
                      "default_app": "Developer sandbox",
                      "description": "",
                      "grants": [],
                      "keys": {
                        "max_active_per_person": 3,
                        "max_lifetime_days": 90
                      },
                      "llm_apps": "hidden",
                      "name": "Developers",
                      "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                      "revision": 1,
                      "sections": [
                        "my_usage",
                        "llm_gateway"
                      ],
                      "smart_groups": [
                        "engineering"
                      ],
                      "updated_at": "2026-11-13 10:00:00.000",
                      "updated_by": "admin@example.com"
                    }
                  ],
                  "request_id": "req_example",
                  "settings": {
                    "deny_without_profile": false,
                    "revision": 0,
                    "updated_at": null,
                    "updated_by": null
                  },
                  "suspensions": []
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceProfileList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List self-service profiles",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "A profile caps what its people can hold: each app's own roles plus the profile's grants, never above the ceiling, and nothing without self_service_viewer. An app's explicit deny always wins. Requires an Idempotency-Key. Groups and apps must exist; default_app must have personal keys enabled.",
        "operationId": "Create_a_self_service_profile",
        "parameters": [
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result.",
            "example": "create-developers-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "ceiling": {
                  "apps": "all",
                  "roles": [
                    "self_service_viewer",
                    "show_api_key"
                  ]
                },
                "default_app": "Developer sandbox",
                "description": "",
                "grants": [],
                "keys": {
                  "max_active_per_person": 3,
                  "max_lifetime_days": 90
                },
                "llm_apps": "hidden",
                "name": "Developers",
                "sections": [
                  "my_usage",
                  "llm_gateway"
                ],
                "smart_groups": [
                  "engineering"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceProfileWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "after": {
                    "ceiling": {
                      "apps": "all",
                      "roles": [
                        "self_service_viewer",
                        "show_api_key"
                      ]
                    },
                    "default_app": "Developer sandbox",
                    "description": "",
                    "grants": [],
                    "keys": {
                      "max_active_per_person": 3,
                      "max_lifetime_days": 90
                    },
                    "llm_apps": "hidden",
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "revision": 1,
                    "sections": [
                      "my_usage",
                      "llm_gateway"
                    ],
                    "smart_groups": [
                      "engineering"
                    ],
                    "updated_at": "2026-11-13 10:00:00.000",
                    "updated_by": "admin@example.com"
                  },
                  "before": null,
                  "profile": {
                    "ceiling": {
                      "apps": "all",
                      "roles": [
                        "self_service_viewer",
                        "show_api_key"
                      ]
                    },
                    "default_app": "Developer sandbox",
                    "description": "",
                    "grants": [],
                    "keys": {
                      "max_active_per_person": 3,
                      "max_lifetime_days": 90
                    },
                    "llm_apps": "hidden",
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "revision": 1,
                    "sections": [
                      "my_usage",
                      "llm_gateway"
                    ],
                    "smart_groups": [
                      "engineering"
                    ],
                    "updated_at": "2026-11-13 10:00:00.000",
                    "updated_by": "admin@example.com"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceProfileResult"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create a self-service profile",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/profiles/{profile_id}": {
      "delete": {
        "description": "Its people fall back to the next matching profile, or to their apps' own access lists (none at all when deny_without_profile is on). Needs the current revision.",
        "operationId": "Delete_a_self_service_profile",
        "parameters": [
          {
            "example": "profile_id_example",
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The profile's revision from your latest read.",
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "before": {
                    "ceiling": {
                      "apps": "all",
                      "roles": [
                        "self_service_viewer",
                        "show_api_key"
                      ]
                    },
                    "default_app": "Developer sandbox",
                    "description": "",
                    "grants": [],
                    "keys": {
                      "max_active_per_person": 3,
                      "max_lifetime_days": 90
                    },
                    "llm_apps": "hidden",
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "revision": 1,
                    "sections": [
                      "my_usage",
                      "llm_gateway"
                    ],
                    "smart_groups": [
                      "engineering"
                    ],
                    "updated_at": "2026-11-13 10:00:00.000",
                    "updated_by": "admin@example.com"
                  },
                  "deleted": true,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceProfileDeleted"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a self-service profile",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One profile.",
        "operationId": "Read_a_self_service_profile",
        "parameters": [
          {
            "example": "profile_id_example",
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "profile": {
                    "ceiling": {
                      "apps": "all",
                      "roles": [
                        "self_service_viewer",
                        "show_api_key"
                      ]
                    },
                    "default_app": "Developer sandbox",
                    "description": "",
                    "grants": [],
                    "keys": {
                      "max_active_per_person": 3,
                      "max_lifetime_days": 90
                    },
                    "llm_apps": "hidden",
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "revision": 1,
                    "sections": [
                      "my_usage",
                      "llm_gateway"
                    ],
                    "smart_groups": [
                      "engineering"
                    ],
                    "updated_at": "2026-11-13 10:00:00.000",
                    "updated_by": "admin@example.com"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceProfileResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a self-service profile",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "put": {
        "description": "A profile caps what its people can hold: each app's own roles plus the profile's grants, never above the ceiling, and nothing without self_service_viewer. An app's explicit deny always wins. Send every field and the revision from your latest read; a stale revision is 409 self_service_profile_revision_conflict.",
        "operationId": "Replace_a_self_service_profile",
        "parameters": [
          {
            "example": "profile_id_example",
            "in": "path",
            "name": "profile_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "ceiling": {
                  "apps": "all",
                  "roles": [
                    "self_service_viewer",
                    "show_api_key"
                  ]
                },
                "default_app": "Developer sandbox",
                "description": "",
                "grants": [],
                "keys": {
                  "max_active_per_person": 3,
                  "max_lifetime_days": 90
                },
                "llm_apps": "hidden",
                "name": "Developers",
                "revision": 1,
                "sections": [
                  "my_usage",
                  "llm_gateway"
                ],
                "smart_groups": [
                  "engineering"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceProfileUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "after": {
                    "ceiling": {
                      "apps": "all",
                      "roles": [
                        "self_service_viewer",
                        "show_api_key"
                      ]
                    },
                    "default_app": "Developer sandbox",
                    "description": "",
                    "grants": [],
                    "keys": {
                      "max_active_per_person": 3,
                      "max_lifetime_days": 90
                    },
                    "llm_apps": "hidden",
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "revision": 2,
                    "sections": [
                      "my_usage",
                      "llm_gateway"
                    ],
                    "smart_groups": [
                      "engineering"
                    ],
                    "updated_at": "2026-11-13 10:00:00.000",
                    "updated_by": "admin@example.com"
                  },
                  "before": {
                    "ceiling": {
                      "apps": "all",
                      "roles": [
                        "self_service_viewer",
                        "show_api_key"
                      ]
                    },
                    "default_app": "Developer sandbox",
                    "description": "",
                    "grants": [],
                    "keys": {
                      "max_active_per_person": 3,
                      "max_lifetime_days": 90
                    },
                    "llm_apps": "hidden",
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "revision": 1,
                    "sections": [
                      "my_usage",
                      "llm_gateway"
                    ],
                    "smart_groups": [
                      "engineering"
                    ],
                    "updated_at": "2026-11-13 10:00:00.000",
                    "updated_by": "admin@example.com"
                  },
                  "profile": {
                    "ceiling": {
                      "apps": "all",
                      "roles": [
                        "self_service_viewer",
                        "show_api_key"
                      ]
                    },
                    "default_app": "Developer sandbox",
                    "description": "",
                    "grants": [],
                    "keys": {
                      "max_active_per_person": 3,
                      "max_lifetime_days": 90
                    },
                    "llm_apps": "hidden",
                    "name": "Developers",
                    "profile_id": "ssp_0123456789abcdef0123456789abcdef",
                    "revision": 2,
                    "sections": [
                      "my_usage",
                      "llm_gateway"
                    ],
                    "smart_groups": [
                      "engineering"
                    ],
                    "updated_at": "2026-11-13 10:00:00.000",
                    "updated_by": "admin@example.com"
                  },
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceProfileResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Replace a self-service profile",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/settings": {
      "put": {
        "description": "deny_without_profile: true refuses self-service to anyone who matches no profile. tiers is the model tier catalog and blueprints the apps developers may copy. Send only what you change (an omitted field keeps its saved value) with the revision from your latest read (0 before the first save); a stale revision is 409 self_service_profile_revision_conflict. Removing a tier or blueprint a profile still uses is 409 self_service_catalog_in_use, naming those profiles.",
        "operationId": "Update_self_service_settings",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "deny_without_profile": true,
                "revision": 0
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceSettingsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "settings": {
                    "deny_without_profile": true,
                    "revision": 1
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceSettingsResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update the self-service setting",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/suspensions": {
      "put": {
        "description": "The person loses every self-service role and section at once, and their personal keys stop authenticating. Suspending again updates the reason.",
        "operationId": "Suspend_a_person_from_self_service",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "email": "dana@example.com",
                "reason": "Offboarding"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceSuspend"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "before": null,
                  "created": true,
                  "request_id": "req_example",
                  "suspension": {
                    "email": "dana@example.com",
                    "reason": "Offboarding",
                    "suspended_at": "2026-11-13 10:00:00.000",
                    "suspended_by": "management_key:mk_example"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceSuspendResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Suspend a person",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/suspensions/remove": {
      "post": {
        "description": "removed is null when the person was not suspended.",
        "operationId": "Lift_a_self_service_suspension",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "email": "dana@example.com"
              },
              "schema": {
                "$ref": "#/components/schemas/SelfServiceEmail"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "removed": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceUnsuspendResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Lift a suspension",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/self-service/usage": {
      "get": {
        "description": "How self-service is used across your organization in a time window (default: the last 30 UTC days including today, at most 366 days): per app, its credential mode, the people its self-service roles reach, personal API keys, settings change requests and request traffic split by identity (personal key, the app's own key, other identified users, anonymous); per person, their apps, roles, keys, change requests and usage. Covers apps with self-service configured, personal keys or change requests in the window; include_all_apps=true adds every app. Costs are estimates; models without a known price count as 0 and are listed in models_without_pricing.",
        "operationId": "Report_self_service_usage",
        "parameters": [
          {
            "description": "Start, inclusive: a date (UTC midnight) or ISO date-time. Default: 29 days before today.",
            "in": "query",
            "name": "from_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "End: a date (its end of day, UTC) or ISO date-time. Default: now.",
            "in": "query",
            "name": "to_date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Repeatable (or comma-separated): only these apps, exact names. 400 when one does not exist.",
            "explode": true,
            "in": "query",
            "name": "app_name",
            "required": false,
            "schema": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "style": "form"
          },
          {
            "description": "Also report apps without self-service configuration or activity.",
            "in": "query",
            "name": "include_all_apps",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "How many of the busiest identified users the traffic breakdown ranks.",
            "in": "query",
            "name": "top_users_limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "apps": [
                    {
                      "api_keys": {
                        "active": 2,
                        "total": 3
                      },
                      "app_name": "Support Bot",
                      "credential_mode": "user_api_key",
                      "enable_self_service": true
                    }
                  ],
                  "from_date": "2026-10-20T00:00:00",
                  "models_without_pricing": [],
                  "notes": {},
                  "request_id": "req_example",
                  "summary": {
                    "api_keys": {
                      "active": 2,
                      "created_in_window": 1,
                      "expired": 0,
                      "revoked": 1,
                      "total": 3,
                      "used_in_window": 2
                    },
                    "apps": {
                      "in_report": 1,
                      "self_service_configured": 1,
                      "total_active": 3
                    },
                    "change_requests": {
                      "direct_applied": 0,
                      "pending_backlog": 0,
                      "total": 1
                    },
                    "usage": {
                      "all": {
                        "request_count": 120
                      },
                      "by_identity": {}
                    },
                    "users": {
                      "active_in_window": 2,
                      "granted_total": 4,
                      "self_service_total": 5
                    }
                  },
                  "tenant_id": "org_example",
                  "timezone": "UTC",
                  "to_date": "2026-11-18T10:00:00",
                  "users": [
                    {
                      "granted_apps": [
                        "Support Bot"
                      ],
                      "usage": {
                        "request_count": 80
                      },
                      "user_email": "dana@example.com"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/SelfServiceUsageReport"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Report self-service usage",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/smart-groups": {
      "get": {
        "description": "Smart groups that app access rules, budgets and group policies can reference, in effective priority order. Synced groups come from the directory sync; virtual groups are created here or in the console.",
        "operationId": "List_smart_groups",
        "parameters": [
          {
            "description": "Page size.",
            "example": 50,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Opaque cursor from the previous page's next_cursor.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "items": [
                    {
                      "group_name": "engineering"
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SmartGroupList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List smart groups",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "post": {
        "description": "Create an admin-managed group with a static member list. It is stored as virtual:<name>, is never changed by the directory sync and can be referenced like any other group. Enabled groups are ranked by priority number, lowest first (ties: group name). Per-group guardrail policies apply from the person's first ranked group that has one; strongest group budget sets charge the person's best-ranked group in the set; membership rules match every group. Requires an Idempotency-Key; 409 smart_group_exists when the name is taken.",
        "operationId": "Create_a_virtual_smart_group",
        "parameters": [
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result; the same key with a different body is a 409.",
            "example": "create-contractors-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "display_name": "Contractors",
                "emails": [
                  "dana@example.com"
                ],
                "name": "contractors",
                "priority": 5
              },
              "schema": {
                "$ref": "#/components/schemas/SmartGroupCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "smart_group": {
                    "display_name": "Contractors",
                    "emails": [
                      "dana@example.com"
                    ],
                    "enabled": true,
                    "group_name": "virtual:contractors",
                    "is_active": true,
                    "member_count": 1,
                    "name": "contractors",
                    "priority": 5,
                    "priority_override": null,
                    "priority_override_updated_at": null,
                    "priority_override_updated_by": null,
                    "source": "virtual",
                    "synced_priority": 5,
                    "version": "9b2e4f0c7a1d"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/SmartGroupResponse"
                }
              }
            },
            "description": "Created",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Create a virtual smart group",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/smart-groups/_priority-preview": {
      "post": {
        "description": "Who would change active group if these priorities were applied, plus the priority ties the change creates (a changed group lands on another enabled group's priority and they share members; existing ties are not listed), and budget_moves: people whose governing budget in a strongest group budget set would move to another group's budget (its own counter; usage is not carried over). Nothing is saved. Lists at most 500 people per list (truncated / budget_moves_truncated).",
        "operationId": "Preview_smart_group_priorities",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "changes": [
                  {
                    "group_name": "virtual:contractors",
                    "priority": 1
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/SmartGroupPriorityPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "affected_count": 1,
                  "affected_users": [
                    {
                      "email": "dana@example.com",
                      "from_group": "engineering",
                      "to_group": "virtual:contractors"
                    }
                  ],
                  "request_id": "req_example",
                  "ties": [],
                  "truncated": false
                },
                "schema": {
                  "$ref": "#/components/schemas/SmartGroupPriorityPreview"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Preview priority changes",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/smart-groups/{group_name}": {
      "delete": {
        "description": "Virtual groups only (synced: 409 synced_group_read_only). When the active policy, budgets, exemptions, managed controls or app settings name the group the response is 409 group_in_use with references; pass force=true to delete anyway. Requires the group's version in If-Match.",
        "operationId": "Delete_a_virtual_smart_group",
        "parameters": [
          {
            "example": "engineering",
            "in": "path",
            "name": "group_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the group; 412 when it changed.",
            "example": "\"9b2e4f0c7a1d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Delete even when the group is referenced.",
            "in": "query",
            "name": "force",
            "required": false,
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "deleted": true,
                  "forced_references": [],
                  "group_name": "virtual:contractors",
                  "request_id": "req_example"
                },
                "schema": {
                  "$ref": "#/components/schemas/SmartGroupDeleted"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Delete a virtual smart group",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "config:write"
        ]
      },
      "get": {
        "description": "One smart group (name matched case-insensitively).",
        "operationId": "Read_a_smart_group",
        "parameters": [
          {
            "example": "engineering",
            "in": "path",
            "name": "group_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "smart_group": {
                    "group_name": "engineering"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/SmartGroupResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a smart group",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ]
      },
      "patch": {
        "description": "Virtual group: change display_name, emails, enabled or priority. Synced group: only priority, which sets an override the directory sync never replaces; null resets it to the synced priority (other fields: 409 synced_group_read_only). Enabled groups are ranked by priority number, lowest first (ties: group name). Per-group guardrail policies apply from the person's first ranked group that has one; strongest group budget sets charge the person's best-ranked group in the set; membership rules match every group. Requires the group's version in If-Match.",
        "operationId": "Update_a_smart_group",
        "parameters": [
          {
            "example": "engineering",
            "in": "path",
            "name": "group_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the group; 412 when it changed.",
            "example": "\"9b2e4f0c7a1d\"",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "priority": 1
              },
              "schema": {
                "$ref": "#/components/schemas/SmartGroupPatch"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "request_id": "req_example",
                  "smart_group": {
                    "display_name": "Contractors",
                    "emails": [
                      "dana@example.com"
                    ],
                    "enabled": true,
                    "group_name": "virtual:contractors",
                    "is_active": true,
                    "member_count": 1,
                    "name": "contractors",
                    "priority": 1,
                    "priority_override": null,
                    "priority_override_updated_at": null,
                    "priority_override_updated_by": null,
                    "source": "virtual",
                    "synced_priority": 1,
                    "version": "9b2e4f0c7a1d"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/SmartGroupResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Update a smart group or its priority",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/smart-groups/{group_name}/members": {
      "post": {
        "description": "Virtual groups only (synced: 409 synced_group_read_only). Adds and removes members without replacing the list; already-present adds and absent removes are ignored (added/removed count actual changes). Requires an Idempotency-Key; If-Match (group version) is optional.",
        "operationId": "Change_smart_group_members",
        "parameters": [
          {
            "example": "engineering",
            "in": "path",
            "name": "group_name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Unique per logical write. A retry with the same key and body replays the original result; the same key with a different body is a 409.",
            "example": "create-contractors-001",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Quoted version from the latest read of the group; 412 when it changed.",
            "example": "\"9b2e4f0c7a1d\"",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "add": [
                  "lee@example.com"
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/SmartGroupMembersChange"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "added": 1,
                  "removed": 0,
                  "request_id": "req_example",
                  "smart_group": {
                    "display_name": "Contractors",
                    "emails": [
                      "dana@example.com",
                      "lee@example.com"
                    ],
                    "enabled": true,
                    "group_name": "virtual:contractors",
                    "is_active": true,
                    "member_count": 2,
                    "name": "contractors",
                    "priority": 5,
                    "priority_override": null,
                    "priority_override_updated_at": null,
                    "priority_override_updated_by": null,
                    "source": "virtual",
                    "synced_priority": 5,
                    "version": "9b2e4f0c7a1d"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/SmartGroupMembersResult"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "408": {
            "$ref": "#/components/responses/BodyTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/VersionConflict"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "428": {
            "$ref": "#/components/responses/PreconditionRequired"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Add or remove smart group members",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "config:write"
        ]
      }
    },
    "/llmgateway/management/v1/usage": {
      "get": {
        "description": "Requests, outcomes, tokens and cost of every app in the tenant, over all time by default (`from` inclusive, `to` exclusive; a date `to` includes that whole UTC day). Rows are per period (`granularity`: total by default, or UTC month, week starting Monday, day or hour) and optionally per one or two dimensions: app, model, provider, user, key (gateway credential), source or outcome. Filters narrow every number, including totals, and `totals` always equals the sum of every row across all pages. Cost is the cost recorded with each request at request time; requests without one are counted in unpriced_requests instead of being estimated. Request counts exclude the background cache-refresh requests the gateway sends on its own, while tokens and cost include them because the provider bills them. Requests whose user identity was removed by data retention are kept with user null. Periods without traffic are omitted. Credential ids are recorded from 2026-10-16; earlier requests report key null. Grouping or filtering by key reads more data, so prefer a bounded range with it. Results can be up to 60 seconds old. Page with `limit` and `cursor` while the query stays the same; a cursor answers 409 `collection_changed` when the result was recomputed and differs (restart without cursor; a fixed `to` in the past keeps results stable). Rows group by the app's current name while it exists, otherwise the name recorded with its requests, and by the served model. `generated_at` says when the data was read and `data_through` the effective end of the range; `totals.priced_coverage_pct` says how much of the billable traffic has a recorded cost. Queries are limited to {QUERY_TIMEOUT_SECONDS} seconds and 100,000 result rows (422 `result_too_large`). 503 `query_timeout` when the query exceeds its time or read limits (narrow it and retry); 503 `data_unavailable` when the data cannot be read right now. 429 `report_busy` (with a Retry-After header) when too many reports are being computed at once; retry after that many seconds.",
        "operationId": "Read_usage",
        "parameters": [
          {
            "description": "Inclusive start: a date (YYYY-MM-DD, UTC midnight) or an RFC 3339 timestamp with a timezone. Omitted: UTC midnight 30 days before `to` (or today); pass an early date for all history.",
            "example": "2026-10-01",
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exclusive end: an RFC 3339 timestamp with a timezone, or a date (YYYY-MM-DD) to include that whole UTC day. Omitted: now.",
            "example": "2026-10-31",
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Period of each row: total (one row per group), or UTC month, week (starting Monday), day or hour. hour needs `from` and `to` at most 14 days apart.",
            "in": "query",
            "name": "granularity",
            "schema": {
              "default": "total",
              "enum": [
                "total",
                "month",
                "week",
                "day",
                "hour"
              ],
              "type": "string"
            }
          },
          {
            "description": "Up to 2 of: app, model, provider, user, key, source, outcome. Repeat the parameter (group_by=a&group_by=b) or separate values with commas (group_by=a,b).",
            "example": [
              "app",
              "model"
            ],
            "explode": true,
            "in": "query",
            "name": "group_by",
            "schema": {
              "items": {
                "enum": [
                  "app",
                  "model",
                  "provider",
                  "user",
                  "key",
                  "source",
                  "outcome"
                ],
                "type": "string"
              },
              "maxItems": 2,
              "type": "array",
              "uniqueItems": true
            },
            "style": "form"
          },
          {
            "description": "Only these apps (names, case-insensitive). Comma-separated, at most 50 values.",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only these models. Comma-separated, at most 50 values.",
            "in": "query",
            "name": "model",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only these provider labels. Comma-separated, at most 50 values.",
            "in": "query",
            "name": "provider",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only these user emails (case-insensitive). Comma-separated, at most 50 values.",
            "in": "query",
            "name": "user",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only these gateway credential ids (key_id). Comma-separated, at most 50 values.",
            "in": "query",
            "name": "key",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only these sources: gateway, sdk, copilot_studio. Comma-separated, at most 50 values.",
            "in": "query",
            "name": "source",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only these outcomes: served, blocked, error, rate_limited. Comma-separated, at most 50 values.",
            "in": "query",
            "name": "outcome",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "period: oldest period first, then highest cost. cost, requests, tokens: highest first.",
            "in": "query",
            "name": "sort",
            "schema": {
              "default": "period",
              "enum": [
                "period",
                "cost",
                "requests",
                "tokens"
              ],
              "type": "string"
            }
          },
          {
            "description": "Page size: 1 to 5000, default 500.",
            "example": 500,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 500,
              "maximum": 5000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "currency": "USD",
                  "data_through": "2026-11-01T00:00:00Z",
                  "from": "2026-10-01T00:00:00Z",
                  "generated_at": "2026-11-01T09:15:02Z",
                  "granularity": "day",
                  "group_by": [
                    "app",
                    "model"
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "row_count": 2,
                  "rows": [
                    {
                      "app": "Support Bot",
                      "app_deleted": false,
                      "blocked": 3,
                      "cache_read_tokens": 920000,
                      "cache_write_tokens": 64000,
                      "cost_usd": 18.4231,
                      "errors": 12,
                      "input_tokens": 1830400,
                      "model": "gpt-4.1",
                      "output_tokens": 412800,
                      "period_start": "2026-10-01",
                      "rate_limited": 5,
                      "reasoning_tokens": 51200,
                      "requests": 1240,
                      "unpriced_requests": 0
                    },
                    {
                      "app": "Legacy Assistant",
                      "app_deleted": true,
                      "blocked": 0,
                      "cache_read_tokens": 410000,
                      "cache_write_tokens": 32000,
                      "cost_usd": 12.5941,
                      "errors": 4,
                      "input_tokens": 960200,
                      "model": "claude-sonnet-4-5",
                      "output_tokens": 220400,
                      "period_start": "2026-10-01",
                      "rate_limited": 1,
                      "reasoning_tokens": 0,
                      "requests": 1170,
                      "unpriced_requests": 2
                    }
                  ],
                  "timezone": "UTC",
                  "to": "2026-11-01T00:00:00Z",
                  "totals": {
                    "blocked": 3,
                    "cache_read_tokens": 1330000,
                    "cache_write_tokens": 96000,
                    "cost_usd": 31.0172,
                    "errors": 16,
                    "input_tokens": 2790600,
                    "output_tokens": 633200,
                    "priced_coverage_pct": 99.92,
                    "rate_limited": 6,
                    "reasoning_tokens": 51200,
                    "requests": 2410,
                    "unpriced_requests": 2
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/UsageReport"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read usage",
        "tags": [
          "Usage"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/users": {
      "get": {
        "description": "Everyone the gateway knows for your tenant, one entry per email (matched case-insensitively): people in your synced identity directory, people named in gateway configuration (allowed users, smart groups, self-service access, personal keys) and people seen only in gateway requests. Each entry summarizes console app visibility, self-service grants and personal-key ownership (not a request-time authorization evaluation; policies, model access and limits can still restrict calls), active personal keys, last activity and the last 30 days of requests and cost. Filters: `q` (email or department substring), `app` (people granted that app or with requests to it), `active_since` (inclusive; a date means UTC midnight). Sort with `sort`. Page with `limit` (1 to 500, default 100) and `cursor`. Results can be up to 60 seconds old. When request history is unavailable the list is still returned with `usage.available` false and null usage fields; sorting by usage or filtering by `active_since` then answers 503 `data_unavailable`, and 503 `query_timeout` when usage exceeds its time or read limits. `usage.complete` false or `truncated` true mean the history or the configuration was larger than its read limit and the list is partial. Read-only: people are added through your identity provider or the console.",
        "operationId": "List_users",
        "parameters": [
          {
            "description": "Page size: 1 to 500, default 100.",
            "example": 100,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 100,
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "next_cursor from the previous page; send the same other parameters.",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case-insensitive substring of the email or directory department.",
            "in": "query",
            "name": "q",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "description": "App name (case-insensitive): people granted this app specifically, or with requests to it. People who see every app only by default are not included.",
            "in": "query",
            "name": "app",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "People active at or after this time (inclusive, like from on the other reports): a date (YYYY-MM-DD, UTC midnight) or an RFC 3339 timestamp with a timezone.",
            "example": "2026-10-01",
            "in": "query",
            "name": "active_since",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "email (A to Z), last_active (most recent first), requests or cost (last 30 days, highest first).",
            "in": "query",
            "name": "sort",
            "schema": {
              "default": "email",
              "enum": [
                "email",
                "last_active",
                "requests",
                "cost"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "generated_at": "2026-11-01T09:15:02Z",
                  "items": [
                    {
                      "all_apps": false,
                      "apps": [
                        "Support Bot"
                      ],
                      "cost_usd_30d": 18.42,
                      "department": "Engineering",
                      "directory_groups": [
                        "eng-all"
                      ],
                      "email": "alice@example.com",
                      "last_active_at": "2026-10-31T17:42:10Z",
                      "requests_30d": 1284,
                      "self_service_keys": 1,
                      "smart_groups": [
                        "engineering"
                      ],
                      "source": "directory",
                      "sources": [
                        "directory",
                        "smart_group",
                        "self_service_key",
                        "traffic"
                      ]
                    },
                    {
                      "all_apps": true,
                      "apps": [],
                      "cost_usd_30d": 0.61,
                      "department": null,
                      "directory_groups": [],
                      "email": "bob@example.com",
                      "last_active_at": "2026-10-29T09:03:55Z",
                      "requests_30d": 37,
                      "self_service_keys": 0,
                      "smart_groups": [],
                      "source": "traffic",
                      "sources": [
                        "traffic"
                      ]
                    }
                  ],
                  "next_cursor": null,
                  "request_id": "req_example",
                  "total": 2,
                  "truncated": false,
                  "usage": {
                    "available": true,
                    "complete": true,
                    "window_days": 30
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayUserList"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "List gateway users",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway/management/v1/users/{email}": {
      "get": {
        "description": "One person by email (case-insensitive; URL-encode it): directory details, smart groups, their console app visibility, self-service grants and personal-key ownership per app and every way each is granted, personal key metadata (never key values), usage for the last 30 days and all time, with top models and per-app totals for the last 30 days, and links to related management endpoints, such as the budget subject for GET /budget-subjects/{kind}/{value}. This is not a request-time authorization evaluation; policies, model access and limits can still restrict calls. `usage` is null when request history is unavailable, and `usage.complete` false when it was capped. Results can be up to 60 seconds old. 404 when the email is neither configured nor seen in requests. 503 `query_timeout` when the query exceeds its time or read limits (narrow it and retry); 503 `data_unavailable` when the data cannot be read right now. 429 `report_busy` (with a Retry-After header) when too many reports are being computed at once; retry after that many seconds.",
        "operationId": "Read_a_user",
        "parameters": [
          {
            "description": "Email address, case-insensitive, URL-encoded.",
            "example": "alice@example.com",
            "in": "path",
            "name": "email",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "generated_at": "2026-11-01T09:15:02Z",
                  "request_id": "req_example",
                  "truncated": false,
                  "user": {
                    "active_smart_group": "engineering",
                    "all_apps": false,
                    "app_access": [
                      {
                        "app": "Support Bot",
                        "domain_allowed": true,
                        "granted_by": [
                          {
                            "kind": "app_allowed_users"
                          },
                          {
                            "kind": "self_service",
                            "role": "self_service_viewer",
                            "smart_groups": [
                              "engineering"
                            ],
                            "via": "smart_group"
                          },
                          {
                            "key_ids": [
                              "ssk_7d2f9a41"
                            ],
                            "kind": "self_service_key"
                          }
                        ],
                        "self_service_denied": false
                      }
                    ],
                    "directory": {
                      "alias": false,
                      "department": "Engineering",
                      "groups": [
                        "eng-all"
                      ]
                    },
                    "email": "alice@example.com",
                    "first_seen_at": "2026-03-11T08:20:44Z",
                    "last_active_at": "2026-10-31T17:42:10Z",
                    "links": {
                      "apps": [
                        "/llmgateway/management/v1/apps/Support%20Bot"
                      ],
                      "budget_subject": {
                        "kind": "user",
                        "path": "/llmgateway/management/v1/budget-subjects/user/alice%40example.com",
                        "value": "alice@example.com"
                      },
                      "smart_groups": [
                        "/llmgateway/management/v1/smart-groups/engineering"
                      ]
                    },
                    "self_service_keys": [
                      {
                        "app": "Support Bot",
                        "created_at": "2026-09-02T10:15:00Z",
                        "expires_at": null,
                        "key_id": "ssk_7d2f9a41",
                        "last_used_at": "2026-10-31T17:42:10Z",
                        "name": "laptop",
                        "revoked_at": null,
                        "status": "active"
                      }
                    ],
                    "smart_groups": [
                      {
                        "display_name": "Engineering",
                        "group_name": "engineering",
                        "priority": 10
                      }
                    ],
                    "source": "directory",
                    "sources": [
                      "directory",
                      "smart_group",
                      "self_service_key",
                      "traffic"
                    ],
                    "usage": {
                      "all_time": {
                        "cost_usd": 131.07,
                        "input_tokens": 6021877,
                        "output_tokens": 1388120,
                        "requests": 9120,
                        "unpriced_requests": 12
                      },
                      "by_app": [
                        {
                          "app": "Support Bot",
                          "cost_usd": 18.42,
                          "last_active_at": "2026-10-31T17:42:10Z",
                          "requests": 1284
                        }
                      ],
                      "complete": true,
                      "last_30d": {
                        "cost_usd": 18.42,
                        "input_tokens": 912340,
                        "output_tokens": 204118,
                        "requests": 1284,
                        "unpriced_requests": 0
                      },
                      "top_models": [
                        {
                          "cost_usd": 9.8,
                          "model": "gpt-4.1-mini",
                          "requests": 1100
                        },
                        {
                          "cost_usd": 8.62,
                          "model": "claude-sonnet-4-5",
                          "requests": 184
                        }
                      ],
                      "window_days": 30
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/GatewayUserResponse"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Read a gateway user",
        "tags": [
          "Users"
        ],
        "x-scopes": [
          "read"
        ]
      }
    },
    "/llmgateway_management_apis/v1/openapi.json": {
      "get": {
        "description": "This OpenAPI 3.1 document, generated by the server from its route table, so it always matches the deployed API. Requires a management key with the read scope.",
        "operationId": "Get_openapi",
        "parameters": [
          {
            "description": "Publish this region's URL as the only server (e.g. `guardrails-europe-1`). Import into an API gateway with one region only: management idempotency and operation records stay in the region that took the request. Default: a `region` server variable.",
            "in": "query",
            "name": "region",
            "schema": {
              "enum": [
                "guardrails-usa-1",
                "guardrails-usa-2",
                "guardrails-europe-1",
                "guardrails-india-1",
                "guardrails-india-2",
                "guardrails-jp-1",
                "guardrails"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "components": {},
                  "info": {
                    "title": "LLM Gateway Management API",
                    "version": "1.0.0"
                  },
                  "openapi": "3.1.0",
                  "paths": {}
                },
                "schema": {
                  "$ref": "#/components/schemas/OpenApiDocument"
                }
              }
            },
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/Cache-Control"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Request-ID": {
                "$ref": "#/components/headers/X-Request-ID"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/Busy"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "summary": "Download the OpenAPI document",
        "tags": [
          "Reference"
        ],
        "x-scopes": [
          "read"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Quilr-hosted gateway. Set `region` to the region your organization uses before importing (or request the document with `region`). For a dedicated or on-premises gateway, replace the URL with your gateway's.",
      "url": "https://{region}.quilr.ai",
      "variables": {
        "region": {
          "default": "guardrails-usa-1",
          "description": "`guardrails-usa-1`: USA 1 (US Central West); `guardrails-usa-2`: USA 2 (US East); `guardrails-europe-1`: Europe; `guardrails-india-1`: India 1 (Mumbai); `guardrails-india-2`: India 2 (Mumbai); `guardrails-jp-1`: Japan (Tokyo); `guardrails`: Global",
          "enum": [
            "guardrails-usa-1",
            "guardrails-usa-2",
            "guardrails-europe-1",
            "guardrails-india-1",
            "guardrails-india-2",
            "guardrails-jp-1",
            "guardrails"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "description": "Discover what this deployment supports and download this document.",
      "name": "Reference"
    },
    {
      "description": "Create, read and configure gateway apps, and attach shared providers to them.",
      "name": "Apps"
    },
    {
      "description": "Shared, tenant-wide upstream provider configurations: create, update, delete, test connections and discover models.",
      "name": "Providers"
    },
    {
      "description": "Named upstream quota ceilings shared by several providers or models.",
      "name": "Quota pools"
    },
    {
      "description": "Gateway keys that clients use to call an app: issue, list, change expiry, revoke and reveal; and personal API keys issued on a person's behalf.",
      "name": "Credentials"
    },
    {
      "description": "Stored system prompts of an app.",
      "name": "Prompts"
    },
    {
      "description": "Spend, request and token budgets: definitions, usage, per-subject grants, pricing, exemptions, alerts and events.",
      "name": "Budgets"
    },
    {
      "description": "Requests, tokens and spend over any period, from all time down to single days, broken down by app, model, provider, user, key, source and outcome.",
      "name": "Usage"
    },
    {
      "description": "Read-only views of how the gateway is behaving: guardrail activity, provider and model health, and why a single request was routed, blocked or failed over.",
      "name": "Monitoring"
    },
    {
      "description": "People who use the gateway: their app access, keys, last activity and usage.",
      "name": "Users"
    },
    {
      "description": "Tenant-wide incident controls: mark a provider down for every app or chosen apps (with an expiry), preview the impact, restore it, reset cooldowns and drop session pins. These are not policy revisions.",
      "name": "Incidents"
    },
    {
      "description": "Typed routing controls (destinations, routes, failover, routing constraints, model access) and routing diagnostics. Each write publishes one validated policy revision; controls apply while the tenant's policy engine is enabled.",
      "name": "Routing"
    },
    {
      "description": "Typed limits (rate limits, request guards, model limits, exemptions, limit responses), live usage, temporary raises and effective limits.",
      "name": "Limits"
    },
    {
      "description": "Gateway features (token saving, response cache, cache warm, model visibility, error messages, conversation headers, prompt enforcement). These controls take precedence over console policy rules wherever they match, except console policies above priority 999 and unchanged console policies at 950 to 999 that predate them (both listed in overridden_by); rank orders overlapping controls of one collection.",
      "name": "Gateway features"
    },
    {
      "description": "Access controls (block, require identity, require conversation ID, allowed source IPs). They only tighten access: they apply above every console policy rule wherever they match, console denies and requirements still apply, and source IP lists intersect.",
      "name": "Access"
    },
    {
      "description": "External hooks call your own HTTPS API on gateway traffic: pre_call hooks can allow, flag or block a request before the model call; post_call hooks can allow, flag or block the final non-streaming response; on_complete hooks export finished requests in batches.",
      "name": "Hooks"
    },
    {
      "description": "Catalogs referenced by app settings: smart groups (virtual groups can be created and edited; synced groups take a priority override) and custom detection definitions (read-only).",
      "name": "Catalogs"
    },
    {
      "description": "App configuration versions and rollback, the management audit trail and the status of long-running operations.",
      "name": "History"
    },
    {
      "description": "Tenant-administrator endpoints that enable management for a tenant and issue management keys. Authenticated with a verified tenant administrator token, not a management key.",
      "name": "Administration"
    }
  ],
  "x-scope-descriptions": {
    "budgets:grant": "Issue, change and revoke budget grants.",
    "budgets:policy": "Edit budgets, pricing, exemptions and alert destinations (publishes a policy revision).",
    "budgets:read": "Read budgets, usage, subjects, grants, pricing, exemptions, alerts and events.",
    "config:write": "Change app settings, attachments, prompts; roll back and recover app writes.",
    "credentials:read": "Reveal the secret of an active gateway key.",
    "credentials:write": "Issue, change expiry of and revoke gateway keys.",
    "hooks:write": "Create, change, delete and test external hooks that call your own HTTPS API on gateway traffic (each write publishes a policy revision; reading hooks needs read).",
    "incidents:read": "Read incident mark-downs and incident propagation status (read or incidents:write also allow these reads).",
    "incidents:write": "Mark providers down for an incident, preview the impact, restore them, reset cooldowns and drop session pins (tenant-wide, never a policy revision).",
    "keys:write": "Issue personal API keys on a person's behalf, rename them, change their expiry and revoke them (reading them needs read).",
    "limits:grant": "Issue and revoke temporary rate limit raises.",
    "limits:read": "Read rate limits, request guards, model limits, exemptions, limit responses, live usage, grants and effective limits.",
    "limits:write": "Change rate limits, request guards, model limits, exemptions and limit responses, and migrate legacy limits (each write publishes a policy revision).",
    "providers:write": "Create, update and delete shared providers and quota pools; run provider tests and model discovery.",
    "read": "Read apps, providers, quota pools, credentials metadata, prompts, catalogs, history and this document.",
    "routing:constraints": "Change routing constraints (hard placement and capability limits).",
    "routing:read": "Read routing controls (routes, destinations, failover, routing constraints, model access), policy capacity and revision rollout, and run the routing diagnostics (effective route, test routing, target check, routing and failover summaries).",
    "routing:write": "Change routes, destinations, failover profiles, rules and default, and model access (each write publishes a policy revision)."
  }
}
