{
  "openapi": "3.1.0",
  "info": {
    "title": "QuilrAI LLM Gateway Management API",
    "version": "1.0.0",
    "description": "LLM Gateway Management API v1. Manage tenant-scoped apps, shared providers, credentials, configuration, QuilrQL policy and prompts. Examples use a placeholder hostname; replace it with your central management origin."
  },
  "servers": [
    {
      "url": "https://management.example.com",
      "description": "Placeholder for the designated central management origin; not a live Quilr endpoint."
    }
  ],
  "tags": [
    {
      "name": "Apps"
    },
    {
      "name": "Providers"
    },
    {
      "name": "Credentials"
    },
    {
      "name": "Prompts"
    },
    {
      "name": "Catalogs"
    },
    {
      "name": "History"
    },
    {
      "name": "Policy"
    },
    {
      "name": "Administration"
    },
    {
      "name": "Reference"
    }
  ],
  "paths": {
    "/llmgateway/management/v1/capabilities": {
      "get": {
        "operationId": "Read_capabilities",
        "summary": "Read capabilities",
        "description": "Read available resource schemas, provider types, supported tests and policy authority. The response is configuration metadata, not operational health.",
        "tags": [
          "Reference"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_capabilitiesResponse"
                },
                "example": {
                  "capabilities": {
                    "contract": "v1",
                    "management_writes": true,
                    "policy_authority": {
                      "enabled": true,
                      "active_revision": 12,
                      "version": "policy-v12"
                    },
                    "model_tests_available": true,
                    "provider_types": [
                      "openai",
                      "bedrock",
                      "vertex_ai"
                    ],
                    "schema_url": "/openapi/llm-gateway-management-v1.json"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps": {
      "get": {
        "operationId": "List_apps",
        "summary": "List apps",
        "description": "List enabled and disabled apps in the key's tenant. Credentials are never included.",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Optional name search."
            },
            "example": "Support",
            "description": "Optional name search."
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Match a tag."
            },
            "example": "production",
            "description": "Match a tag."
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Optional enabled-state filter."
            },
            "description": "Optional enabled-state filter."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_appsResponse"
                },
                "example": {
                  "items": [
                    {
                      "name": "Support Bot",
                      "mode": "gateway",
                      "enabled": true,
                      "version": "app-v1",
                      "provider_labels": [
                        "Production OpenAI"
                      ],
                      "tags": [
                        "production"
                      ],
                      "policy_authority": {
                        "enabled": false,
                        "active_revision": null
                      }
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Create_an_app",
        "summary": "Create an app",
        "description": "Create a named app and exactly one initial gateway credential. Default key name is Default. Shared providers only. Does not call upstream or publish policy.",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write",
          "credentials:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "201": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Create_an_appResponse"
                },
                "example": {
                  "app": {
                    "name": "Support Bot",
                    "mode": "gateway",
                    "enabled": true,
                    "version": "app-v1",
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "tags": [
                      "production"
                    ],
                    "policy_authority": {
                      "enabled": false,
                      "active_revision": null
                    }
                  },
                  "key": {
                    "key_id": "key_example",
                    "name": "Default",
                    "status": "active",
                    "expires_at": null,
                    "created_at": "2026-09-17T12:00:00Z",
                    "fingerprint": "...8f12",
                    "secret": "<new-gateway-key>"
                  },
                  "warnings": [],
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppCreate"
              },
              "example": {
                "name": "Support Bot",
                "provider_labels": [
                  "Production OpenAI"
                ],
                "tags": [
                  "production"
                ]
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}": {
      "get": {
        "operationId": "Read_an_app",
        "summary": "Read an app",
        "description": "Read stored configuration, provider references, version and policy authority. Governed settings are not a universal effective policy result.",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_an_appResponse"
                },
                "example": {
                  "app": {
                    "name": "Support Bot",
                    "mode": "gateway",
                    "enabled": true,
                    "version": "app-v1",
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "tags": [
                      "production"
                    ],
                    "policy_authority": {
                      "enabled": false,
                      "active_revision": null
                    }
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "Update_or_disable_an_app",
        "summary": "Update or disable an app",
        "description": "Partial update; enabled false suspends the whole app. No app-delete operation. Governed fields save with an inactive_under_quilrql warning when authority is active.",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Update_or_disable_an_appResponse"
                },
                "example": {
                  "app": {
                    "name": "Support Bot",
                    "mode": "gateway",
                    "enabled": false,
                    "version": "app-v2",
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "tags": [
                      "production"
                    ],
                    "policy_authority": {
                      "enabled": false,
                      "active_revision": null
                    }
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppPatch"
              },
              "examples": {
                "Disable app": {
                  "summary": "Disable app",
                  "value": {
                    "enabled": false
                  }
                },
                "Detection and limits": {
                  "summary": "Detection and limits",
                  "value": {
                    "detection": {
                      "data_risk_action": "redact"
                    },
                    "limits": {
                      "timeout": 60,
                      "rate_limit": {
                        "value": 1000,
                        "duration": "minute"
                      }
                    }
                  }
                },
                "Attach provider selection": {
                  "summary": "Attach provider selection",
                  "value": {
                    "provider_labels": [
                      "Production OpenAI",
                      "Backup Anthropic"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/providers": {
      "get": {
        "operationId": "List_app_providers",
        "summary": "List app providers",
        "description": "Read ordered attachments and primary status, with no upstream secrets.",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_app_providersResponse"
                },
                "example": {
                  "items": [
                    {
                      "label": "Production OpenAI",
                      "primary": true,
                      "enabled": true
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/providers/{label}": {
      "put": {
        "operationId": "Attach_a_shared_provider",
        "summary": "Attach a shared provider",
        "description": "Idempotently attach an existing enabled provider; preserve other attachments. primary true explicitly promotes it. Inline apps require conversion first.",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "label",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Production OpenAI",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attach_a_shared_providerResponse"
                },
                "example": {
                  "app": {
                    "name": "Support Bot",
                    "mode": "gateway",
                    "enabled": true,
                    "version": "app-v1",
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "tags": [
                      "production"
                    ],
                    "policy_authority": {
                      "enabled": false,
                      "active_revision": null
                    }
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderAttach"
              },
              "example": {
                "primary": false
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "Detach_an_app_provider",
        "summary": "Detach an app provider",
        "description": "Detach from this app only. Reject last-provider/primary and routing/policy dependency conflicts; use an app PATCH to supply a complete valid replacement selection and routes.",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "label",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Production OpenAI",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "204": {
            "description": "Completed successfully."
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/provider-conversion": {
      "post": {
        "operationId": "Convert_inline_providers",
        "summary": "Convert inline providers",
        "description": "Replace the complete inline selection with existing shared provider references. Preserve canonical app identity, keys and unrelated settings. No implicit provider creation.",
        "tags": [
          "Apps"
        ],
        "x-scopes": [
          "config:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Convert_inline_providersResponse"
                },
                "example": {
                  "app": {
                    "name": "Support Bot",
                    "mode": "gateway",
                    "enabled": true,
                    "version": "app-v1",
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "tags": [
                      "production"
                    ],
                    "policy_authority": {
                      "enabled": false,
                      "active_revision": null
                    }
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderConversion"
              },
              "example": {
                "provider_labels": [
                  "Production OpenAI"
                ],
                "routing": {
                  "groups": [],
                  "context_routes": []
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/providers": {
      "get": {
        "operationId": "List_shared_providers",
        "summary": "List shared providers",
        "description": "List shared provider metadata, configured models and credential-presence flags.",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": ""
            },
            "description": ""
          },
          {
            "name": "provider_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_shared_providersResponse"
                },
                "example": {
                  "items": [
                    {
                      "label": "Production OpenAI",
                      "provider_name": "openai",
                      "enabled": true,
                      "selected_models": [
                        "gpt-4.1-mini"
                      ],
                      "credential_status": {
                        "api_key_configured": true
                      },
                      "version": "provider-v1"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Create_a_shared_provider",
        "summary": "Create a shared provider",
        "description": "Persist validated configuration without contacting upstream. The label/type are immutable and namespaced to the tenant.",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "201": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Create_a_shared_providerResponse"
                },
                "example": {
                  "provider": {
                    "label": "Production OpenAI",
                    "provider_name": "openai",
                    "enabled": true,
                    "selected_models": [
                      "gpt-4.1-mini"
                    ],
                    "credential_status": {
                      "api_key_configured": true
                    },
                    "version": "provider-v1"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderCreate"
              },
              "examples": {
                "ApiKey": {
                  "summary": "ApiKey",
                  "value": {
                    "label": "ApiKey production",
                    "selected_models": [
                      "gpt-4.1-mini"
                    ],
                    "provider_name": "openai",
                    "provider_settings": {
                      "api_key": "<provider-api-key>"
                    }
                  }
                },
                "Azure": {
                  "summary": "Azure",
                  "value": {
                    "label": "Azure production",
                    "selected_models": [],
                    "provider_name": "azureopenai",
                    "provider_settings": {
                      "api_key": "<azure-api-key>",
                      "azure_endpoint": "https://example.openai.azure.com",
                      "api_version": "<supported-api-version>"
                    }
                  }
                },
                "Custom": {
                  "summary": "Custom",
                  "value": {
                    "label": "Custom production",
                    "selected_models": [],
                    "provider_name": "general",
                    "provider_settings": {
                      "api_key": "<provider-api-key>",
                      "base_url": "https://inference.example.com/v1"
                    }
                  }
                },
                "Bedrock": {
                  "summary": "Bedrock",
                  "value": {
                    "label": "Bedrock production",
                    "selected_models": [],
                    "provider_name": "bedrock",
                    "provider_settings": {
                      "aws_auth_mode": "assume_role",
                      "aws_region": "us-east-1",
                      "aws_role_arn": "arn:aws:iam::123456789012:role/QuilrGateway",
                      "aws_external_id": "<external-id>"
                    }
                  }
                },
                "Vertex": {
                  "summary": "Vertex",
                  "value": {
                    "label": "Vertex production",
                    "selected_models": [],
                    "provider_name": "vertex_ai",
                    "provider_settings": {
                      "auth_type": "adc",
                      "gcp_project_id": "example-project",
                      "gcp_region": "us-central1"
                    }
                  }
                },
                "OracleChat": {
                  "summary": "OracleChat",
                  "value": {
                    "label": "OracleChat production",
                    "selected_models": [],
                    "provider_name": "oracle",
                    "provider_settings": {
                      "auth_type": "gateway_user_principal",
                      "oci_region": "us-chicago-1",
                      "oci_project_id": "ocid1.generativeaiproject.example",
                      "oci_compartment_id": "ocid1.compartment.example"
                    }
                  }
                },
                "OracleResponses": {
                  "summary": "OracleResponses",
                  "value": {
                    "label": "OracleResponses production",
                    "selected_models": [],
                    "provider_name": "oracle_responses",
                    "provider_settings": {
                      "auth_type": "instance_principal",
                      "oci_region": "us-chicago-1",
                      "oci_project_id": "ocid1.generativeaiproject.example"
                    }
                  }
                },
                "Managed": {
                  "summary": "Managed",
                  "value": {
                    "label": "Managed production",
                    "selected_models": [],
                    "provider_name": "quilr_ai",
                    "provider_settings": {}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/providers/{label}": {
      "get": {
        "operationId": "Read_a_shared_provider",
        "summary": "Read a shared provider",
        "description": "Read configured models, enabled state and credential-presence metadata. Raw upstream credentials are never returned.",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "label",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Production OpenAI",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_a_shared_providerResponse"
                },
                "example": {
                  "provider": {
                    "label": "Production OpenAI",
                    "provider_name": "openai",
                    "enabled": true,
                    "selected_models": [
                      "gpt-4.1-mini"
                    ],
                    "credential_status": {
                      "api_key_configured": true
                    },
                    "version": "provider-v1"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "Update_or_disable_a_provider",
        "summary": "Update or disable a provider",
        "description": "Change credentials, models, rates or enabled state. Omitted secrets remain. Disable preserves attachments and may affect every linked app after propagation.",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "label",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Production OpenAI",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Update_or_disable_a_providerResponse"
                },
                "example": {
                  "provider": {
                    "label": "Production OpenAI",
                    "provider_name": "openai",
                    "enabled": false,
                    "selected_models": [
                      "gpt-4.1-mini"
                    ],
                    "credential_status": {
                      "api_key_configured": true
                    },
                    "version": "provider-v2"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderPatch"
              },
              "examples": {
                "Disable provider": {
                  "summary": "Disable provider",
                  "value": {
                    "enabled": false
                  }
                },
                "Rotate credential": {
                  "summary": "Rotate credential",
                  "value": {
                    "provider_settings": {
                      "api_key": "<replacement-provider-key>"
                    }
                  }
                },
                "Set models and prices": {
                  "summary": "Set models and prices",
                  "value": {
                    "selected_models": [
                      "gpt-4.1-mini"
                    ],
                    "model_costs": {
                      "gpt-4.1-mini": {
                        "input_per_1m": 0.4,
                        "output_per_1m": 1.6
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/providers/{label}/test": {
      "post": {
        "operationId": "Test_connection_or_model",
        "summary": "Test connection or model",
        "description": "Explicit diagnostic using the stored endpoint/credentials. Connection checks never silently generate. Model checks may incur usage. No configuration mutation and no automatic billable retries.",
        "tags": [
          "Providers"
        ],
        "x-scopes": [
          "providers:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "label",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Production OpenAI",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Test_connection_or_modelResponse"
                },
                "example": {
                  "test": {
                    "kind": "model",
                    "model": "gpt-4.1-mini",
                    "tested_version": "provider-v2",
                    "outcome": "passed",
                    "latency_ms": 320,
                    "completed_at": "2026-09-17T12:00:00Z",
                    "diagnostic_code": null
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderTest"
              },
              "examples": {
                "Connection": {
                  "summary": "Connection",
                  "value": {
                    "kind": "connection"
                  }
                },
                "Model": {
                  "summary": "Model",
                  "value": {
                    "kind": "model",
                    "model": "gpt-4.1-mini"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/keys": {
      "get": {
        "operationId": "List_gateway_credentials",
        "summary": "List gateway credentials",
        "description": "Read metadata and fingerprints for app credentials, including expired/revoked history. Does not reveal secrets.",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_gateway_credentialsResponse"
                },
                "example": {
                  "items": [
                    {
                      "key_id": "key_example",
                      "name": "Default",
                      "status": "active",
                      "expires_at": null,
                      "created_at": "2026-09-17T12:00:00Z",
                      "fingerprint": "...8f12"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Issue_a_gateway_credential",
        "summary": "Issue a gateway credential",
        "description": "Issue a named key for the existing canonical app. No default expiry. Non-revoked names are unique case-insensitively.",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "credentials:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "201": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Issue_a_gateway_credentialResponse"
                },
                "example": {
                  "key": {
                    "key_id": "key_example",
                    "name": "CI automation",
                    "status": "active",
                    "expires_at": null,
                    "created_at": "2026-09-17T12:00:00Z",
                    "fingerprint": "...8f12",
                    "secret": "<new-gateway-key>"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdditionalGatewayKeyCreate"
              },
              "example": {
                "name": "CI automation",
                "expires_at": null
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/keys/{key_id}": {
      "patch": {
        "operationId": "Change_gateway_key_expiry",
        "summary": "Change gateway key expiry",
        "description": "Only active credentials may change expiry. Null removes expiry; expired/revoked states are terminal. Key name is immutable.",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "credentials:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "key_example",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Change_gateway_key_expiryResponse"
                },
                "example": {
                  "key": {
                    "key_id": "key_example",
                    "name": "Default",
                    "status": "active",
                    "expires_at": null,
                    "created_at": "2026-09-17T12:00:00Z",
                    "fingerprint": "...8f12"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GatewayKeyPatch"
              },
              "example": {
                "expires_at": "2027-01-01T00:00:00Z"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "Revoke_a_gateway_credential",
        "summary": "Revoke a gateway credential",
        "description": "Idempotently revoke this key, preserve history and release its display name. The app and other valid keys remain available.",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "credentials:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "key_example",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "204": {
            "description": "Completed successfully."
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/keys/{key_id}/reveal": {
      "post": {
        "operationId": "Reveal_a_gateway_credential",
        "summary": "Reveal a gateway credential",
        "description": "Explicitly reveal an active or expired retained gateway credential; revoked keys return terminal_key_state. Response is no-store and reveal is audited without the secret.",
        "tags": [
          "Credentials"
        ],
        "x-scopes": [
          "credentials:read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "key_example",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reveal_a_gateway_credentialResponse"
                },
                "example": {
                  "key": {
                    "key_id": "key_example",
                    "name": "Default",
                    "status": "active",
                    "expires_at": null,
                    "created_at": "2026-09-17T12:00:00Z",
                    "fingerprint": "...8f12",
                    "secret": "<existing-gateway-key>"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/prompts": {
      "get": {
        "operationId": "List_prompts",
        "summary": "List prompts",
        "description": "List prompt IDs and timestamps. Read a prompt to retrieve its content.",
        "tags": [
          "Prompts"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_promptsResponse"
                },
                "example": {
                  "items": [
                    {
                      "prompt_id": "support_system",
                      "updated_at": "2026-09-17T12:00:00Z"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/prompts/{prompt_id}": {
      "get": {
        "operationId": "Read_a_prompt",
        "summary": "Read a prompt",
        "description": "Read current template content. Prompt contents remain live while policy may govern their enforcement.",
        "tags": [
          "Prompts"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "prompt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "support_system",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_a_promptResponse"
                },
                "example": {
                  "prompt": {
                    "prompt_id": "support_system",
                    "content": "You help customers with their support questions.",
                    "version": "prompt-v1"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "Create_or_replace_a_prompt",
        "summary": "Create or replace a prompt",
        "description": "PUT replaces the complete content. Use If-Match for replacement; use If-None-Match: * for creation. Exactly one precondition is required.",
        "tags": [
          "Prompts"
        ],
        "x-scopes": [
          "config:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "prompt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "support_system",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "schema": {
              "type": "string",
              "description": "Required for replacement; mutually exclusive with If-None-Match."
            },
            "example": "\"prompt-v1\""
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "schema": {
              "type": "string",
              "const": "*"
            },
            "description": "Required for creation; mutually exclusive with If-Match."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Create_or_replace_a_promptResponse"
                },
                "example": {
                  "prompt": {
                    "prompt_id": "support_system",
                    "content": "You help customers with their support questions.",
                    "version": "prompt-v2"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptPut"
              },
              "example": {
                "content": "You help customers with their support questions."
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "Delete_a_prompt",
        "summary": "Delete a prompt",
        "description": "Delete this prompt template only. Requests depending on the prompt will fail according to normal enforcement.",
        "tags": [
          "Prompts"
        ],
        "x-scopes": [
          "config:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "prompt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "support_system",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "204": {
            "description": "Completed successfully."
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/smart-groups": {
      "get": {
        "operationId": "List_smart_groups",
        "summary": "List smart groups",
        "description": "Read existing tenant resources for selection. No create/update/delete operation exists.",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Name search."
            },
            "description": "Name search."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_smart_groupsResponse"
                },
                "example": {
                  "items": [
                    {
                      "group_name": "engineering",
                      "display_name": "Engineering",
                      "enabled": true,
                      "member_count": 24
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/smart-groups/{group_name}": {
      "get": {
        "operationId": "Read_a_smart_group",
        "summary": "Read a smart group",
        "description": "Read metadata for an existing tenant resource. Membership and definition contents cannot be edited through management.",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "group_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "engineering",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_a_smart_groupResponse"
                },
                "example": {
                  "item": {
                    "group_name": "engineering",
                    "display_name": "Engineering",
                    "enabled": true,
                    "member_count": 24
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/custom-definitions": {
      "get": {
        "operationId": "List_custom_definitions",
        "summary": "List custom definitions",
        "description": "Read existing tenant resources for selection. No create/update/delete operation exists.",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Name search."
            },
            "description": "Name search."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_custom_definitionsResponse"
                },
                "example": {
                  "items": [
                    {
                      "definition_id": "employee_id",
                      "name": "Employee ID",
                      "type": "precision",
                      "available": true
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/custom-definitions/{definition_id}": {
      "get": {
        "operationId": "Read_a_custom_definition",
        "summary": "Read a custom definition",
        "description": "Read metadata for an existing tenant resource. Membership and definition contents cannot be edited through management.",
        "tags": [
          "Catalogs"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "definition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "employee_id",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_a_custom_definitionResponse"
                },
                "example": {
                  "item": {
                    "definition_id": "employee_id",
                    "name": "Employee ID",
                    "type": "precision",
                    "available": true
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/versions": {
      "get": {
        "operationId": "List_app_configuration_versions",
        "summary": "List app configuration versions",
        "description": "Read redacted configuration-change metadata. This is not inference request-log reporting.",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_app_configuration_versionsResponse"
                },
                "example": {
                  "items": [
                    {
                      "version_id": "version_example",
                      "operation": "update_config",
                      "changed_at": "2026-09-17T12:00:00Z"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/versions/{version_id}": {
      "get": {
        "operationId": "Read_a_configuration_version",
        "summary": "Read a configuration version",
        "description": "Read a redacted app configuration snapshot and change summary; no provider or gateway secrets.",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "version_example",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_a_configuration_versionResponse"
                },
                "example": {
                  "version": {
                    "version_id": "version_example",
                    "configuration": {
                      "name": "Support Bot",
                      "mode": "gateway",
                      "enabled": true,
                      "version": "app-v1",
                      "provider_labels": [
                        "Production OpenAI"
                      ],
                      "tags": [
                        "production"
                      ],
                      "policy_authority": {
                        "enabled": false,
                        "active_revision": null
                      }
                    }
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/apps/{app_name}/versions/{version_id}/rollback": {
      "post": {
        "operationId": "Roll_back_app_configuration",
        "summary": "Roll back app configuration",
        "description": "Restore permitted app settings as a new version. Check all current scope/reference rules. Does not restore shared providers, policy revisions, groups, definitions or gateway key lifecycle.",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "config:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "app_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "example": "Support Bot",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "version_example",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Roll_back_app_configurationResponse"
                },
                "example": {
                  "app": {
                    "name": "Support Bot",
                    "mode": "gateway",
                    "enabled": true,
                    "version": "app-v3",
                    "provider_labels": [
                      "Production OpenAI"
                    ],
                    "tags": [
                      "production"
                    ],
                    "policy_authority": {
                      "enabled": false,
                      "active_revision": null
                    }
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Rollback"
              },
              "example": {
                "message": "Restore the previous timeout"
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/audit-events": {
      "get": {
        "operationId": "Read_configuration_audit",
        "summary": "Read configuration audit",
        "description": "Read management/configuration audit, with redacted diffs. No gateway request bodies, usage reports or traffic logs.",
        "tags": [
          "History"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          },
          {
            "name": "app_name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409."
          },
          {
            "name": "operation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "management_key_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": ""
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": ""
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_configuration_auditResponse"
                },
                "example": {
                  "items": [
                    {
                      "event_id": "event_example",
                      "operation": "app.update",
                      "actor_type": "management_key",
                      "management_key_id": "management_key_example",
                      "app_name": "Support Bot",
                      "changed_at": "2026-09-17T12:00:00Z"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/status": {
      "get": {
        "operationId": "Read_policy_authority",
        "summary": "Read policy authority",
        "description": "Read tenant policy discovery data. Use the returned schema/catalog rather than hardcoding selectors or effect values.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_policy_authorityResponse"
                },
                "example": {
                  "data": {
                    "enabled": true,
                    "active_revision": 12,
                    "version": "policy-v12"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/metadata": {
      "get": {
        "operationId": "Read_policy_metadata",
        "summary": "Read policy metadata",
        "description": "Read tenant policy discovery data. Use the returned schema/catalog rather than hardcoding selectors or effect values.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_policy_metadataResponse"
                },
                "example": {
                  "data": {
                    "target": "llm_gateway",
                    "max_source_bytes": 400000,
                    "max_simulation_cases": 100
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/authoring-schema": {
      "get": {
        "operationId": "Read_policy_authoring_schema",
        "summary": "Read policy authoring schema",
        "description": "Read tenant policy discovery data. Use the returned schema/catalog rather than hardcoding selectors or effect values.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_policy_authoring_schemaResponse"
                },
                "example": {
                  "data": {
                    "target": "llm_gateway",
                    "schema_version": "v2",
                    "value_sources_url": "/llmgateway/management/v1/policy/authoring-catalog"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/authoring-catalog": {
      "get": {
        "operationId": "Read_policy_authoring_catalog",
        "summary": "Read policy authoring catalog",
        "description": "Read tenant policy discovery data. Use the returned schema/catalog rather than hardcoding selectors or effect values.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_policy_authoring_catalogResponse"
                },
                "example": {
                  "data": {
                    "applications": [
                      "Support Bot"
                    ],
                    "providers": [
                      "Production OpenAI"
                    ],
                    "smart_groups": [
                      "engineering"
                    ]
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/suggested-policies": {
      "get": {
        "operationId": "Read_suggested_policies",
        "summary": "Read suggested policies",
        "description": "Read tenant policy discovery data. Use the returned schema/catalog rather than hardcoding selectors or effect values.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_suggested_policiesResponse"
                },
                "example": {
                  "data": {
                    "templates": [
                      {
                        "name": "Protect sensitive data",
                        "source": "<QuilrQL source returned by the server>"
                      }
                    ]
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/authoring-catalog/search": {
      "get": {
        "operationId": "Search_policy_values",
        "summary": "Search policy values",
        "description": "Search one value-source kind advertised by the authoring schema. parent is required only when the selected field has a parent_field.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "A supported autofill kind from authoring-schema."
            },
            "example": "applications",
            "description": "A supported autofill kind from authoring-schema."
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Search string."
            },
            "example": "Support",
            "description": "Search string."
          },
          {
            "name": "parent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Parent selector, when required by schema."
            },
            "description": "Parent selector, when required by schema."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Search_policy_valuesResponse"
                },
                "example": {
                  "items": [
                    {
                      "value": "Support Bot",
                      "label": "Support Bot"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/conversion-preview": {
      "post": {
        "operationId": "Preview_policy_conversion",
        "summary": "Preview policy conversion",
        "description": "Read current app settings and return a credential-free proposed policy plus review evidence. Does not activate authority.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preview_policy_conversionResponse"
                },
                "example": {
                  "preview": {
                    "checksum": "conversion_example",
                    "source": "<generated QuilrQL source>",
                    "warnings": []
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/validate": {
      "post": {
        "operationId": "Validate_policy_source",
        "summary": "Validate policy source",
        "description": "Compile source and validate tenant references without publishing or invoking a model. Semantic validation can return valid false with diagnostics.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Validate_policy_sourceResponse"
                },
                "example": {
                  "validation": {
                    "valid": true,
                    "checksum": "policy_example",
                    "errors": [],
                    "warnings": []
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicySource"
              },
              "example": {
                "source": "<source from conversion-preview or the policy editor>"
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/simulate": {
      "post": {
        "operationId": "Simulate_policy_source",
        "summary": "Simulate policy source",
        "description": "Evaluate up to 100 synthetic cases. This is policy evaluation, not a model call or replay of production logs.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Simulate_policy_sourceResponse"
                },
                "example": {
                  "results": [
                    {
                      "case_index": 0,
                      "matched_rules": [
                        "protect_pii"
                      ],
                      "effects": {
                        "dlp.action": "redact"
                      }
                    }
                  ],
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicySimulation"
              },
              "example": {
                "source": "<source from the policy editor>",
                "cases": [
                  {
                    "app_name": "Support Bot",
                    "stage": "request",
                    "user_email": "developer@example.com",
                    "model": "gpt-4.1-mini",
                    "data_types": [
                      "Email Address"
                    ]
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/drafts": {
      "get": {
        "operationId": "List_policy_drafts",
        "summary": "List policy drafts",
        "description": "List draft metadata. Drafts do not govern runtime traffic.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_policy_draftsResponse"
                },
                "example": {
                  "items": [
                    {
                      "draft_id": "draft_example",
                      "name": "Support guardrails",
                      "version": "draft-v1"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Create_a_policy_draft",
        "summary": "Create a policy draft",
        "description": "Save source as a draft. Validation/publication is explicit.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "policy:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "201": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Create_a_policy_draftResponse"
                },
                "example": {
                  "draft": {
                    "draft_id": "draft_example",
                    "name": "Support guardrails",
                    "version": "draft-v1"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyDraft"
              },
              "example": {
                "name": "Support guardrails",
                "source": "<source from conversion-preview or the policy editor>"
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/drafts/{draft_id}": {
      "get": {
        "operationId": "Read_a_policy_draft",
        "summary": "Read a policy draft",
        "description": "Read source and current draft revision.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "draft_example",
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_a_policy_draftResponse"
                },
                "example": {
                  "draft": {
                    "draft_id": "draft_example",
                    "source": "<stored QuilrQL source>",
                    "version": "draft-v1"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "Replace_a_policy_draft",
        "summary": "Replace a policy draft",
        "description": "Replace draft name/source using its current ETag. Does not publish.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "policy:write"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "draft_example",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Replace_a_policy_draftResponse"
                },
                "example": {
                  "draft": {
                    "draft_id": "draft_example",
                    "version": "draft-v2"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyDraft"
              },
              "example": {
                "name": "Support guardrails",
                "source": "<updated QuilrQL source>"
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/drafts/{draft_id}/publish": {
      "post": {
        "operationId": "Publish_a_policy_draft",
        "summary": "Publish a policy draft",
        "description": "Validate the selected draft and publish an immutable tenant-wide revision. If-Match refers to the draft; expected_active_revision protects against another publication.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "policy:publish"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "draft_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "draft_example",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "201": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Publish_a_policy_draftResponse"
                },
                "example": {
                  "policy": {
                    "enabled": true,
                    "active_revision": 13,
                    "version": "policy-v13"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Publish"
              },
              "example": {
                "message": "Deploy reviewed support rules",
                "expected_active_revision": 12
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/revisions": {
      "get": {
        "operationId": "List_policy_revisions",
        "summary": "List policy revisions",
        "description": "List immutable policy history; separate from app configuration versions.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_policy_revisionsResponse"
                },
                "example": {
                  "items": [
                    {
                      "revision": 12,
                      "checksum": "policy_example",
                      "published_at": "2026-09-17T12:00:00Z"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/revisions/{revision}": {
      "get": {
        "operationId": "Read_policy_revision_metadata",
        "summary": "Read policy revision metadata",
        "description": "Read revision checksum, publication metadata and diagnostics.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "",
              "minimum": 1
            },
            "example": 12,
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_policy_revision_metadataResponse"
                },
                "example": {
                  "revision": {
                    "revision": 12,
                    "checksum": "policy_example"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/revisions/{revision}/source": {
      "get": {
        "operationId": "Read_policy_revision_source",
        "summary": "Read policy revision source",
        "description": "Return the stored source for one immutable revision.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "read"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "",
              "minimum": 1
            },
            "example": 12,
            "description": ""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_policy_revision_sourceResponse"
                },
                "example": {
                  "revision": {
                    "revision": 12,
                    "source": "<stored QuilrQL source>"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/revisions/{revision}/rollback": {
      "post": {
        "operationId": "Roll_back_policy_authority",
        "summary": "Roll back policy authority",
        "description": "Validate the historical source against current catalogs and publish it as a new revision. If-Match is the authority ETag from policy/status.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "policy:publish"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "",
              "minimum": 1
            },
            "example": 12,
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Roll_back_policy_authorityResponse"
                },
                "example": {
                  "policy": {
                    "enabled": true,
                    "active_revision": 14,
                    "version": "policy-v14"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Rollback"
              },
              "example": {
                "message": "Restore the last reviewed policy"
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/enable": {
      "post": {
        "operationId": "Enable_policy_authority",
        "summary": "Enable policy authority",
        "description": "Activate the reviewed conversion snapshot. If-Match is the authority ETag; checksum must match a fresh conversion-preview. Existing app governed settings become dormant.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "policy:publish"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Enable_policy_authorityResponse"
                },
                "example": {
                  "policy": {
                    "enabled": true,
                    "active_revision": 12,
                    "version": "policy-v12"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyEnable"
              },
              "example": {
                "conversion_checksum": "conversion_example"
              }
            }
          }
        }
      }
    },
    "/llmgateway/management/v1/policy/disable": {
      "post": {
        "operationId": "Disable_policy_authority",
        "summary": "Disable policy authority",
        "description": "Disable tenant-wide QuilrQL authority. Stored app settings, including dormant edits, become live. Does not enable a disabled app or provider.",
        "tags": [
          "Policy"
        ],
        "x-scopes": [
          "policy:publish"
        ],
        "security": [
          {
            "ManagementKey": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Disable_policy_authorityResponse"
                },
                "example": {
                  "policy": {
                    "enabled": false,
                    "active_revision": 12,
                    "version": "policy-v13"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Rollback"
              },
              "example": {
                "message": "Return authority to app settings"
              }
            }
          }
        }
      }
    },
    "/llmgateway/management-admin/v1/tenants/{tenant_id}/settings": {
      "get": {
        "operationId": "Read_tenant_management_settings",
        "summary": "Read tenant management settings",
        "description": "Administrator-only bootstrap. Verify tenant membership and admin role or authorized Quilr operator identity.",
        "tags": [
          "Administration"
        ],
        "x-scopes": [],
        "security": [
          {
            "AdministratorSession": []
          }
        ],
        "parameters": [
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Verified administrator tenant scope.",
              "minLength": 1
            },
            "example": "tenant_example",
            "description": "Verified administrator tenant scope."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Read_tenant_management_settingsResponse"
                },
                "example": {
                  "settings": {
                    "enabled": false,
                    "version": "tenant-v1"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "Enable_or_suspend_tenant_management",
        "summary": "Enable or suspend tenant management",
        "description": "Requires the deployment switch and verified administrator authority. Disable suspends keys without revoking them or changing gateway apps.",
        "tags": [
          "Administration"
        ],
        "x-scopes": [],
        "security": [
          {
            "AdministratorSession": []
          }
        ],
        "parameters": [
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Verified administrator tenant scope.",
              "minLength": 1
            },
            "example": "tenant_example",
            "description": "Verified administrator tenant scope."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Enable_or_suspend_tenant_managementResponse"
                },
                "example": {
                  "settings": {
                    "enabled": true,
                    "version": "tenant-v2"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantSettingsPatch"
              },
              "example": {
                "enabled": true
              }
            }
          }
        }
      }
    },
    "/llmgateway/management-admin/v1/tenants/{tenant_id}/keys": {
      "get": {
        "operationId": "List_management_keys",
        "summary": "List management keys",
        "description": "List metadata only. Existing management secrets cannot be retrieved.",
        "tags": [
          "Administration"
        ],
        "x-scopes": [],
        "security": [
          {
            "AdministratorSession": []
          }
        ],
        "parameters": [
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Verified administrator tenant scope.",
              "minLength": 1
            },
            "example": "tenant_example",
            "description": "Verified administrator tenant scope."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Items per page.",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "example": 50,
            "description": "Items per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Opaque cursor returned by this same collection and filters."
            },
            "description": "Opaque cursor returned by this same collection and filters."
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/List_management_keysResponse"
                },
                "example": {
                  "items": [
                    {
                      "key_id": "management_key_example",
                      "name": "Deployment automation",
                      "scopes": [
                        "read",
                        "config:write"
                      ],
                      "expires_at": null,
                      "status": "active"
                    }
                  ],
                  "next_cursor": null,
                  "has_more": false,
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "Issue_a_management_key",
        "summary": "Issue a management key",
        "description": "Issue a tenant-bound key through verified administration. Tenant opt-in must be enabled. Secret is available at issuance only; no expiry by default.",
        "tags": [
          "Administration"
        ],
        "x-scopes": [],
        "security": [
          {
            "AdministratorSession": []
          }
        ],
        "parameters": [
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Verified administrator tenant scope.",
              "minLength": 1
            },
            "example": "tenant_example",
            "description": "Verified administrator tenant scope."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Unique operation key. Reuse only with the identical request; mismatch returns 409.",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "operation-001"
          }
        ],
        "responses": {
          "201": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Issue_a_management_keyResponse"
                },
                "example": {
                  "key": {
                    "key_id": "management_key_example",
                    "name": "Deployment automation",
                    "secret": "<new-management-secret>",
                    "expires_at": null,
                    "scopes": [
                      "read",
                      "config:write",
                      "providers:write",
                      "credentials:write"
                    ]
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementKeyCreate"
              },
              "example": {
                "name": "Deployment automation",
                "scopes": [
                  "read",
                  "config:write",
                  "providers:write",
                  "credentials:write"
                ],
                "expires_at": null
              }
            }
          }
        }
      }
    },
    "/llmgateway/management-admin/v1/tenants/{tenant_id}/keys/{key_id}": {
      "patch": {
        "operationId": "Update_a_management_key",
        "summary": "Update a management key",
        "description": "Change name, explicit scopes or optional expiry. Expired/revoked keys cannot be reactivated; secret is not returned.",
        "tags": [
          "Administration"
        ],
        "x-scopes": [],
        "security": [
          {
            "AdministratorSession": []
          }
        ],
        "parameters": [
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Verified administrator tenant scope.",
              "minLength": 1
            },
            "example": "tenant_example",
            "description": "Verified administrator tenant scope."
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "key_example",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "200": {
            "description": "Completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Update_a_management_keyResponse"
                },
                "example": {
                  "key": {
                    "key_id": "management_key_example",
                    "scopes": [
                      "read"
                    ],
                    "expires_at": null,
                    "status": "active"
                  },
                  "request_id": "req_example"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Current revision for mutable resources. Use it in If-Match when required.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementKeyPatch"
              },
              "example": {
                "scopes": [
                  "read"
                ],
                "expires_at": null
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "Revoke_a_management_key",
        "summary": "Revoke a management key",
        "description": "Idempotently revoke a key. This remains available to authorized administrators while tenant management is suspended.",
        "tags": [
          "Administration"
        ],
        "x-scopes": [],
        "security": [
          {
            "AdministratorSession": []
          }
        ],
        "parameters": [
          {
            "name": "tenant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Verified administrator tenant scope.",
              "minLength": 1
            },
            "example": "tenant_example",
            "description": "Verified administrator tenant scope."
          },
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            },
            "example": "key_example",
            "description": ""
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Exact quoted ETag from a current resource read."
            },
            "example": "\"resource-version\""
          }
        ],
        "responses": {
          "204": {
            "description": "Completed successfully."
          },
          "default": {
            "description": "Structured error; see shared error/status reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "insufficient_scope",
                    "message": "This operation requires an additional scope."
                  },
                  "request_id": "req_example"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ManagementKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Tenant-bound management secret. Required application scopes are listed in x-scopes; all listed scopes are required."
      },
      "AdministratorSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "Placeholder for the verified administrator adapter. Exact issuer/audience/tenant-role and operator-session binding must be finalized; a management key is not accepted."
      }
    },
    "schemas": {
      "GatewayKeyCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Trimmed, case-insensitively unique among non-revoked keys of this app.",
            "minLength": 1,
            "maxLength": 120,
            "default": "Default"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Future RFC 3339 timestamp with an explicit timezone.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Omit on create or send null for no expiry. On PATCH, omission preserves the current expiry and null removes it. Expired/revoked credentials cannot be resurrected."
          }
        },
        "additionalProperties": false,
        "description": "Initial key uses Default when omitted. Additional key creation requires a name."
      },
      "GatewayKeyPatch": {
        "type": "object",
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Future RFC 3339 timestamp with an explicit timezone.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Omit on create or send null for no expiry. On PATCH, omission preserves the current expiry and null removes it. Expired/revoked credentials cannot be resurrected."
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "expires_at"
        ]
      },
      "ManagementKeyCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Human-readable automation name.",
            "minLength": 1,
            "maxLength": 120
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "config:write",
                "providers:write",
                "policy:write",
                "policy:publish",
                "credentials:write",
                "credentials:read"
              ]
            },
            "description": "Explicit scopes; there are no implicit scope grants.",
            "minItems": 1,
            "uniqueItems": true
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Future RFC 3339 timestamp with an explicit timezone.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Omit on create or send null for no expiry. On PATCH, omission preserves the current expiry and null removes it. Expired/revoked credentials cannot be resurrected."
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "name",
          "scopes"
        ]
      },
      "ManagementKeyPatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Optional new display name.",
            "minLength": 1,
            "maxLength": 120
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "config:write",
                "providers:write",
                "policy:write",
                "policy:publish",
                "credentials:write",
                "credentials:read"
              ]
            },
            "description": "Explicit scopes; there are no implicit scope grants.",
            "minItems": 1,
            "uniqueItems": true
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Future RFC 3339 timestamp with an explicit timezone.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Omit on create or send null for no expiry. On PATCH, omission preserves the current expiry and null removes it. Expired/revoked credentials cannot be resurrected."
          }
        },
        "additionalProperties": false,
        "description": "",
        "minProperties": 1
      },
      "TenantSettingsPatch": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Enable management for this tenant. Disabling suspends existing keys without revocation."
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "enabled"
        ]
      },
      "RateLimit": {
        "type": "object",
        "properties": {
          "value": {
            "type": "integer",
            "description": "Maximum events in the window; zero disables this limit.",
            "minimum": 0
          },
          "duration": {
            "type": "string",
            "enum": [
              "minute",
              "hour",
              "day"
            ]
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "value",
          "duration"
        ]
      },
      "TokenLimits": {
        "type": "object",
        "properties": {
          "max_per_request": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Maximum input tokens per request; zero disables.",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum input tokens per request; zero disables."
          },
          "input": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RateLimit"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          },
          "output": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RateLimit"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "ModelLimit": {
        "type": "object",
        "properties": {
          "provider_label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "model": {
            "type": "string",
            "description": "Exact configured model identifier; availability depends on the provider and deployment.",
            "minLength": 1,
            "maxLength": 512
          },
          "timeout": {
            "anyOf": [
              {
                "type": "number",
                "description": "Seconds.",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Seconds."
          },
          "concurrency_per_minute": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Request admissions per 60 seconds, following existing gateway semantics.",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Request admissions per 60 seconds, following existing gateway semantics."
          },
          "rate_limit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RateLimit"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          },
          "token_limits": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TokenLimits"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "provider_label",
          "model"
        ]
      },
      "Limits": {
        "type": "object",
        "properties": {
          "timeout": {
            "anyOf": [
              {
                "type": "number",
                "description": "Upstream timeout in seconds; null clears the configured override.",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Upstream timeout in seconds; null clears the configured override."
          },
          "concurrency_per_minute": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Admission count over the existing 60-second window.",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Admission count over the existing 60-second window."
          },
          "rate_limit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RateLimit"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null clears the request limit."
          },
          "token_limits": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TokenLimits"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          },
          "model_rate_limits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelLimit"
            },
            "description": "Full replacement; [] removes all model overrides. App and model limits both apply.",
            "uniqueItems": true
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "CustomSelection": {
        "type": "object",
        "properties": {
          "definition_id": {
            "type": "string",
            "description": "Stable ID from GET /custom-definitions.",
            "minLength": 1
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "action": {
            "type": "string",
            "description": "Adversarial detections do not expose redactable spans; incompatible actions are rejected by catalog validation.",
            "enum": [
              "monitor",
              "partial-redact",
              "redact",
              "block"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "request",
              "response",
              "both"
            ]
          },
          "sensitivity": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Select or configure an existing definition. Regex, EDM rows, semantic examples and intent definitions are not accepted.",
        "required": [
          "definition_id"
        ]
      },
      "Detection": {
        "type": "object",
        "properties": {
          "data_risk_action": {
            "type": "string",
            "description": "Adversarial detections do not expose redactable spans; incompatible actions are rejected by catalog validation.",
            "enum": [
              "monitor",
              "partial-redact",
              "redact",
              "block"
            ]
          },
          "enabled_categories": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean",
              "description": ""
            },
            "description": "Catalog category/subcategory IDs mapped to enabled state. Unknown selectors are rejected."
          },
          "category_actions": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "description": "Adversarial detections do not expose redactable spans; incompatible actions are rejected by catalog validation.",
              "enum": [
                "monitor",
                "partial-redact",
                "redact",
                "block"
              ]
            },
            "description": "Category ID to action."
          },
          "sub_category_actions": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "description": "Adversarial detections do not expose redactable spans; incompatible actions are rejected by catalog validation.",
                "enum": [
                  "monitor",
                  "partial-redact",
                  "redact",
                  "block"
                ]
              },
              "description": ""
            },
            "description": "Category ID to subcategory name to action."
          },
          "category_scopes": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "request",
                "response",
                "both"
              ]
            },
            "description": ""
          },
          "category_sensitivities": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              "description": "",
              "minItems": 1,
              "uniqueItems": true
            },
            "description": ""
          },
          "sub_category_sensitivities": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ]
                },
                "description": "",
                "minItems": 1,
                "uniqueItems": true
              },
              "description": ""
            },
            "description": ""
          },
          "edm_pattern_sensitivities": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "low",
                "medium",
                "high"
              ]
            },
            "description": ""
          },
          "custom_definitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomSelection"
            },
            "description": "Full replacement of definition selections; [] removes selections. Does not delete definitions."
          }
        },
        "additionalProperties": false,
        "description": "Stored detection controls. Catalogs validate IDs and action/scope compatibility. Governed updates remain inactive while QuilrQL owns enforcement."
      },
      "Guardian": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": ""
          },
          "coding_helpers": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "dependency_security_check": {
                "type": "boolean",
                "description": ""
              },
              "latest_version_suggestions": {
                "type": "boolean",
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": ""
          },
          "task_adherence": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "action": {
                "type": "string",
                "enum": [
                  "nudge",
                  "block"
                ]
              },
              "sensitivity": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              "agent_purpose": {
                "type": "string"
              },
              "guardian_agent_prompt": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": ""
          }
        },
        "additionalProperties": false,
        "description": "Partial update for branches; false disables a branch. Model-dependent features require runtime capability."
      },
      "Hallucination": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": ""
          },
          "action": {
            "type": "string",
            "enum": [
              "monitor",
              "block"
            ]
          },
          "score_threshold": {
            "type": "number",
            "description": "Confidence threshold from 0 to 1.",
            "minimum": 0,
            "maximum": 1
          },
          "risk_level": {
            "type": "string",
            "description": "Stored compatibility setting; does not independently select worker behavior.",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "RouteMember": {
        "type": "object",
        "properties": {
          "provider_label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "model": {
            "type": "string",
            "description": "Exact configured model identifier; availability depends on the provider and deployment.",
            "minLength": 1,
            "maxLength": 512
          },
          "weight": {
            "type": "number",
            "description": "Positive percentage. All members of a group must sum to 100.",
            "exclusiveMinimum": 0,
            "maximum": 100
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "provider_label",
          "model",
          "weight"
        ]
      },
      "RoutingGroup": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "App-scoped routing alias.",
            "minLength": 1,
            "maxLength": 200
          },
          "kind": {
            "type": "string",
            "description": "Must match the models and supported API surface.",
            "enum": [
              "chat_completion",
              "anthropic_messages",
              "responses",
              "realtime",
              "vertex_ai",
              "bedrock_runtime"
            ]
          },
          "mode": {
            "type": "string",
            "description": "Balance by request count or token usage.",
            "enum": [
              "requests",
              "tokens"
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RouteMember"
            },
            "description": "",
            "minItems": 1
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "name",
          "kind",
          "mode",
          "members"
        ]
      },
      "RouteTarget": {
        "type": "object",
        "properties": {
          "provider_label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "model": {
            "type": "string",
            "description": "Exact configured model identifier; availability depends on the provider and deployment.",
            "minLength": 1,
            "maxLength": 512
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "provider_label",
          "model"
        ]
      },
      "ContextRoute": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "chat_completion",
              "anthropic_messages",
              "responses",
              "vertex_ai",
              "bedrock_runtime"
            ]
          },
          "context": {
            "type": "string",
            "description": "Only the supported low-context override is active in this v1 contract.",
            "enum": [
              "low"
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "targets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RouteTarget"
            },
            "description": "Ordered fallback targets.",
            "minItems": 1
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "kind",
          "context",
          "targets"
        ]
      },
      "Routing": {
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoutingGroup"
            },
            "description": "Complete replacement; [] clears all named request/token groups."
          },
          "context_routes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContextRoute"
            },
            "description": "Complete replacement; [] clears custom context routes."
          },
          "context_thresholds": {
            "type": "object",
            "properties": {
              "low_max_words": {
                "type": "integer",
                "description": "",
                "minimum": 0
              },
              "medium_max_words": {
                "type": "integer",
                "description": "Must be greater than or equal to low_max_words.",
                "minimum": 0
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "low_max_words",
              "medium_max_words"
            ]
          }
        },
        "additionalProperties": false,
        "description": "Targets reference attached shared providers and configured models. No inline credentials are accepted. Surface compatibility and sum-of-weights checks are mandatory."
      },
      "JwtAuth": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": ""
          },
          "allowed_issuers": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "",
            "uniqueItems": true
          },
          "allowed_client_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "",
            "uniqueItems": true
          },
          "jwks_url": {
            "type": "string",
            "description": "HTTPS JWKS URL.",
            "format": "uri"
          }
        },
        "additionalProperties": false,
        "description": "When enabling JWT authentication, configure nonempty issuers/client IDs and a JWKS URL. Provider/model saves do not test upstream model connections; key resolution follows the existing identity configuration flow."
      },
      "Identity": {
        "type": "object",
        "properties": {
          "jwt_auth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/JwtAuth"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          },
          "identity_header_mode": {
            "type": "boolean",
            "description": ""
          },
          "identity_token_headers": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Additional forwarded identity header name.",
              "minLength": 1
            },
            "description": "",
            "uniqueItems": true
          },
          "identity_token_oid_fallback": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "enforce_identity": {
            "type": "boolean",
            "description": ""
          },
          "enforce_conversation_id": {
            "type": "boolean",
            "description": ""
          },
          "allowed_user_domains": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Email domain without @.",
              "minLength": 1
            },
            "description": "",
            "uniqueItems": true
          },
          "allowed_user_emails": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email"
            },
            "description": "",
            "uniqueItems": true
          },
          "allowed_source_ips": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "description": "IPv4/IPv6 address or CIDR. [] removes the allowlist.",
                  "minLength": 1
                },
                "description": "",
                "uniqueItems": true
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "AccessRule": {
        "type": "object",
        "properties": {
          "allow_all": {
            "type": "boolean",
            "description": "",
            "default": false
          },
          "allow_emails": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email"
            },
            "description": "",
            "uniqueItems": true
          },
          "deny_emails": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "email"
            },
            "description": "",
            "uniqueItems": true
          },
          "allow_smart_groups": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Existing gateway smart-group name.",
              "minLength": 1
            },
            "description": "",
            "uniqueItems": true
          },
          "deny_smart_groups": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Existing gateway smart-group name.",
              "minLength": 1
            },
            "description": "",
            "uniqueItems": true
          }
        },
        "additionalProperties": false,
        "description": "Deny rules win. A group reference never changes group membership."
      },
      "SelfService": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Enable stored personal self-service credential mode."
          },
          "access_control": {
            "type": "object",
            "properties": {
              "version": {
                "type": "integer",
                "const": 1
              },
              "self_service_viewer": {
                "$ref": "#/components/schemas/AccessRule"
              },
              "settings_update_requester": {
                "$ref": "#/components/schemas/AccessRule"
              },
              "settings_update_direct": {
                "$ref": "#/components/schemas/AccessRule"
              },
              "show_api_key": {
                "$ref": "#/components/schemas/AccessRule"
              },
              "show_logs_for_all_users": {
                "$ref": "#/components/schemas/AccessRule"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "version"
            ]
          }
        },
        "additionalProperties": false,
        "description": "App-level access settings only. Personal key issuance and change-request approval workflows are outside this API."
      },
      "GroupPolicy": {
        "type": "object",
        "properties": {
          "group_name": {
            "type": "string",
            "description": "Existing smart-group name.",
            "minLength": 1
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "detection": {
            "$ref": "#/components/schemas/Detection"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "group_name",
          "detection"
        ]
      },
      "TokenSaving": {
        "type": "object",
        "properties": {
          "smart_json_compression": {
            "type": "boolean",
            "description": ""
          },
          "html_to_text": {
            "type": "boolean",
            "description": ""
          },
          "markdown_to_text": {
            "type": "boolean",
            "description": ""
          },
          "text_compression": {
            "type": "boolean",
            "description": ""
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "AlertRule": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": false
          },
          "window_minutes": {
            "type": "integer",
            "description": "",
            "minimum": 5,
            "maximum": 1440,
            "default": 15
          },
          "failure_rate_threshold": {
            "type": "number",
            "description": "Percentage.",
            "minimum": 0,
            "maximum": 100,
            "default": 10
          },
          "minimum_requests": {
            "type": "integer",
            "description": "",
            "minimum": 0,
            "default": 20
          },
          "cooldown_minutes": {
            "type": "integer",
            "description": "",
            "minimum": 1,
            "default": 10
          },
          "notify_on_recovery": {
            "type": "boolean",
            "description": "",
            "default": true
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "Alerting": {
        "type": "object",
        "properties": {
          "app_level": {
            "$ref": "#/components/schemas/AlertRule"
          },
          "provider_level": {
            "$ref": "#/components/schemas/AlertRule"
          },
          "channels": {
            "type": "object",
            "properties": {
              "emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                },
                "description": "",
                "uniqueItems": true
              },
              "webhooks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "slack",
                        "generic"
                      ]
                    },
                    "label": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "description": "Secret webhook URL. Omission on an existing webhook preserves it.",
                      "format": "uri",
                      "writeOnly": true
                    }
                  },
                  "additionalProperties": false,
                  "description": "",
                  "required": [
                    "id",
                    "type"
                  ]
                },
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": ""
          }
        },
        "additionalProperties": false,
        "description": "Enabled rules require at least one configured channel. Webhook URLs are omitted from ordinary reads. No test notification is sent on save."
      },
      "AppPatch": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whole-app availability, independent of QuilrQL. Disabled apps retain keys/configuration.",
            "default": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "description": "Complete replacement.",
            "uniqueItems": true
          },
          "provider_labels": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Ordered complete provider selection, primary first. Mutating this field on an inline app requires explicit conversion.",
            "minItems": 1,
            "uniqueItems": true
          },
          "detection": {
            "$ref": "#/components/schemas/Detection"
          },
          "routing": {
            "$ref": "#/components/schemas/Routing"
          },
          "limits": {
            "$ref": "#/components/schemas/Limits"
          },
          "identity": {
            "$ref": "#/components/schemas/Identity"
          },
          "guardian_agent": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Guardian"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null removes the complete Guardian configuration."
          },
          "hallucination": {
            "$ref": "#/components/schemas/Hallucination"
          },
          "self_service": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SelfService"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null clears self-service configuration."
          },
          "smart_group_policies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupPolicy"
            },
            "description": "Complete replacement of app-local overrides referencing existing groups."
          },
          "token_saving": {
            "$ref": "#/components/schemas/TokenSaving"
          },
          "prompt_store": {
            "type": "object",
            "properties": {
              "require_system_from_store": {
                "type": "boolean",
                "description": "Only enforcement is controlled here; use prompt endpoints for content."
              }
            },
            "additionalProperties": false,
            "description": ""
          },
          "alerting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Alerting"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null clears alert configuration."
          }
        },
        "additionalProperties": false,
        "description": "Omitted fields are preserved. Objects merge declared fields, arrays replace, and null clears only explicitly nullable fields. All changes are validated together.",
        "minProperties": 1
      },
      "AppCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
            "minLength": 1,
            "maxLength": 200
          },
          "mode": {
            "type": "string",
            "enum": [
              "gateway",
              "sdk",
              "copilot_studio"
            ],
            "default": "gateway"
          },
          "initial_key": {
            "$ref": "#/components/schemas/GatewayKeyCreate"
          },
          "enabled": {
            "type": "boolean",
            "description": "Whole-app availability, independent of QuilrQL. Disabled apps retain keys/configuration.",
            "default": true
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "description": "Complete replacement.",
            "uniqueItems": true
          },
          "provider_labels": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Ordered complete provider selection, primary first. Mutating this field on an inline app requires explicit conversion.",
            "minItems": 1,
            "uniqueItems": true
          },
          "detection": {
            "$ref": "#/components/schemas/Detection"
          },
          "routing": {
            "$ref": "#/components/schemas/Routing"
          },
          "limits": {
            "$ref": "#/components/schemas/Limits"
          },
          "identity": {
            "$ref": "#/components/schemas/Identity"
          },
          "guardian_agent": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Guardian"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null removes the complete Guardian configuration."
          },
          "hallucination": {
            "$ref": "#/components/schemas/Hallucination"
          },
          "self_service": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SelfService"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null clears self-service configuration."
          },
          "smart_group_policies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GroupPolicy"
            },
            "description": "Complete replacement of app-local overrides referencing existing groups."
          },
          "token_saving": {
            "$ref": "#/components/schemas/TokenSaving"
          },
          "prompt_store": {
            "type": "object",
            "properties": {
              "require_system_from_store": {
                "type": "boolean",
                "description": "Only enforcement is controlled here; use prompt endpoints for content."
              }
            },
            "additionalProperties": false,
            "description": ""
          },
          "alerting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Alerting"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null clears alert configuration."
          }
        },
        "additionalProperties": false,
        "description": "Defaults: enabled true; mode gateway; initial key named Default with no expiry. New omitted guardrail/control sections begin unset, and capability/schema metadata supplies runtime defaults. QuilrQL can independently govern requests.",
        "required": [
          "name"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "mode": {
                  "const": "gateway"
                }
              }
            },
            "then": {
              "required": [
                "provider_labels"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "provider_labels"
                ]
              }
            }
          }
        ]
      },
      "ProviderAttach": {
        "type": "object",
        "properties": {
          "primary": {
            "type": "boolean",
            "description": "Make this provider primary. false appends without changing the existing primary.",
            "default": false
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "ProviderConversion": {
        "type": "object",
        "properties": {
          "provider_labels": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "Complete desired provider selection, primary first.",
            "minItems": 1,
            "uniqueItems": true
          },
          "routing": {
            "$ref": "#/components/schemas/Routing"
          }
        },
        "additionalProperties": false,
        "description": "Explicitly replace inline providers with shared references. Supply matching route replacements when required. Preserves gateway keys and unrelated app state.",
        "required": [
          "provider_labels"
        ]
      },
      "ModelCost": {
        "type": "object",
        "properties": {
          "input_per_1m": {
            "anyOf": [
              {
                "type": "number",
                "description": "USD per million tokens; null removes this override.",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "USD per million tokens; null removes this override."
          },
          "output_per_1m": {
            "anyOf": [
              {
                "type": "number",
                "description": "USD per million tokens; null removes this override.",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "USD per million tokens; null removes this override."
          },
          "cache_per_1m": {
            "anyOf": [
              {
                "type": "number",
                "description": "USD per million tokens; null removes this override.",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "USD per million tokens; null removes this override."
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "ApiKeyProviderSettings": {
        "type": "object",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
            "minLength": 1,
            "writeOnly": true
          },
          "base_url": {
            "type": "string",
            "description": "Optional compatible upstream base URL.",
            "format": "uri"
          },
          "anthropic_version": {
            "type": "string",
            "description": "Optional Anthropic API version header."
          }
        },
        "additionalProperties": false,
        "description": "API key",
        "required": [
          "api_key"
        ],
        "title": "API key"
      },
      "ApiKeyProviderCreate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_name": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic",
              "anthropic_messages",
              "deepseek",
              "gemini_chatcompletions",
              "openai_responses",
              "openai_assistants",
              "openai_realtime",
              "cohere_rerank",
              "jina_rerank",
              "voyage_rerank",
              "sarvam"
            ]
          },
          "provider_settings": {
            "$ref": "#/components/schemas/ApiKeyProviderSettings"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "label",
          "provider_name",
          "provider_settings"
        ],
        "title": "ApiKey provider"
      },
      "AzureProviderSettings": {
        "type": "object",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
            "minLength": 1,
            "writeOnly": true
          },
          "azure_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "api_version": {
            "type": "string",
            "description": "Azure API version."
          }
        },
        "additionalProperties": false,
        "description": "Azure",
        "required": [
          "api_key",
          "azure_endpoint"
        ],
        "title": "Azure"
      },
      "AzureProviderCreate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_name": {
            "type": "string",
            "enum": [
              "azureopenai",
              "openai_responses_azure",
              "openai_assistants_azure",
              "openai_realtime_azure"
            ]
          },
          "provider_settings": {
            "$ref": "#/components/schemas/AzureProviderSettings"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "label",
          "provider_name",
          "provider_settings"
        ],
        "title": "Azure provider"
      },
      "CustomProviderSettings": {
        "type": "object",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
            "minLength": 1,
            "writeOnly": true
          },
          "base_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": false,
        "description": "Custom endpoint",
        "required": [
          "api_key",
          "base_url"
        ],
        "title": "Custom endpoint"
      },
      "CustomProviderCreate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_name": {
            "type": "string",
            "enum": [
              "general",
              "general_rerank",
              "anthropic_messages_azure"
            ]
          },
          "provider_settings": {
            "$ref": "#/components/schemas/CustomProviderSettings"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "label",
          "provider_name",
          "provider_settings"
        ],
        "title": "Custom provider"
      },
      "BedrockProviderSettings": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "aws_auth_mode": {
                "type": "string",
                "const": "static"
              },
              "aws_region": {
                "type": "string",
                "minLength": 1
              },
              "aws_access_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "aws_secret_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "aws_session_token": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "additionalProperties": false,
            "description": "AWS static",
            "required": [
              "aws_auth_mode",
              "aws_region",
              "aws_access_key",
              "aws_secret_key"
            ],
            "title": "AWS static"
          },
          {
            "type": "object",
            "properties": {
              "aws_auth_mode": {
                "type": "string",
                "const": "assume_role"
              },
              "aws_region": {
                "type": "string",
                "minLength": 1
              },
              "aws_role_arn": {
                "type": "string",
                "minLength": 1
              },
              "aws_external_id": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "aws_role_session_name": {
                "type": "string",
                "minLength": 2,
                "maxLength": 64
              },
              "aws_session_duration_seconds": {
                "type": "integer",
                "description": "",
                "minimum": 900,
                "maximum": 43200
              }
            },
            "additionalProperties": false,
            "description": "AWS assume_role",
            "required": [
              "aws_auth_mode",
              "aws_region",
              "aws_role_arn",
              "aws_external_id"
            ],
            "title": "AWS assume_role"
          }
        ]
      },
      "BedrockProviderCreate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_name": {
            "type": "string",
            "enum": [
              "bedrock",
              "anthropic_messages_bedrock",
              "bedrock_embeddings",
              "bedrock_rerank"
            ]
          },
          "provider_settings": {
            "$ref": "#/components/schemas/BedrockProviderSettings"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "label",
          "provider_name",
          "provider_settings"
        ],
        "title": "Bedrock provider"
      },
      "VertexProviderSettings": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "api_key"
              },
              "gcp_region": {
                "type": "string"
              },
              "api_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "gcp_project_id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "description": "Vertex api_key",
            "required": [
              "auth_type",
              "api_key",
              "gcp_project_id"
            ],
            "title": "Vertex api_key"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "express"
              },
              "gcp_region": {
                "type": "string"
              },
              "api_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "additionalProperties": false,
            "description": "Vertex express",
            "required": [
              "auth_type",
              "api_key"
            ],
            "title": "Vertex express"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "service_account"
              },
              "gcp_region": {
                "type": "string"
              },
              "service_account_json": {
                "type": "string",
                "description": "JSON-encoded Google service account document.",
                "minLength": 1,
                "writeOnly": true
              },
              "gcp_project_id": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "Vertex service_account",
            "required": [
              "auth_type",
              "service_account_json"
            ],
            "title": "Vertex service_account"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "adc"
              },
              "gcp_region": {
                "type": "string"
              },
              "gcp_project_id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "description": "Vertex adc",
            "required": [
              "auth_type",
              "gcp_project_id"
            ],
            "title": "Vertex adc"
          }
        ]
      },
      "VertexProviderCreate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_name": {
            "type": "string",
            "enum": [
              "vertex_ai"
            ]
          },
          "provider_settings": {
            "$ref": "#/components/schemas/VertexProviderSettings"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "label",
          "provider_name",
          "provider_settings"
        ],
        "title": "Vertex provider"
      },
      "OracleChatProviderSettings": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "api_key"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              },
              "api_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "additionalProperties": false,
            "description": "OCI api_key",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "oci_compartment_id",
              "api_key"
            ],
            "title": "OCI api_key"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "gateway_user_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "description": "OCI gateway_user_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "oci_compartment_id"
            ],
            "title": "OCI gateway_user_principal"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "user_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_tenancy_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_user_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_fingerprint": {
                "type": "string",
                "minLength": 1
              },
              "oci_private_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_private_key_passphrase": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "additionalProperties": false,
            "description": "OCI user_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "oci_compartment_id",
              "oci_tenancy_id",
              "oci_user_id",
              "oci_fingerprint",
              "oci_private_key"
            ],
            "title": "OCI user_principal"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "session_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_session_token": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_private_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_private_key_passphrase": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "additionalProperties": false,
            "description": "OCI session_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "oci_compartment_id",
              "oci_session_token",
              "oci_private_key"
            ],
            "title": "OCI session_principal"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "instance_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "description": "OCI instance_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "oci_compartment_id"
            ],
            "title": "OCI instance_principal"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "resource_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "description": "OCI resource_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "oci_compartment_id"
            ],
            "title": "OCI resource_principal"
          }
        ],
        "description": "Only fields for the selected auth_type are accepted. Deployment principal modes require the corresponding runtime identity. No base_url override."
      },
      "OracleChatProviderCreate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_name": {
            "type": "string",
            "enum": [
              "oracle"
            ]
          },
          "provider_settings": {
            "$ref": "#/components/schemas/OracleChatProviderSettings"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "label",
          "provider_name",
          "provider_settings"
        ],
        "title": "OracleChat provider"
      },
      "OracleResponsesProviderSettings": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "api_key"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              },
              "api_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "additionalProperties": false,
            "description": "OCI api_key",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "api_key"
            ],
            "title": "OCI api_key"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "gateway_user_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "description": "OCI gateway_user_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id"
            ],
            "title": "OCI gateway_user_principal"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "user_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_tenancy_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_user_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_fingerprint": {
                "type": "string",
                "minLength": 1
              },
              "oci_private_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_private_key_passphrase": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "additionalProperties": false,
            "description": "OCI user_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "oci_tenancy_id",
              "oci_user_id",
              "oci_fingerprint",
              "oci_private_key"
            ],
            "title": "OCI user_principal"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "session_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_session_token": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_private_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_private_key_passphrase": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              }
            },
            "additionalProperties": false,
            "description": "OCI session_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id",
              "oci_session_token",
              "oci_private_key"
            ],
            "title": "OCI session_principal"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "instance_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "description": "OCI instance_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id"
            ],
            "title": "OCI instance_principal"
          },
          {
            "type": "object",
            "properties": {
              "auth_type": {
                "type": "string",
                "const": "resource_principal"
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "description": "OCI resource_principal",
            "required": [
              "auth_type",
              "oci_region",
              "oci_project_id"
            ],
            "title": "OCI resource_principal"
          }
        ],
        "description": "Only fields for the selected auth_type are accepted. Deployment principal modes require the corresponding runtime identity. No base_url override."
      },
      "OracleResponsesProviderCreate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_name": {
            "type": "string",
            "enum": [
              "oracle_responses"
            ]
          },
          "provider_settings": {
            "$ref": "#/components/schemas/OracleResponsesProviderSettings"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "label",
          "provider_name",
          "provider_settings"
        ],
        "title": "OracleResponses provider"
      },
      "ManagedProviderSettings": {
        "type": "object",
        "properties": {},
        "additionalProperties": false,
        "description": "Deployment-managed provider. Do not send customer credentials or an endpoint."
      },
      "ManagedProviderCreate": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "description": "",
            "default": true
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_name": {
            "type": "string",
            "enum": [
              "quilr_ai"
            ]
          },
          "provider_settings": {
            "$ref": "#/components/schemas/ManagedProviderSettings"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "label",
          "provider_name",
          "provider_settings"
        ],
        "title": "Managed provider"
      },
      "ProviderCreate": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ApiKeyProviderCreate"
          },
          {
            "$ref": "#/components/schemas/AzureProviderCreate"
          },
          {
            "$ref": "#/components/schemas/CustomProviderCreate"
          },
          {
            "$ref": "#/components/schemas/BedrockProviderCreate"
          },
          {
            "$ref": "#/components/schemas/VertexProviderCreate"
          },
          {
            "$ref": "#/components/schemas/OracleChatProviderCreate"
          },
          {
            "$ref": "#/components/schemas/OracleResponsesProviderCreate"
          },
          {
            "$ref": "#/components/schemas/ManagedProviderCreate"
          }
        ],
        "description": "Select the variant matching provider_name. Each provider_settings object is fully specified below."
      },
      "ProviderPatch": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": ""
          },
          "selected_models": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exact configured model identifier; availability depends on the provider and deployment.",
              "minLength": 1,
              "maxLength": 512
            },
            "description": "[] preserves the existing unrestricted-provider convention where supported; use explicit model lists for a finite catalog.",
            "maxItems": 1000,
            "uniqueItems": true
          },
          "model_costs": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ModelCost"
            },
            "description": "Keys must appear in selected_models; rates are USD per million tokens."
          },
          "provider_settings": {
            "type": "object",
            "properties": {
              "api_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "base_url": {
                "type": "string",
                "format": "uri"
              },
              "anthropic_version": {
                "type": "string",
                "description": "Optional Anthropic API version header."
              },
              "azure_endpoint": {
                "type": "string",
                "format": "uri"
              },
              "api_version": {
                "type": "string",
                "description": "Azure API version."
              },
              "aws_region": {
                "type": "string",
                "minLength": 1
              },
              "aws_access_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "aws_secret_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "aws_session_token": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "aws_role_arn": {
                "type": "string",
                "minLength": 1
              },
              "aws_external_id": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "aws_role_session_name": {
                "type": "string",
                "minLength": 2,
                "maxLength": 64
              },
              "aws_session_duration_seconds": {
                "type": "integer",
                "description": "",
                "minimum": 900,
                "maximum": 43200
              },
              "gcp_region": {
                "type": "string"
              },
              "gcp_project_id": {
                "type": "string",
                "minLength": 1
              },
              "service_account_json": {
                "type": "string",
                "description": "JSON-encoded Google service account document.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_region": {
                "type": "string",
                "minLength": 1
              },
              "oci_project_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_compartment_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_tenancy_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_user_id": {
                "type": "string",
                "minLength": 1
              },
              "oci_fingerprint": {
                "type": "string",
                "minLength": 1
              },
              "oci_private_key": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_private_key_passphrase": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "oci_session_token": {
                "type": "string",
                "description": "Write-only secret. Omission preserves an existing secret on PATCH. Never echo redacted placeholders.",
                "minLength": 1,
                "writeOnly": true
              },
              "auth_type": {
                "type": "string",
                "enum": [
                  "api_key",
                  "express",
                  "service_account",
                  "adc",
                  "gateway_user_principal",
                  "user_principal",
                  "session_principal",
                  "instance_principal",
                  "resource_principal"
                ]
              },
              "aws_auth_mode": {
                "type": "string",
                "enum": [
                  "static",
                  "assume_role"
                ]
              }
            },
            "additionalProperties": false,
            "description": "Partial update, then validate the complete merged state against the stored provider type. Only compatible fields are accepted. Switching auth modes removes old-mode credentials and requires all new-mode fields. Omitted secrets are preserved; null/empty/redacted echoes are rejected."
          }
        },
        "additionalProperties": false,
        "description": "",
        "minProperties": 1
      },
      "ProviderTest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "connection"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "model"
              },
              "model": {
                "type": "string",
                "description": "Exact configured model identifier; availability depends on the provider and deployment.",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "kind",
              "model"
            ]
          }
        ],
        "description": "Uses stored credentials and endpoints only. Model must be configured for this provider. No prompt, URL or credential overrides."
      },
      "PromptPut": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string",
            "description": "Nonempty prompt template; contents remain live even while QuilrQL controls enforcement.",
            "minLength": 1,
            "maxLength": 400000
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "content"
        ]
      },
      "PolicySource": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "description": "QuilrQL source. Also enforce the server byte limit of 400,000 UTF-8 bytes.",
            "maxLength": 400000
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "source"
        ]
      },
      "PolicyDraft": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "default": "Untitled draft"
          },
          "source": {
            "type": "string",
            "description": "QuilrQL source. Also enforce the server byte limit of 400,000 UTF-8 bytes.",
            "maxLength": 400000
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "source"
        ]
      },
      "Publish": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Optional audit note.",
            "maxLength": 500
          },
          "expected_active_revision": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Active revision observed during review, or null before the first publication.",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Active revision observed during review, or null before the first publication."
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "expected_active_revision"
        ]
      },
      "Rollback": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Optional audit reason.",
            "maxLength": 500
          }
        },
        "additionalProperties": false,
        "description": ""
      },
      "PolicyEnable": {
        "type": "object",
        "properties": {
          "conversion_checksum": {
            "type": "string",
            "description": "Checksum returned by a reviewed conversion-preview.",
            "minLength": 1
          }
        },
        "additionalProperties": false,
        "description": "Recheck the live configuration snapshot before activating. Reject a stale preview rather than enabling an unreviewed conversion.",
        "required": [
          "conversion_checksum"
        ]
      },
      "SimulationCase": {
        "type": "object",
        "properties": {
          "app_name": {
            "type": "string",
            "description": "Trimmed display name. App lookup is case-insensitive within the authenticated tenant. Ambiguous legacy names return 409.",
            "minLength": 1,
            "maxLength": 200
          },
          "stage": {
            "type": "string",
            "enum": [
              "request",
              "response"
            ],
            "default": "request"
          },
          "user_email": {
            "type": "string",
            "format": "email"
          },
          "smart_groups": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "",
            "uniqueItems": true
          },
          "model": {
            "type": "string",
            "description": "Exact configured model identifier; availability depends on the provider and deployment.",
            "minLength": 1,
            "maxLength": 512
          },
          "provider_label": {
            "type": "string",
            "description": "Exact, trimmed tenant-wide provider label. Immutable after creation.",
            "minLength": 1,
            "maxLength": 200
          },
          "method_type": {
            "type": "string",
            "enum": [
              "chat",
              "responses",
              "assistants",
              "embeddings",
              "rerank",
              "tts",
              "stt",
              "bedrock",
              "vertex",
              "sdk_check"
            ]
          },
          "data_types": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Existing catalog selector.",
              "minLength": 1
            },
            "description": "",
            "uniqueItems": true
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "integer",
                "boolean",
                "null"
              ]
            },
            "description": "Synthetic request metadata. No recorded traffic is read."
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "app_name"
        ]
      },
      "PolicySimulation": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "description": "QuilrQL source. Also enforce the server byte limit of 400,000 UTF-8 bytes.",
            "maxLength": 400000
          },
          "cases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimulationCase"
            },
            "description": "",
            "minItems": 1,
            "maxItems": 100
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "source",
          "cases"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "code",
              "message"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "error",
          "request_id"
        ]
      },
      "Read_capabilitiesResponse": {
        "type": "object",
        "properties": {
          "capabilities": {
            "type": "object",
            "properties": {
              "contract": {
                "type": "string"
              },
              "management_writes": {
                "type": "boolean",
                "description": ""
              },
              "policy_authority": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": ""
                  },
                  "active_revision": {
                    "type": "integer",
                    "description": ""
                  },
                  "version": {
                    "type": "string"
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "enabled",
                  "active_revision",
                  "version"
                ]
              },
              "model_tests_available": {
                "type": "boolean",
                "description": ""
              },
              "provider_types": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "schema_url": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "contract",
              "management_writes",
              "policy_authority",
              "model_tests_available",
              "provider_types",
              "schema_url"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "capabilities",
          "request_id"
        ]
      },
      "List_appsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "mode": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean",
                  "description": ""
                },
                "version": {
                  "type": "string"
                },
                "provider_labels": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": ""
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": ""
                },
                "policy_authority": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "description": ""
                    },
                    "active_revision": {
                      "type": [
                        "string",
                        "integer",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "description": "",
                  "required": [
                    "enabled",
                    "active_revision"
                  ]
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "name",
                "mode",
                "enabled",
                "version",
                "provider_labels",
                "tags",
                "policy_authority"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Create_an_appResponse": {
        "type": "object",
        "properties": {
          "app": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "mode": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "version": {
                "type": "string"
              },
              "provider_labels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "policy_authority": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": ""
                  },
                  "active_revision": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "enabled",
                  "active_revision"
                ]
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "name",
              "mode",
              "enabled",
              "version",
              "provider_labels",
              "tags",
              "policy_authority"
            ]
          },
          "key": {
            "type": "object",
            "properties": {
              "key_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "expires_at": {
                "type": [
                  "string",
                  "integer",
                  "null"
                ]
              },
              "created_at": {
                "type": "string"
              },
              "fingerprint": {
                "type": "string"
              },
              "secret": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "key_id",
              "name",
              "status",
              "expires_at",
              "created_at",
              "fingerprint",
              "secret"
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "app",
          "key",
          "warnings",
          "request_id"
        ]
      },
      "Read_an_appResponse": {
        "type": "object",
        "properties": {
          "app": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "mode": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "version": {
                "type": "string"
              },
              "provider_labels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "policy_authority": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": ""
                  },
                  "active_revision": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "enabled",
                  "active_revision"
                ]
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "name",
              "mode",
              "enabled",
              "version",
              "provider_labels",
              "tags",
              "policy_authority"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "app",
          "request_id"
        ]
      },
      "Update_or_disable_an_appResponse": {
        "type": "object",
        "properties": {
          "app": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "mode": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "version": {
                "type": "string"
              },
              "provider_labels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "policy_authority": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": ""
                  },
                  "active_revision": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "enabled",
                  "active_revision"
                ]
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "name",
              "mode",
              "enabled",
              "version",
              "provider_labels",
              "tags",
              "policy_authority"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "app",
          "request_id"
        ]
      },
      "List_app_providersResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "primary": {
                  "type": "boolean",
                  "description": ""
                },
                "enabled": {
                  "type": "boolean",
                  "description": ""
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "label",
                "primary",
                "enabled"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Attach_a_shared_providerResponse": {
        "type": "object",
        "properties": {
          "app": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "mode": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "version": {
                "type": "string"
              },
              "provider_labels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "policy_authority": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": ""
                  },
                  "active_revision": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "enabled",
                  "active_revision"
                ]
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "name",
              "mode",
              "enabled",
              "version",
              "provider_labels",
              "tags",
              "policy_authority"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "app",
          "request_id"
        ]
      },
      "Convert_inline_providersResponse": {
        "type": "object",
        "properties": {
          "app": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "mode": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "version": {
                "type": "string"
              },
              "provider_labels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "policy_authority": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": ""
                  },
                  "active_revision": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "enabled",
                  "active_revision"
                ]
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "name",
              "mode",
              "enabled",
              "version",
              "provider_labels",
              "tags",
              "policy_authority"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "app",
          "request_id"
        ]
      },
      "List_shared_providersResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "provider_name": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean",
                  "description": ""
                },
                "selected_models": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": ""
                },
                "credential_status": {
                  "type": "object",
                  "properties": {
                    "api_key_configured": {
                      "type": "boolean",
                      "description": ""
                    }
                  },
                  "additionalProperties": false,
                  "description": "",
                  "required": [
                    "api_key_configured"
                  ]
                },
                "version": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "label",
                "provider_name",
                "enabled",
                "selected_models",
                "credential_status",
                "version"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Create_a_shared_providerResponse": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "provider_name": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "selected_models": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "credential_status": {
                "type": "object",
                "properties": {
                  "api_key_configured": {
                    "type": "boolean",
                    "description": ""
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "api_key_configured"
                ]
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "label",
              "provider_name",
              "enabled",
              "selected_models",
              "credential_status",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "provider",
          "request_id"
        ]
      },
      "Read_a_shared_providerResponse": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "provider_name": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "selected_models": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "credential_status": {
                "type": "object",
                "properties": {
                  "api_key_configured": {
                    "type": "boolean",
                    "description": ""
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "api_key_configured"
                ]
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "label",
              "provider_name",
              "enabled",
              "selected_models",
              "credential_status",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "provider",
          "request_id"
        ]
      },
      "Update_or_disable_a_providerResponse": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "provider_name": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "selected_models": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "credential_status": {
                "type": "object",
                "properties": {
                  "api_key_configured": {
                    "type": "boolean",
                    "description": ""
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "api_key_configured"
                ]
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "label",
              "provider_name",
              "enabled",
              "selected_models",
              "credential_status",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "provider",
          "request_id"
        ]
      },
      "Test_connection_or_modelResponse": {
        "type": "object",
        "properties": {
          "test": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "tested_version": {
                "type": "string"
              },
              "outcome": {
                "type": "string"
              },
              "latency_ms": {
                "type": "integer",
                "description": ""
              },
              "completed_at": {
                "type": "string"
              },
              "diagnostic_code": {
                "type": [
                  "string",
                  "integer",
                  "null"
                ]
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "kind",
              "model",
              "tested_version",
              "outcome",
              "latency_ms",
              "completed_at",
              "diagnostic_code"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "test",
          "request_id"
        ]
      },
      "List_gateway_credentialsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "expires_at": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ]
                },
                "created_at": {
                  "type": "string"
                },
                "fingerprint": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "key_id",
                "name",
                "status",
                "expires_at",
                "created_at",
                "fingerprint"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "AdditionalGatewayKeyCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Trimmed, case-insensitively unique among non-revoked keys of this app.",
            "minLength": 1,
            "maxLength": 120
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "description": "Future RFC 3339 timestamp with an explicit timezone.",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Omit on create or send null for no expiry. On PATCH, omission preserves the current expiry and null removes it. Expired/revoked credentials cannot be resurrected."
          }
        },
        "additionalProperties": false,
        "description": "Initial key uses Default when omitted. Additional key creation requires a name.",
        "required": [
          "name"
        ]
      },
      "Issue_a_gateway_credentialResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "object",
            "properties": {
              "key_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "expires_at": {
                "type": [
                  "string",
                  "integer",
                  "null"
                ]
              },
              "created_at": {
                "type": "string"
              },
              "fingerprint": {
                "type": "string"
              },
              "secret": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "key_id",
              "name",
              "status",
              "expires_at",
              "created_at",
              "fingerprint",
              "secret"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "key",
          "request_id"
        ]
      },
      "Change_gateway_key_expiryResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "object",
            "properties": {
              "key_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "expires_at": {
                "type": [
                  "string",
                  "integer",
                  "null"
                ]
              },
              "created_at": {
                "type": "string"
              },
              "fingerprint": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "key_id",
              "name",
              "status",
              "expires_at",
              "created_at",
              "fingerprint"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "key",
          "request_id"
        ]
      },
      "Reveal_a_gateway_credentialResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "object",
            "properties": {
              "key_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "expires_at": {
                "type": [
                  "string",
                  "integer",
                  "null"
                ]
              },
              "created_at": {
                "type": "string"
              },
              "fingerprint": {
                "type": "string"
              },
              "secret": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "key_id",
              "name",
              "status",
              "expires_at",
              "created_at",
              "fingerprint",
              "secret"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "key",
          "request_id"
        ]
      },
      "List_promptsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "prompt_id": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "prompt_id",
                "updated_at"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Read_a_promptResponse": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "object",
            "properties": {
              "prompt_id": {
                "type": "string"
              },
              "content": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "prompt_id",
              "content",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "prompt",
          "request_id"
        ]
      },
      "Create_or_replace_a_promptResponse": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "object",
            "properties": {
              "prompt_id": {
                "type": "string"
              },
              "content": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "prompt_id",
              "content",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "prompt",
          "request_id"
        ]
      },
      "List_smart_groupsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "group_name": {
                  "type": "string"
                },
                "display_name": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean",
                  "description": ""
                },
                "member_count": {
                  "type": "integer",
                  "description": ""
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "group_name",
                "display_name",
                "enabled",
                "member_count"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Read_a_smart_groupResponse": {
        "type": "object",
        "properties": {
          "item": {
            "type": "object",
            "properties": {
              "group_name": {
                "type": "string"
              },
              "display_name": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "member_count": {
                "type": "integer",
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "group_name",
              "display_name",
              "enabled",
              "member_count"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "item",
          "request_id"
        ]
      },
      "List_custom_definitionsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "definition_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "available": {
                  "type": "boolean",
                  "description": ""
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "definition_id",
                "name",
                "type",
                "available"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Read_a_custom_definitionResponse": {
        "type": "object",
        "properties": {
          "item": {
            "type": "object",
            "properties": {
              "definition_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "available": {
                "type": "boolean",
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "definition_id",
              "name",
              "type",
              "available"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "item",
          "request_id"
        ]
      },
      "List_app_configuration_versionsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version_id": {
                  "type": "string"
                },
                "operation": {
                  "type": "string"
                },
                "changed_at": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "version_id",
                "operation",
                "changed_at"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Read_a_configuration_versionResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "object",
            "properties": {
              "version_id": {
                "type": "string"
              },
              "configuration": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": ""
                  },
                  "version": {
                    "type": "string"
                  },
                  "provider_labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": ""
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": ""
                  },
                  "policy_authority": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean",
                        "description": ""
                      },
                      "active_revision": {
                        "type": [
                          "string",
                          "integer",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "description": "",
                    "required": [
                      "enabled",
                      "active_revision"
                    ]
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "name",
                  "mode",
                  "enabled",
                  "version",
                  "provider_labels",
                  "tags",
                  "policy_authority"
                ]
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "version_id",
              "configuration"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "version",
          "request_id"
        ]
      },
      "Roll_back_app_configurationResponse": {
        "type": "object",
        "properties": {
          "app": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "mode": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "version": {
                "type": "string"
              },
              "provider_labels": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "policy_authority": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": ""
                  },
                  "active_revision": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false,
                "description": "",
                "required": [
                  "enabled",
                  "active_revision"
                ]
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "name",
              "mode",
              "enabled",
              "version",
              "provider_labels",
              "tags",
              "policy_authority"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "app",
          "request_id"
        ]
      },
      "Read_configuration_auditResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event_id": {
                  "type": "string"
                },
                "operation": {
                  "type": "string"
                },
                "actor_type": {
                  "type": "string"
                },
                "management_key_id": {
                  "type": "string"
                },
                "app_name": {
                  "type": "string"
                },
                "changed_at": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "event_id",
                "operation",
                "actor_type",
                "management_key_id",
                "app_name",
                "changed_at"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Read_policy_authorityResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "active_revision": {
                "type": "integer",
                "description": ""
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "enabled",
              "active_revision",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "data",
          "request_id"
        ]
      },
      "Read_policy_metadataResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "target": {
                "type": "string"
              },
              "max_source_bytes": {
                "type": "integer",
                "description": ""
              },
              "max_simulation_cases": {
                "type": "integer",
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "target",
              "max_source_bytes",
              "max_simulation_cases"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "data",
          "request_id"
        ]
      },
      "Read_policy_authoring_schemaResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "target": {
                "type": "string"
              },
              "schema_version": {
                "type": "string"
              },
              "value_sources_url": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "target",
              "schema_version",
              "value_sources_url"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "data",
          "request_id"
        ]
      },
      "Read_policy_authoring_catalogResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "applications": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "providers": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "smart_groups": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "applications",
              "providers",
              "smart_groups"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "data",
          "request_id"
        ]
      },
      "Read_suggested_policiesResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "templates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "description": "",
                  "required": [
                    "name",
                    "source"
                  ]
                },
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "templates"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "data",
          "request_id"
        ]
      },
      "Search_policy_valuesResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "value",
                "label"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Preview_policy_conversionResponse": {
        "type": "object",
        "properties": {
          "preview": {
            "type": "object",
            "properties": {
              "checksum": {
                "type": "string"
              },
              "source": {
                "type": "string"
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "checksum",
              "source",
              "warnings"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "preview",
          "request_id"
        ]
      },
      "Validate_policy_sourceResponse": {
        "type": "object",
        "properties": {
          "validation": {
            "type": "object",
            "properties": {
              "valid": {
                "type": "boolean",
                "description": ""
              },
              "checksum": {
                "type": "string"
              },
              "errors": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": ""
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "valid",
              "checksum",
              "errors",
              "warnings"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "validation",
          "request_id"
        ]
      },
      "Simulate_policy_sourceResponse": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "case_index": {
                  "type": "integer",
                  "description": ""
                },
                "matched_rules": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": ""
                },
                "effects": {
                  "type": "object",
                  "properties": {
                    "dlp.action": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "description": "",
                  "required": [
                    "dlp.action"
                  ]
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "case_index",
                "matched_rules",
                "effects"
              ]
            },
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "results",
          "request_id"
        ]
      },
      "List_policy_draftsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "draft_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "draft_id",
                "name",
                "version"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Create_a_policy_draftResponse": {
        "type": "object",
        "properties": {
          "draft": {
            "type": "object",
            "properties": {
              "draft_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "draft_id",
              "name",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "draft",
          "request_id"
        ]
      },
      "Read_a_policy_draftResponse": {
        "type": "object",
        "properties": {
          "draft": {
            "type": "object",
            "properties": {
              "draft_id": {
                "type": "string"
              },
              "source": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "draft_id",
              "source",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "draft",
          "request_id"
        ]
      },
      "Replace_a_policy_draftResponse": {
        "type": "object",
        "properties": {
          "draft": {
            "type": "object",
            "properties": {
              "draft_id": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "draft_id",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "draft",
          "request_id"
        ]
      },
      "Publish_a_policy_draftResponse": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "active_revision": {
                "type": "integer",
                "description": ""
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "enabled",
              "active_revision",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "policy",
          "request_id"
        ]
      },
      "List_policy_revisionsResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "revision": {
                  "type": "integer",
                  "description": ""
                },
                "checksum": {
                  "type": "string"
                },
                "published_at": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "revision",
                "checksum",
                "published_at"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Read_policy_revision_metadataResponse": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "description": ""
              },
              "checksum": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "revision",
              "checksum"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "revision",
          "request_id"
        ]
      },
      "Read_policy_revision_sourceResponse": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "description": ""
              },
              "source": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "revision",
              "source"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "revision",
          "request_id"
        ]
      },
      "Roll_back_policy_authorityResponse": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "active_revision": {
                "type": "integer",
                "description": ""
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "enabled",
              "active_revision",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "policy",
          "request_id"
        ]
      },
      "Enable_policy_authorityResponse": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "active_revision": {
                "type": "integer",
                "description": ""
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "enabled",
              "active_revision",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "policy",
          "request_id"
        ]
      },
      "Disable_policy_authorityResponse": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "active_revision": {
                "type": "integer",
                "description": ""
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "enabled",
              "active_revision",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "policy",
          "request_id"
        ]
      },
      "Read_tenant_management_settingsResponse": {
        "type": "object",
        "properties": {
          "settings": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "enabled",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "settings",
          "request_id"
        ]
      },
      "Enable_or_suspend_tenant_managementResponse": {
        "type": "object",
        "properties": {
          "settings": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "description": ""
              },
              "version": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "enabled",
              "version"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "settings",
          "request_id"
        ]
      },
      "List_management_keysResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": ""
                },
                "expires_at": {
                  "type": [
                    "string",
                    "integer",
                    "null"
                  ]
                },
                "status": {
                  "type": "string"
                }
              },
              "additionalProperties": false,
              "description": "",
              "required": [
                "key_id",
                "name",
                "scopes",
                "expires_at",
                "status"
              ]
            },
            "description": ""
          },
          "next_cursor": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "has_more": {
            "type": "boolean",
            "description": ""
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "items",
          "next_cursor",
          "has_more",
          "request_id"
        ]
      },
      "Issue_a_management_keyResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "object",
            "properties": {
              "key_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "secret": {
                "type": "string"
              },
              "expires_at": {
                "type": [
                  "string",
                  "integer",
                  "null"
                ]
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "key_id",
              "name",
              "secret",
              "expires_at",
              "scopes"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "key",
          "request_id"
        ]
      },
      "Update_a_management_keyResponse": {
        "type": "object",
        "properties": {
          "key": {
            "type": "object",
            "properties": {
              "key_id": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": ""
              },
              "expires_at": {
                "type": [
                  "string",
                  "integer",
                  "null"
                ]
              },
              "status": {
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "",
            "required": [
              "key_id",
              "scopes",
              "expires_at",
              "status"
            ]
          },
          "request_id": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "description": "",
        "required": [
          "key",
          "request_id"
        ]
      }
    }
  }
}
