{
    "schemes": [],
    "swagger": "2.0",
    "info": {
        "description": "AI platform service API",
        "title": "CodeKriti AI API",
        "contact": {},
        "version": "1.0"
    },
    "host": "",
    "basePath": "",
    "paths": {
        "/audit": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Query tenant-scoped AI audit records",
                "parameters": [
                    {
                        "type": "string",
                        "description": "RFC3339 start timestamp",
                        "name": "from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "RFC3339 end timestamp",
                        "name": "to",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Caller module filter",
                        "name": "module",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Actor filter",
                        "name": "actor_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Request ID filter",
                        "name": "request_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Status filter",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Normalized error code filter",
                        "name": "error_code",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page limit, default 50, max 200",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque base64url cursor",
                        "name": "cursor",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIAuditListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/chat": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Run AI chat scaffold",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/embeddings": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Run embeddings scaffold",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/healthz": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "health"
                ],
                "summary": "Get health",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.HealthStatus"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/knowledge-bases/{id}/documents": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Ingest knowledge base document scaffold",
                "parameters": [
                    {
                        "type": "string",
                        "description": "id",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/rag-runs": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Run RAG scaffold",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/retrieval-runs": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Run retrieval scaffold",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/tool-calls": {
            "post": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Authorize AI tool call scaffold",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/usage": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Query tenant-scoped AI usage records",
                "parameters": [
                    {
                        "type": "string",
                        "description": "RFC3339 start timestamp",
                        "name": "from",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "RFC3339 end timestamp",
                        "name": "to",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Caller module filter",
                        "name": "module",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Provider filter",
                        "name": "provider",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Model filter",
                        "name": "model",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Status filter",
                        "name": "status",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page limit, default 50, max 200",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque base64url cursor",
                        "name": "cursor",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIUsageListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/document-acls": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-document-acls"
                ],
                "summary": "List ai-document-acls",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "created_by_actor_id",
                                "document_id",
                                "grantee_id",
                                "grantee_type",
                                "id",
                                "permission",
                                "tenant_id",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: created_by_actor_id, document_id, grantee_id, grantee_type, permission, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIDocumentACLListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/document-acls/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-document-acls"
                ],
                "summary": "Get ai-document-acl",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIDocumentACLResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/document-chunks": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-document-chunks"
                ],
                "summary": "List ai-document-chunks",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "chunk_index",
                                "content_hash",
                                "created_at",
                                "document_id",
                                "embedding_model_id",
                                "id",
                                "metadata",
                                "tenant_id",
                                "token_count",
                                "updated_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: chunk_index, content_hash, document_id, embedding_model_id, tenant_id, token_count",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIDocumentChunkListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/document-chunks/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-document-chunks"
                ],
                "summary": "Get ai-document-chunk",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIDocumentChunkResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/documents": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-documents"
                ],
                "summary": "List ai-documents",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "content_hash",
                                "created_at",
                                "id",
                                "knowledge_base_id",
                                "metadata",
                                "owner_actor_id",
                                "owner_module",
                                "source_ref",
                                "source_type",
                                "status",
                                "tenant_id",
                                "updated_at",
                                "visibility"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: content_hash, knowledge_base_id, owner_actor_id, owner_module, source_ref, source_type, status, tenant_id, visibility",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIDocumentListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/documents/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-documents"
                ],
                "summary": "Get ai-document",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIDocumentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/embedding-records": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-embeddings"
                ],
                "summary": "List ai-embeddings",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "content_hash",
                                "created_at",
                                "dimension",
                                "embedding_model_id",
                                "id",
                                "model_code",
                                "provider",
                                "status",
                                "tenant_id",
                                "tenant_scope_key",
                                "token_count",
                                "updated_at",
                                "vector_ref"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: content_hash, dimension, embedding_model_id, model_code, provider, status, tenant_id, tenant_scope_key, token_count, vector_ref",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIEmbeddingListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/embedding-records/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-embeddings"
                ],
                "summary": "Get ai-embedding",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIEmbeddingResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/knowledge-bases": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-knowledge-bases"
                ],
                "summary": "List ai-knowledge-bases",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "chunk_overlap",
                                "chunk_size",
                                "created_at",
                                "created_by_actor_id",
                                "deleted_at",
                                "embedding_model_id",
                                "id",
                                "name",
                                "owner_module",
                                "scope",
                                "status",
                                "tenant_id",
                                "updated_at",
                                "updated_by_actor_id"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: embedding_model_id, name, owner_module, scope, status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIKnowledgeBaseListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-knowledge-bases"
                ],
                "summary": "Create ai-knowledge-base",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIKnowledgeBaseCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIKnowledgeBaseResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/knowledge-bases/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-knowledge-bases"
                ],
                "summary": "Get ai-knowledge-base",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIKnowledgeBaseResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-knowledge-bases"
                ],
                "summary": "Update ai-knowledge-base",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIKnowledgeBaseUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIKnowledgeBaseResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-knowledge-bases"
                ],
                "summary": "Delete ai-knowledge-base",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-knowledge-bases"
                ],
                "summary": "Patch ai-knowledge-base",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIKnowledgeBasePatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIKnowledgeBaseResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/metadata": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai"
                ],
                "summary": "Get AI module metadata",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/models": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-models"
                ],
                "summary": "List ai-models",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "capabilities",
                                "context_window_tokens",
                                "created_at",
                                "created_by_actor_id",
                                "currency",
                                "deleted_at",
                                "display_name",
                                "id",
                                "input_token_cost",
                                "max_output_tokens",
                                "model_code",
                                "output_token_cost",
                                "provider_id",
                                "status",
                                "tenant_id",
                                "updated_at",
                                "updated_by_actor_id"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: currency, display_name, model_code, provider_id, status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIModelListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-models"
                ],
                "summary": "Create ai-model",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIModelCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIModelResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/models/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-models"
                ],
                "summary": "Get ai-model",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIModelResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-models"
                ],
                "summary": "Update ai-model",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIModelUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIModelResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-models"
                ],
                "summary": "Delete ai-model",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-models"
                ],
                "summary": "Patch ai-model",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIModelPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIModelResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/prompts": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompts"
                ],
                "summary": "List ai-prompts",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "created_at",
                                "created_by_actor_id",
                                "deleted_at",
                                "description",
                                "id",
                                "key",
                                "owner_module",
                                "purpose",
                                "status",
                                "tenant_id",
                                "updated_at",
                                "updated_by_actor_id",
                                "version_policy"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: key, owner_module, purpose, status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompts"
                ],
                "summary": "Create ai-prompt",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/prompts/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompts"
                ],
                "summary": "Get ai-prompt",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompts"
                ],
                "summary": "Update ai-prompt",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompts"
                ],
                "summary": "Delete ai-prompt",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompts"
                ],
                "summary": "Patch ai-prompt",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/prompts/{key}/versions": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompt-versions"
                ],
                "summary": "List ai-prompt-versions",
                "parameters": [
                    {
                        "type": "string",
                        "description": "key",
                        "name": "key",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "allow_extra_variables",
                                "approved_at",
                                "approved_by_actor_id",
                                "created_at",
                                "created_by_actor_id",
                                "deleted_at",
                                "id",
                                "output_schema",
                                "prompt_id",
                                "status",
                                "template",
                                "tenant_id",
                                "updated_at",
                                "updated_by_actor_id",
                                "variables_schema",
                                "version"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: prompt_id, status, tenant_id, version",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptVersionListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompt-versions"
                ],
                "summary": "Create ai-prompt-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "key",
                        "name": "key",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptVersionCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptVersionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/prompts/{key}/versions/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompt-versions"
                ],
                "summary": "Get ai-prompt-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "key",
                        "name": "key",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptVersionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompt-versions"
                ],
                "summary": "Update ai-prompt-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "key",
                        "name": "key",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptVersionUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptVersionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompt-versions"
                ],
                "summary": "Delete ai-prompt-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "key",
                        "name": "key",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-prompt-versions"
                ],
                "summary": "Patch ai-prompt-version",
                "parameters": [
                    {
                        "type": "string",
                        "description": "key",
                        "name": "key",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptVersionPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIPromptVersionResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/providers": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-providers"
                ],
                "summary": "List ai-providers",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "base_url",
                                "capabilities",
                                "code",
                                "created_at",
                                "created_by_actor_id",
                                "deleted_at",
                                "id",
                                "kind",
                                "metadata",
                                "name",
                                "status",
                                "tenant_id",
                                "updated_at",
                                "updated_by_actor_id"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: code, kind, name, status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIProviderListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-providers"
                ],
                "summary": "Create ai-provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIProviderCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIProviderResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/providers/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-providers"
                ],
                "summary": "Get ai-provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIProviderResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-providers"
                ],
                "summary": "Update ai-provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIProviderUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIProviderResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-providers"
                ],
                "summary": "Delete ai-provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-providers"
                ],
                "summary": "Patch ai-provider",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIProviderPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIProviderResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/safety-policies": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-safety-policies"
                ],
                "summary": "List ai-safety-policies",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "check_points",
                                "created_at",
                                "created_by_actor_id",
                                "default_outcome",
                                "deleted_at",
                                "id",
                                "name",
                                "owner_module",
                                "rules",
                                "status",
                                "tenant_id",
                                "updated_at",
                                "updated_by_actor_id"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: default_outcome, name, owner_module, status, tenant_id",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AISafetyPolicyListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-safety-policies"
                ],
                "summary": "Create ai-safety-policy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AISafetyPolicyCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AISafetyPolicyResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/safety-policies/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-safety-policies"
                ],
                "summary": "Get ai-safety-policy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AISafetyPolicyResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-safety-policies"
                ],
                "summary": "Update ai-safety-policy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AISafetyPolicyUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AISafetyPolicyResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-safety-policies"
                ],
                "summary": "Delete ai-safety-policy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-safety-policies"
                ],
                "summary": "Patch ai-safety-policy",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AISafetyPolicyPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AISafetyPolicyResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/tool-approvals": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tool-approvals"
                ],
                "summary": "List ai-tool-approvals",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "approval_ref",
                                "approved_by_actor_id",
                                "caller_module",
                                "created_at",
                                "created_by_actor_id",
                                "deleted_at",
                                "expires_at",
                                "id",
                                "status",
                                "tenant_id",
                                "tool_key",
                                "tool_version",
                                "updated_at",
                                "updated_by_actor_id",
                                "used_at"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: approval_ref, caller_module, status, tenant_id, tool_key, tool_version",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolApprovalListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tool-approvals"
                ],
                "summary": "Create ai-tool-approval",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolApprovalCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolApprovalResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/tool-approvals/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tool-approvals"
                ],
                "summary": "Get ai-tool-approval",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolApprovalResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tool-approvals"
                ],
                "summary": "Update ai-tool-approval",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolApprovalUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolApprovalResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tool-approvals"
                ],
                "summary": "Delete ai-tool-approval",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tool-approvals"
                ],
                "summary": "Patch ai-tool-approval",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolApprovalPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolApprovalResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/tools": {
            "get": {
                "description": "Query cost budget: max 250.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tools"
                ],
                "summary": "List ai-tools",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Limit",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Offset",
                        "name": "offset",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the next page",
                        "name": "after",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Opaque cursor for the previous page",
                        "name": "before",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include total count",
                        "name": "count",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "enum": [
                                "approval_required",
                                "created_at",
                                "created_by_actor_id",
                                "deleted_at",
                                "id",
                                "input_schema",
                                "key",
                                "output_schema",
                                "owner_module",
                                "permission",
                                "side_effect",
                                "status",
                                "tenant_id",
                                "updated_at",
                                "updated_by_actor_id",
                                "version"
                            ],
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Select fields",
                        "name": "fields",
                        "in": "query"
                    },
                    {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "collectionFormat": "multi",
                        "description": "Simple filters. Repeat for AND. Format: field:operator:value. Operators: eq, ne, gt, gte, lt, lte, like, in, is_null, not_null. Example: filter=status:eq:ACTIVE\u0026filter=role.name:eq:ADMIN. Filterable fields: key, owner_module, permission, side_effect, status, tenant_id, version",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Advanced filter expression. Example: (status='ACTIVE' OR status='PENDING') AND (role.name='ADMIN' OR role.name='MANAGER')",
                        "name": "q",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "Include soft-deleted records",
                        "name": "include_deleted",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolListResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tools"
                ],
                "summary": "Create ai-tool",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolCreateRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        },
        "/v1/ai/tools/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tools"
                ],
                "summary": "Get ai-tool",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tools"
                ],
                "summary": "Update ai-tool",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolUpdateRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tools"
                ],
                "summary": "Delete ai-tool",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ai-tools"
                ],
                "summary": "Patch ai-tool",
                "parameters": [
                    {
                        "type": "string",
                        "description": "ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "Tenant ID",
                        "name": "X-TENANT-ID",
                        "in": "header",
                        "required": true
                    },
                    {
                        "description": "Payload",
                        "name": "payload",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolPatchRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.AIToolResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorBody"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "handlers.AIAuditListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIAuditResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIAuditResponse": {
            "type": "object",
            "properties": {
                "actor_id": {
                    "type": "string"
                },
                "actor_type": {
                    "type": "string"
                },
                "caller_module": {
                    "type": "string"
                },
                "completed_at": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "error_code": {
                    "type": "string"
                },
                "input_hash": {
                    "type": "string"
                },
                "latency_ms": {
                    "type": "integer"
                },
                "model": {
                    "type": "string"
                },
                "output_hash": {
                    "type": "string"
                },
                "prompt_key": {
                    "type": "string"
                },
                "prompt_version_id": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "purpose": {
                    "type": "string"
                },
                "request_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "workflow": {
                    "type": "string"
                }
            }
        },
        "handlers.AIDocumentACLListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIDocumentACLResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIDocumentACLResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "document_id": {
                    "type": "string"
                },
                "grantee_id": {
                    "type": "string"
                },
                "grantee_type": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "permission": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AIDocumentChunkListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIDocumentChunkResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIDocumentChunkResponse": {
            "type": "object",
            "properties": {
                "chunk_index": {
                    "type": "integer"
                },
                "content_hash": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "document_id": {
                    "type": "string"
                },
                "embedding_model_id": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "tenant_id": {
                    "type": "string"
                },
                "token_count": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AIDocumentListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIDocumentResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIDocumentResponse": {
            "type": "object",
            "properties": {
                "content_hash": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "knowledge_base_id": {
                    "type": "string"
                },
                "metadata": {
                    "type": "object",
                    "additionalProperties": {}
                },
                "owner_actor_id": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "source_ref": {
                    "type": "string"
                },
                "source_type": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "visibility": {
                    "type": "string"
                }
            }
        },
        "handlers.AIEmbeddingListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIEmbeddingResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIEmbeddingResponse": {
            "type": "object",
            "properties": {
                "content_hash": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "dimension": {
                    "type": "integer"
                },
                "embedding_model_id": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "model_code": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "tenant_scope_key": {
                    "type": "string"
                },
                "token_count": {
                    "type": "integer"
                },
                "updated_at": {
                    "type": "string"
                },
                "vector_ref": {
                    "type": "string"
                }
            }
        },
        "handlers.AIKnowledgeBaseCreateRequest": {
            "type": "object",
            "required": [
                "embedding_model_id",
                "name",
                "owner_module"
            ],
            "properties": {
                "chunk_overlap": {
                    "type": "integer"
                },
                "chunk_size": {
                    "type": "integer"
                },
                "embedding_model_id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "scope": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIKnowledgeBaseListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIKnowledgeBaseResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIKnowledgeBasePatchRequest": {
            "type": "object",
            "properties": {
                "chunk_overlap": {
                    "type": "integer"
                },
                "chunk_size": {
                    "type": "integer"
                },
                "embedding_model_id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "scope": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIKnowledgeBaseResponse": {
            "type": "object",
            "properties": {
                "chunk_overlap": {
                    "type": "integer"
                },
                "chunk_size": {
                    "type": "integer"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "embedding_model_id": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "scope": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by_actor_id": {
                    "type": "string"
                }
            }
        },
        "handlers.AIKnowledgeBaseUpdateRequest": {
            "type": "object",
            "properties": {
                "chunk_overlap": {
                    "type": "integer"
                },
                "chunk_size": {
                    "type": "integer"
                },
                "embedding_model_id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "scope": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIModelCreateRequest": {
            "type": "object",
            "required": [
                "display_name",
                "model_code",
                "provider_id"
            ],
            "properties": {
                "capabilities": {
                    "type": "string"
                },
                "context_window_tokens": {
                    "type": "integer"
                },
                "currency": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "input_token_cost": {
                    "type": "number"
                },
                "max_output_tokens": {
                    "type": "integer"
                },
                "model_code": {
                    "type": "string"
                },
                "output_token_cost": {
                    "type": "number"
                },
                "provider_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIModelListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIModelResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIModelPatchRequest": {
            "type": "object",
            "properties": {
                "capabilities": {
                    "type": "string"
                },
                "context_window_tokens": {
                    "type": "integer"
                },
                "currency": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "input_token_cost": {
                    "type": "number"
                },
                "max_output_tokens": {
                    "type": "integer"
                },
                "model_code": {
                    "type": "string"
                },
                "output_token_cost": {
                    "type": "number"
                },
                "provider_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIModelResponse": {
            "type": "object",
            "properties": {
                "capabilities": {
                    "type": "string"
                },
                "context_window_tokens": {
                    "type": "integer"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "currency": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "input_token_cost": {
                    "type": "number"
                },
                "max_output_tokens": {
                    "type": "integer"
                },
                "model_code": {
                    "type": "string"
                },
                "output_token_cost": {
                    "type": "number"
                },
                "provider_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by_actor_id": {
                    "type": "string"
                }
            }
        },
        "handlers.AIModelUpdateRequest": {
            "type": "object",
            "properties": {
                "capabilities": {
                    "type": "string"
                },
                "context_window_tokens": {
                    "type": "integer"
                },
                "currency": {
                    "type": "string"
                },
                "display_name": {
                    "type": "string"
                },
                "input_token_cost": {
                    "type": "number"
                },
                "max_output_tokens": {
                    "type": "integer"
                },
                "model_code": {
                    "type": "string"
                },
                "output_token_cost": {
                    "type": "number"
                },
                "provider_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIPromptCreateRequest": {
            "type": "object",
            "required": [
                "key",
                "owner_module",
                "purpose"
            ],
            "properties": {
                "description": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "purpose": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "version_policy": {
                    "type": "string"
                }
            }
        },
        "handlers.AIPromptListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIPromptResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIPromptPatchRequest": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "purpose": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "version_policy": {
                    "type": "string"
                }
            }
        },
        "handlers.AIPromptResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "purpose": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by_actor_id": {
                    "type": "string"
                },
                "version_policy": {
                    "type": "string"
                }
            }
        },
        "handlers.AIPromptUpdateRequest": {
            "type": "object",
            "properties": {
                "description": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "purpose": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "version_policy": {
                    "type": "string"
                }
            }
        },
        "handlers.AIPromptVersionCreateRequest": {
            "type": "object",
            "required": [
                "prompt_id",
                "template",
                "version"
            ],
            "properties": {
                "allow_extra_variables": {
                    "type": "boolean"
                },
                "output_schema": {
                    "type": "string"
                },
                "prompt_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "template": {
                    "type": "string"
                },
                "variables_schema": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIPromptVersionListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIPromptVersionResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIPromptVersionPatchRequest": {
            "type": "object",
            "properties": {
                "allow_extra_variables": {
                    "type": "boolean"
                },
                "approved_at": {
                    "type": "string"
                },
                "approved_by_actor_id": {
                    "type": "string"
                },
                "output_schema": {
                    "type": "string"
                },
                "prompt_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "template": {
                    "type": "string"
                },
                "variables_schema": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIPromptVersionResponse": {
            "type": "object",
            "properties": {
                "allow_extra_variables": {
                    "type": "boolean"
                },
                "approved_at": {
                    "type": "string"
                },
                "approved_by_actor_id": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "output_schema": {
                    "type": "string"
                },
                "prompt_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "template": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by_actor_id": {
                    "type": "string"
                },
                "variables_schema": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIPromptVersionUpdateRequest": {
            "type": "object",
            "properties": {
                "allow_extra_variables": {
                    "type": "boolean"
                },
                "approved_at": {
                    "type": "string"
                },
                "approved_by_actor_id": {
                    "type": "string"
                },
                "output_schema": {
                    "type": "string"
                },
                "prompt_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "template": {
                    "type": "string"
                },
                "variables_schema": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIProviderCreateRequest": {
            "type": "object",
            "required": [
                "code",
                "kind",
                "name"
            ],
            "properties": {
                "base_url": {
                    "type": "string"
                },
                "capabilities": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "kind": {
                    "type": "string"
                },
                "metadata": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "secret_ref": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIProviderListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIProviderResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIProviderPatchRequest": {
            "type": "object",
            "properties": {
                "base_url": {
                    "type": "string"
                },
                "capabilities": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "kind": {
                    "type": "string"
                },
                "metadata": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "secret_ref": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIProviderResponse": {
            "type": "object",
            "properties": {
                "base_url": {
                    "type": "string"
                },
                "capabilities": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "kind": {
                    "type": "string"
                },
                "metadata": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by_actor_id": {
                    "type": "string"
                }
            }
        },
        "handlers.AIProviderUpdateRequest": {
            "type": "object",
            "properties": {
                "base_url": {
                    "type": "string"
                },
                "capabilities": {
                    "type": "string"
                },
                "code": {
                    "type": "string"
                },
                "kind": {
                    "type": "string"
                },
                "metadata": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "secret_ref": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AISafetyPolicyCreateRequest": {
            "type": "object",
            "required": [
                "name",
                "owner_module"
            ],
            "properties": {
                "check_points": {
                    "type": "string"
                },
                "default_outcome": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "rules": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AISafetyPolicyListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AISafetyPolicyResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AISafetyPolicyPatchRequest": {
            "type": "object",
            "properties": {
                "check_points": {
                    "type": "string"
                },
                "default_outcome": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "rules": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AISafetyPolicyResponse": {
            "type": "object",
            "properties": {
                "check_points": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "default_outcome": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "rules": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by_actor_id": {
                    "type": "string"
                }
            }
        },
        "handlers.AISafetyPolicyUpdateRequest": {
            "type": "object",
            "properties": {
                "check_points": {
                    "type": "string"
                },
                "default_outcome": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "rules": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                }
            }
        },
        "handlers.AIToolApprovalCreateRequest": {
            "type": "object",
            "required": [
                "approval_ref",
                "caller_module",
                "tool_key",
                "tool_version"
            ],
            "properties": {
                "approval_ref": {
                    "type": "string"
                },
                "approved_by_actor_id": {
                    "type": "string"
                },
                "caller_module": {
                    "type": "string"
                },
                "expires_at": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tool_key": {
                    "type": "string"
                },
                "tool_version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIToolApprovalListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIToolApprovalResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIToolApprovalPatchRequest": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string"
                },
                "used_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AIToolApprovalResponse": {
            "type": "object",
            "properties": {
                "approval_ref": {
                    "type": "string"
                },
                "approved_by_actor_id": {
                    "type": "string"
                },
                "caller_module": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "expires_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "tool_key": {
                    "type": "string"
                },
                "tool_version": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by_actor_id": {
                    "type": "string"
                },
                "used_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AIToolApprovalUpdateRequest": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string"
                },
                "used_at": {
                    "type": "string"
                }
            }
        },
        "handlers.AIToolCreateRequest": {
            "type": "object",
            "required": [
                "key",
                "owner_module",
                "permission",
                "version"
            ],
            "properties": {
                "approval_required": {
                    "type": "boolean"
                },
                "input_schema": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "output_schema": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "permission": {
                    "type": "string"
                },
                "side_effect": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIToolListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIToolResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIToolPatchRequest": {
            "type": "object",
            "properties": {
                "approval_required": {
                    "type": "boolean"
                },
                "input_schema": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "output_schema": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "permission": {
                    "type": "string"
                },
                "side_effect": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIToolResponse": {
            "type": "object",
            "properties": {
                "approval_required": {
                    "type": "boolean"
                },
                "created_at": {
                    "type": "string"
                },
                "created_by_actor_id": {
                    "type": "string"
                },
                "deleted_at": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "input_schema": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "output_schema": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "permission": {
                    "type": "string"
                },
                "side_effect": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                },
                "updated_at": {
                    "type": "string"
                },
                "updated_by_actor_id": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIToolUpdateRequest": {
            "type": "object",
            "properties": {
                "approval_required": {
                    "type": "boolean"
                },
                "input_schema": {
                    "type": "string"
                },
                "key": {
                    "type": "string"
                },
                "output_schema": {
                    "type": "string"
                },
                "owner_module": {
                    "type": "string"
                },
                "permission": {
                    "type": "string"
                },
                "side_effect": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "handlers.AIUsageListResponse": {
            "type": "object",
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.AIUsageResponse"
                    }
                },
                "limit": {
                    "type": "integer"
                },
                "next_cursor": {
                    "type": "string"
                },
                "offset": {
                    "type": "integer"
                }
            }
        },
        "handlers.AIUsageResponse": {
            "type": "object",
            "properties": {
                "caller_module": {
                    "type": "string"
                },
                "created_at": {
                    "type": "string"
                },
                "currency": {
                    "type": "string"
                },
                "embedding_tokens": {
                    "type": "integer"
                },
                "estimated_cost": {
                    "type": "number"
                },
                "input_tokens": {
                    "type": "integer"
                },
                "latency_ms": {
                    "type": "integer"
                },
                "model": {
                    "type": "string"
                },
                "output_tokens": {
                    "type": "integer"
                },
                "prompt_key": {
                    "type": "string"
                },
                "prompt_version_id": {
                    "type": "string"
                },
                "provider": {
                    "type": "string"
                },
                "request_id": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "string"
                }
            }
        },
        "handlers.ErrorBody": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "string"
                },
                "details": {},
                "message": {
                    "type": "string"
                },
                "request_id": {
                    "type": "string"
                }
            }
        },
        "handlers.HealthStatus": {
            "type": "object",
            "properties": {
                "checks": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "status": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "BearerAuth": {
            "description": "Bearer token",
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    }
}