{
    "openapi": "3.1.0",
    "info": {
        "title": "MATVIS API Documentation",
        "description": "Enterprise AI Security Platform - **Zero Trust for AI** -\nProtect your AI applications with real-time threat detection and automated security measures",
        "version": "1.29.0"
    },
    "paths": {
        "/api/v1/filter/inbound": {
            "post": {
                "tags": [
                    "Inbound / Outbound"
                ],
                "summary": "Validate inbound content (i.e., user input)",
                "description": "Scans and validates user input for security threats before processing by AI models.",
                "operationId": "validate_input_api_v1_filter_inbound_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/InboundFilterRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InboundFilterResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/filter/outbound": {
            "post": {
                "tags": [
                    "Inbound / Outbound"
                ],
                "summary": "Validate outbound content (i.e., LLM-response)",
                "description": "Scans and validates AI-generated responses for data leakage and policy violations before delivery to users.",
                "operationId": "validate_output_api_v1_filter_outbound_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/OutboundFilterRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OutboundFilterResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/models": {
            "get": {
                "tags": [
                    "Models"
                ],
                "summary": "List available models",
                "description": "Returns all AI models configured in the MATVIS system, across every configured provider, in OpenAI-compatible list format.",
                "operationId": "list_models_api_v1_models_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OpenAIModelEndpointResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/chat/completions": {
            "post": {
                "tags": [
                    "Proxy OpenAI"
                ],
                "summary": "Create chat completion",
                "description": "Creates a chat completion response using OpenAI-compatible format using the given Model configuration. Supports forwarding all provider parameters such as temperature, max_completion_tokens, streaming and so on.",
                "operationId": "chat_completions_api_v1_chat_completions_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ChatCompletionRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChatCompletionResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/messages": {
            "post": {
                "tags": [
                    "Proxy Anthropic"
                ],
                "summary": "Create a message (Anthropic-compatible)",
                "description": "Anthropic Messages API compatible endpoint. Designed as a base-URL drop-in replacement for https://api.anthropic.com/v1/messages. The request is mapped to the canonical format, filtered through the MATVIS AI firewall (inbound and outbound), forwarded to the configured LLM, and returned in Anthropic Messages shape. Supports streaming via server-sent events when stream=true.",
                "operationId": "messages_api_v1_messages_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AnthropicMessagesRequest"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AnthropicMessagesResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/config/firewall": {
            "get": {
                "tags": [
                    "Chat-Scan Configuration"
                ],
                "summary": "List firewall configs",
                "description": "Filter with `?name=` and/or `?type=inbound|outbound`. Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "list_firewall_api_v1_config_firewall_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Chat-Scan Configuration"
                ],
                "summary": "Create a firewall config",
                "description": "Create a firewall config (pick an inbound/outbound example below). Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "create_firewall_api_v1_config_firewall_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "examples": {
                                "Inbound": {
                                    "summary": "Inbound",
                                    "value": {
                                        "name": "prod-inbound",
                                        "type": "inbound",
                                        "language_filter_active": false,
                                        "language_filter_valids": [],
                                        "language_filter_min_block_severity": 5,
                                        "pii_filter_active": true,
                                        "pii_filter_config": [
                                            {
                                                "classes": "EMAIL_ADDRESS",
                                                "min_block_severity": 5
                                            }
                                        ],
                                        "prompt_injection_active": true,
                                        "prompt_injection_min_block_severity": 5,
                                        "prompt_injection_markup_filter": {
                                            "xml": false,
                                            "html": false,
                                            "sql": false,
                                            "json": false
                                        },
                                        "content_filter_active": false,
                                        "content_filter_config": [],
                                        "custom_regex": [],
                                        "pii_anonymization": false,
                                        "non_blocking": false
                                    }
                                },
                                "Outbound": {
                                    "summary": "Outbound",
                                    "value": {
                                        "name": "prod-outbound",
                                        "type": "outbound",
                                        "language_filter_active": false,
                                        "language_filter_valids": [],
                                        "language_filter_min_block_severity": 5,
                                        "pii_filter_active": true,
                                        "pii_filter_config": [
                                            {
                                                "classes": "EMAIL_ADDRESS",
                                                "min_block_severity": 5
                                            }
                                        ],
                                        "prompt_injection_active": false,
                                        "prompt_injection_min_block_severity": 5,
                                        "prompt_injection_markup_filter": {
                                            "xml": false,
                                            "html": false,
                                            "sql": false,
                                            "json": false
                                        },
                                        "content_filter_active": false,
                                        "content_filter_config": [],
                                        "custom_regex": [],
                                        "pii_anonymization": false,
                                        "non_blocking": false
                                    }
                                }
                            }
                        },
                        "application/yaml": {
                            "schema": {
                                "type": "string"
                            },
                            "examples": {
                                "Inbound": {
                                    "summary": "Inbound",
                                    "value": "name: prod-inbound\ntype: inbound\nlanguage_filter_active: false\nlanguage_filter_valids: []\nlanguage_filter_min_block_severity: 5\npii_filter_active: true\npii_filter_config:\n- classes: EMAIL_ADDRESS\n  min_block_severity: 5\nprompt_injection_active: true\nprompt_injection_min_block_severity: 5\nprompt_injection_markup_filter:\n  xml: false\n  html: false\n  sql: false\n  json: false\ncontent_filter_active: false\ncontent_filter_config: []\ncustom_regex: []\npii_anonymization: false\nnon_blocking: false\n"
                                },
                                "Outbound": {
                                    "summary": "Outbound",
                                    "value": "name: prod-outbound\ntype: outbound\nlanguage_filter_active: false\nlanguage_filter_valids: []\nlanguage_filter_min_block_severity: 5\npii_filter_active: true\npii_filter_config:\n- classes: EMAIL_ADDRESS\n  min_block_severity: 5\nprompt_injection_active: false\nprompt_injection_min_block_severity: 5\nprompt_injection_markup_filter:\n  xml: false\n  html: false\n  sql: false\n  json: false\ncontent_filter_active: false\ncontent_filter_config: []\ncustom_regex: []\npii_anonymization: false\nnon_blocking: false\n"
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/config/firewall/{uuid}": {
            "get": {
                "tags": [
                    "Chat-Scan Configuration"
                ],
                "summary": "Get a firewall config",
                "description": "Get one firewall config by uuid. Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "get_firewall_api_v1_config_firewall__uuid__get",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Chat-Scan Configuration"
                ],
                "summary": "Update a firewall config",
                "description": "Replace a firewall config by uuid (pick an inbound/outbound example below). Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "update_firewall_api_v1_config_firewall__uuid__put",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "examples": {
                                "Inbound": {
                                    "summary": "Inbound",
                                    "value": {
                                        "name": "prod-inbound",
                                        "type": "inbound",
                                        "language_filter_active": false,
                                        "language_filter_valids": [],
                                        "language_filter_min_block_severity": 5,
                                        "pii_filter_active": true,
                                        "pii_filter_config": [
                                            {
                                                "classes": "EMAIL_ADDRESS",
                                                "min_block_severity": 5
                                            }
                                        ],
                                        "prompt_injection_active": true,
                                        "prompt_injection_min_block_severity": 5,
                                        "prompt_injection_markup_filter": {
                                            "xml": false,
                                            "html": false,
                                            "sql": false,
                                            "json": false
                                        },
                                        "content_filter_active": false,
                                        "content_filter_config": [],
                                        "custom_regex": [],
                                        "pii_anonymization": false,
                                        "non_blocking": false
                                    }
                                },
                                "Outbound": {
                                    "summary": "Outbound",
                                    "value": {
                                        "name": "prod-outbound",
                                        "type": "outbound",
                                        "language_filter_active": false,
                                        "language_filter_valids": [],
                                        "language_filter_min_block_severity": 5,
                                        "pii_filter_active": true,
                                        "pii_filter_config": [
                                            {
                                                "classes": "EMAIL_ADDRESS",
                                                "min_block_severity": 5
                                            }
                                        ],
                                        "prompt_injection_active": false,
                                        "prompt_injection_min_block_severity": 5,
                                        "prompt_injection_markup_filter": {
                                            "xml": false,
                                            "html": false,
                                            "sql": false,
                                            "json": false
                                        },
                                        "content_filter_active": false,
                                        "content_filter_config": [],
                                        "custom_regex": [],
                                        "pii_anonymization": false,
                                        "non_blocking": false
                                    }
                                }
                            }
                        },
                        "application/yaml": {
                            "schema": {
                                "type": "string"
                            },
                            "examples": {
                                "Inbound": {
                                    "summary": "Inbound",
                                    "value": "name: prod-inbound\ntype: inbound\nlanguage_filter_active: false\nlanguage_filter_valids: []\nlanguage_filter_min_block_severity: 5\npii_filter_active: true\npii_filter_config:\n- classes: EMAIL_ADDRESS\n  min_block_severity: 5\nprompt_injection_active: true\nprompt_injection_min_block_severity: 5\nprompt_injection_markup_filter:\n  xml: false\n  html: false\n  sql: false\n  json: false\ncontent_filter_active: false\ncontent_filter_config: []\ncustom_regex: []\npii_anonymization: false\nnon_blocking: false\n"
                                },
                                "Outbound": {
                                    "summary": "Outbound",
                                    "value": "name: prod-outbound\ntype: outbound\nlanguage_filter_active: false\nlanguage_filter_valids: []\nlanguage_filter_min_block_severity: 5\npii_filter_active: true\npii_filter_config:\n- classes: EMAIL_ADDRESS\n  min_block_severity: 5\nprompt_injection_active: false\nprompt_injection_min_block_severity: 5\nprompt_injection_markup_filter:\n  xml: false\n  html: false\n  sql: false\n  json: false\ncontent_filter_active: false\ncontent_filter_config: []\ncustom_regex: []\npii_anonymization: false\nnon_blocking: false\n"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Chat-Scan Configuration"
                ],
                "summary": "Delete a firewall config",
                "description": "Delete a firewall config by uuid.",
                "operationId": "delete_firewall_api_v1_config_firewall__uuid__delete",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/config/tool-scan": {
            "get": {
                "tags": [
                    "Tool-Scan Configuration"
                ],
                "summary": "List tool-scan configs",
                "description": "Filter with `?name=` and/or `?type=tool_call|tool_response`. Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "list_tool_scan_api_v1_config_tool_scan_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Tool-Scan Configuration"
                ],
                "summary": "Create a tool-scan config",
                "description": "Create a tool-scan config (pick a tool_call/tool_response example below). Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "create_tool_scan_api_v1_config_tool_scan_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "examples": {
                                "Tool call": {
                                    "summary": "Tool call",
                                    "value": {
                                        "name": "prod-tool-calls",
                                        "type": "tool_call",
                                        "tools": [
                                            {
                                                "name": "get_weather",
                                                "active": true,
                                                "tool_usage": "allowed",
                                                "pattern_rules": []
                                            }
                                        ],
                                        "non_blocking": false
                                    }
                                },
                                "Tool response": {
                                    "summary": "Tool response",
                                    "value": {
                                        "name": "prod-tool-responses",
                                        "type": "tool_response",
                                        "pattern_rules": [
                                            {
                                                "regex": "(?i)confidential",
                                                "rule": "deny"
                                            }
                                        ],
                                        "non_blocking": false
                                    }
                                }
                            }
                        },
                        "application/yaml": {
                            "schema": {
                                "type": "string"
                            },
                            "examples": {
                                "Tool call": {
                                    "summary": "Tool call",
                                    "value": "name: prod-tool-calls\ntype: tool_call\ntools:\n- name: get_weather\n  active: true\n  tool_usage: allowed\n  pattern_rules: []\nnon_blocking: false\n"
                                },
                                "Tool response": {
                                    "summary": "Tool response",
                                    "value": "name: prod-tool-responses\ntype: tool_response\npattern_rules:\n- regex: (?i)confidential\n  rule: deny\nnon_blocking: false\n"
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/config/tool-scan/{uuid}": {
            "get": {
                "tags": [
                    "Tool-Scan Configuration"
                ],
                "summary": "Get a tool-scan config",
                "description": "Get one tool-scan config by uuid. Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "get_tool_scan_api_v1_config_tool_scan__uuid__get",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Tool-Scan Configuration"
                ],
                "summary": "Update a tool-scan config",
                "description": "Replace a tool-scan config by uuid (pick a tool_call/tool_response example below). Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "update_tool_scan_api_v1_config_tool_scan__uuid__put",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "examples": {
                                "Tool call": {
                                    "summary": "Tool call",
                                    "value": {
                                        "name": "prod-tool-calls",
                                        "type": "tool_call",
                                        "tools": [
                                            {
                                                "name": "get_weather",
                                                "active": true,
                                                "tool_usage": "allowed",
                                                "pattern_rules": []
                                            }
                                        ],
                                        "non_blocking": false
                                    }
                                },
                                "Tool response": {
                                    "summary": "Tool response",
                                    "value": {
                                        "name": "prod-tool-responses",
                                        "type": "tool_response",
                                        "pattern_rules": [
                                            {
                                                "regex": "(?i)confidential",
                                                "rule": "deny"
                                            }
                                        ],
                                        "non_blocking": false
                                    }
                                }
                            }
                        },
                        "application/yaml": {
                            "schema": {
                                "type": "string"
                            },
                            "examples": {
                                "Tool call": {
                                    "summary": "Tool call",
                                    "value": "name: prod-tool-calls\ntype: tool_call\ntools:\n- name: get_weather\n  active: true\n  tool_usage: allowed\n  pattern_rules: []\nnon_blocking: false\n"
                                },
                                "Tool response": {
                                    "summary": "Tool response",
                                    "value": "name: prod-tool-responses\ntype: tool_response\npattern_rules:\n- regex: (?i)confidential\n  rule: deny\nnon_blocking: false\n"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Tool-Scan Configuration"
                ],
                "summary": "Delete a tool-scan config",
                "description": "Delete a tool-scan config by uuid.",
                "operationId": "delete_tool_scan_api_v1_config_tool_scan__uuid__delete",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/config/model": {
            "get": {
                "tags": [
                    "Model Configuration"
                ],
                "summary": "List model configs",
                "description": "Filter with `?name=`. Provider secrets are masked (write-only). Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "list_model_api_v1_config_model_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Model Configuration"
                ],
                "summary": "Create a model config",
                "description": "Create/replace a model binding. The `config` shape is provider-specific; pick a provider example below (openai, azureopenai, anthropic, ollama). `firewall_*` fields reference firewall/tool-scan configs by uuid. Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "create_model_api_v1_config_model_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "examples": {
                                "OpenAI": {
                                    "summary": "OpenAI",
                                    "value": {
                                        "name": "gpt-4o-prod",
                                        "provider": "openai",
                                        "config": {
                                            "api_key": "sk-...",
                                            "chat_model": "gpt-4o"
                                        }
                                    }
                                },
                                "Azure OpenAI": {
                                    "summary": "Azure OpenAI",
                                    "value": {
                                        "name": "azure-gpt4o",
                                        "provider": "azureopenai",
                                        "config": {
                                            "azure_service_endpoint": "https://my-resource.openai.azure.com",
                                            "api_key": "...",
                                            "chat_deployment_name": "gpt-4o",
                                            "chat_model_token_limit": 128000,
                                            "model_type": "default"
                                        }
                                    }
                                },
                                "Anthropic": {
                                    "summary": "Anthropic",
                                    "value": {
                                        "name": "claude-prod",
                                        "provider": "anthropic",
                                        "config": {
                                            "api_key": "sk-ant-...",
                                            "chat_model": "claude-sonnet-5"
                                        }
                                    }
                                },
                                "Generic OpenAI": {
                                    "summary": "Generic OpenAI",
                                    "value": {
                                        "name": "ollama-local",
                                        "provider": "ollama",
                                        "config": {
                                            "url": "http://ollama:11434",
                                            "model": "llama3.1"
                                        }
                                    }
                                }
                            }
                        },
                        "application/yaml": {
                            "schema": {
                                "type": "string"
                            },
                            "examples": {
                                "OpenAI": {
                                    "summary": "OpenAI",
                                    "value": "name: gpt-4o-prod\nprovider: openai\nconfig:\n  api_key: sk-...\n  chat_model: gpt-4o\nfirewall_inbound: null\nfirewall_outbound: null\nfirewall_tool_inbound: null\nfirewall_tool_outbound: null\n"
                                },
                                "Azure OpenAI": {
                                    "summary": "Azure OpenAI",
                                    "value": "name: azure-gpt4o\nprovider: azureopenai\nconfig:\n  azure_service_endpoint: https://my-resource.openai.azure.com\n  api_key: '...'\n  chat_deployment_name: gpt-4o\n  chat_model_token_limit: 128000\n  model_type: default\nfirewall_inbound: null\nfirewall_outbound: null\nfirewall_tool_inbound: null\nfirewall_tool_outbound: null\n"
                                },
                                "Anthropic": {
                                    "summary": "Anthropic",
                                    "value": "name: claude-prod\nprovider: anthropic\nconfig:\n  api_key: sk-ant-...\n  chat_model: claude-sonnet-5\nfirewall_inbound: null\nfirewall_outbound: null\nfirewall_tool_inbound: null\nfirewall_tool_outbound: null\n"
                                },
                                "Generic OpenAI": {
                                    "summary": "Generic OpenAI",
                                    "value": "name: ollama-local\nprovider: ollama\nconfig:\n  url: http://ollama:11434\n  model: llama3.1\n  auth_token: null\nfirewall_inbound: null\nfirewall_outbound: null\nfirewall_tool_inbound: null\nfirewall_tool_outbound: null\n"
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/config/model/{uuid}": {
            "get": {
                "tags": [
                    "Model Configuration"
                ],
                "summary": "Get a model config",
                "description": "Get one model config by uuid. Provider secrets are masked (write-only). Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "get_model_api_v1_config_model__uuid__get",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Model Configuration"
                ],
                "summary": "Update a model config",
                "description": "Create/replace a model binding. The `config` shape is provider-specific; pick a provider example below (openai, azureopenai, anthropic, ollama). `firewall_*` fields reference firewall/tool-scan configs by uuid. Body is data-api's schema; send JSON (default) or YAML (`Content-Type: application/yaml`). Set `Accept: application/yaml` for a YAML response. GET a resource to see its full shape.",
                "operationId": "update_model_api_v1_config_model__uuid__put",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "examples": {
                                "OpenAI": {
                                    "summary": "OpenAI",
                                    "value": {
                                        "name": "gpt-4o-prod",
                                        "provider": "openai",
                                        "config": {
                                            "api_key": "sk-...",
                                            "chat_model": "gpt-4o"
                                        }
                                    }
                                },
                                "Azure OpenAI": {
                                    "summary": "Azure OpenAI",
                                    "value": {
                                        "name": "azure-gpt4o",
                                        "provider": "azureopenai",
                                        "config": {
                                            "azure_service_endpoint": "https://my-resource.openai.azure.com",
                                            "api_key": "...",
                                            "chat_deployment_name": "gpt-4o",
                                            "chat_model_token_limit": 128000,
                                            "model_type": "default"
                                        }
                                    }
                                },
                                "Anthropic": {
                                    "summary": "Anthropic",
                                    "value": {
                                        "name": "claude-prod",
                                        "provider": "anthropic",
                                        "config": {
                                            "api_key": "sk-ant-...",
                                            "chat_model": "claude-sonnet-5"
                                        }
                                    }
                                },
                                "Generic OpenAI": {
                                    "summary": "Generic OpenAI",
                                    "value": {
                                        "name": "ollama-local",
                                        "provider": "ollama",
                                        "config": {
                                            "url": "http://ollama:11434",
                                            "model": "llama3.1"
                                        }
                                    }
                                }
                            }
                        },
                        "application/yaml": {
                            "schema": {
                                "type": "string"
                            },
                            "examples": {
                                "OpenAI": {
                                    "summary": "OpenAI",
                                    "value": "name: gpt-4o-prod\nprovider: openai\nconfig:\n  api_key: sk-...\n  chat_model: gpt-4o\nfirewall_inbound: null\nfirewall_outbound: null\nfirewall_tool_inbound: null\nfirewall_tool_outbound: null\n"
                                },
                                "Azure OpenAI": {
                                    "summary": "Azure OpenAI",
                                    "value": "name: azure-gpt4o\nprovider: azureopenai\nconfig:\n  azure_service_endpoint: https://my-resource.openai.azure.com\n  api_key: '...'\n  chat_deployment_name: gpt-4o\n  chat_model_token_limit: 128000\n  model_type: default\nfirewall_inbound: null\nfirewall_outbound: null\nfirewall_tool_inbound: null\nfirewall_tool_outbound: null\n"
                                },
                                "Anthropic": {
                                    "summary": "Anthropic",
                                    "value": "name: claude-prod\nprovider: anthropic\nconfig:\n  api_key: sk-ant-...\n  chat_model: claude-sonnet-5\nfirewall_inbound: null\nfirewall_outbound: null\nfirewall_tool_inbound: null\nfirewall_tool_outbound: null\n"
                                },
                                "Generic OpenAI": {
                                    "summary": "Generic OpenAI",
                                    "value": "name: ollama-local\nprovider: ollama\nconfig:\n  url: http://ollama:11434\n  model: llama3.1\n  auth_token: null\nfirewall_inbound: null\nfirewall_outbound: null\nfirewall_tool_inbound: null\nfirewall_tool_outbound: null\n"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Model Configuration"
                ],
                "summary": "Delete a model config",
                "description": "Delete a model config by uuid.",
                "operationId": "delete_model_api_v1_config_model__uuid__delete",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/config/firewall/insights/{direction}/records": {
            "get": {
                "tags": [
                    "Firewall Insights"
                ],
                "summary": "List firewall insight records",
                "description": "Firewall event records for a direction. Every filter is optional and combines with AND, so a call with no query returns every record for the direction. Time: `start_time`, `end_time`. Verdict: `valid`, `action` (`allow`/`block`), `monitoring`, `handling` (repeatable, matches a record carrying any given value), `block_reason`. Severity: `severity_level_min`/`severity_level_max` bound the 0-10 rung, `severity_min`/`severity_max` bound the 0-1 score, independently of each other. Also `config`, `source` (`chat`/`tool`). Order: `sort_by`, `sort_dir` (`asc`/`desc`, default `timestamp` `desc`). Size: `limit` caps how many records are returned. Any other query parameter is rejected rather than ignored, so a result always reflects exactly the filters and ordering asked for. Set `Accept: application/yaml` for YAML.",
                "operationId": "firewall_insight_records_api_v1_config_firewall_insights__direction__records_get",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "direction",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "title": "Direction"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/policy-as-code/apply": {
            "post": {
                "tags": [
                    "Policy as Code (experimental)"
                ],
                "summary": "Apply the desired firewall configuration (experimental)",
                "description": "EXPERIMENTAL / PoC - the document schema mirrors data-api and may change. Reconcile a declarative document (JSON or YAML) against data-api. Resources are identified by natural key: firewall/tool-scan by (name, type), models by name; model bindings reference firewall/tool-scan configs by NAME. Each firewall/tool-scan/model entry must be the COMPLETE data-api config (the same filter fields the frontend sends); created_at is server-managed and must not be supplied. Partial configs are rejected by data-api on apply.",
                "operationId": "apply_api_v1_policy_as_code_apply_post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "example": {
                                "apiVersion": "matvis/v1",
                                "prune": false,
                                "firewallConfigs": [
                                    {
                                        "name": "prod-inbound",
                                        "type": "inbound",
                                        "language_filter_active": false,
                                        "language_filter_valids": [],
                                        "language_filter_min_block_severity": 5,
                                        "pii_filter_active": true,
                                        "pii_filter_config": [
                                            {
                                                "classes": "EMAIL_ADDRESS",
                                                "min_block_severity": 5
                                            }
                                        ],
                                        "prompt_injection_active": true,
                                        "prompt_injection_min_block_severity": 5,
                                        "prompt_injection_markup_filter": {
                                            "xml": false,
                                            "html": false,
                                            "sql": false,
                                            "json": false
                                        },
                                        "content_filter_active": false,
                                        "content_filter_config": [],
                                        "custom_regex": [],
                                        "pii_anonymization": false,
                                        "non_blocking": false
                                    }
                                ],
                                "toolScanConfigs": [],
                                "modelBindings": []
                            }
                        },
                        "application/yaml": {
                            "schema": {
                                "type": "string"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                },
                "security": [
                    {
                        "Authorization": []
                    }
                ]
            }
        },
        "/api/v1/policy-as-code/export": {
            "get": {
                "tags": [
                    "Policy as Code (experimental)"
                ],
                "summary": "Export the current configuration as a policy-as-code document (experimental)",
                "description": "Dumps the current firewall / tool-scan / model configuration as a policy-as-code document (the same shape /apply accepts). Server-managed fields (uuid, created_at, ...) are stripped and model references are by name. Provider SECRETS are redacted to 'REDACTED' - re-supply them before feeding an exported document with model bindings back to /apply. Use ?format=yaml for YAML output (default JSON).",
                "operationId": "export_api_v1_policy_as_code_export_get",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "json",
                            "title": "Format"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/filter/session/{session_id}": {
            "delete": {
                "tags": [
                    "Beta"
                ],
                "summary": "Beta: end a filter session",
                "description": "Beta: drops the session's PII mapping and its open stream. Text already scanned in an open stream is recorded; the rest is discarded unscanned. Answers 204 whether or not the session existed; 403 when another API key opened it.",
                "operationId": "delete_session_api_v1_filter_session__session_id__delete",
                "security": [
                    {
                        "Authorization": []
                    }
                ],
                "parameters": [
                    {
                        "name": "session_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 128,
                            "pattern": "^[A-Za-z0-9._:-]+$",
                            "title": "Session Id"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Successful Response"
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/icap/health": {
            "get": {
                "tags": [
                    "ICAP"
                ],
                "summary": "ICAP server health",
                "description": "Liveness/state of the embedded ICAP server. Only present when ICAP is enabled.",
                "operationId": "icap_health_api_v1_icap_health_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "AnthropicMessage": {
                "properties": {
                    "role": {
                        "type": "string",
                        "enum": [
                            "user",
                            "assistant"
                        ],
                        "title": "Role",
                        "description": "The role of the message author"
                    },
                    "content": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "items": {
                                    "additionalProperties": true,
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            {}
                        ],
                        "title": "Content",
                        "description": "Message content: a plain string or a list of Anthropic content blocks (text, tool_use, tool_result)"
                    }
                },
                "additionalProperties": true,
                "type": "object",
                "required": [
                    "role",
                    "content"
                ],
                "title": "AnthropicMessage"
            },
            "AnthropicMessagesRequest": {
                "properties": {
                    "model": {
                        "type": "string",
                        "title": "Model",
                        "description": "The name of the Model configuration to use as defined in the MATVIS frontend",
                        "example": "SafeModel"
                    },
                    "messages": {
                        "items": {
                            "$ref": "#/components/schemas/AnthropicMessage"
                        },
                        "type": "array",
                        "title": "Messages",
                        "description": "The conversation history in Anthropic Messages format"
                    },
                    "max_tokens": {
                        "type": "integer",
                        "title": "Max Tokens",
                        "description": "The maximum number of tokens to generate before stopping",
                        "example": 1024
                    },
                    "system": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "items": {
                                    "additionalProperties": true,
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "System",
                        "description": "A system prompt: a plain string or a list of text content blocks"
                    },
                    "stream": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stream",
                        "description": "Whether to stream the response using server-sent events",
                        "default": false
                    }
                },
                "additionalProperties": true,
                "type": "object",
                "required": [
                    "model",
                    "messages",
                    "max_tokens"
                ],
                "title": "AnthropicMessagesRequest",
                "example": {
                    "max_tokens": 1024,
                    "messages": [
                        {
                            "content": "Tell me about life in one sentence.",
                            "role": "user"
                        }
                    ],
                    "model": "SafeModel",
                    "stream": false
                }
            },
            "AnthropicMessagesResponse": {
                "properties": {
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "type": {
                        "type": "string",
                        "title": "Type",
                        "default": "message"
                    },
                    "role": {
                        "type": "string",
                        "title": "Role",
                        "default": "assistant"
                    },
                    "model": {
                        "type": "string",
                        "title": "Model"
                    },
                    "content": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Content"
                    },
                    "stop_reason": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stop Reason"
                    },
                    "stop_sequence": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stop Sequence"
                    },
                    "usage": {
                        "additionalProperties": true,
                        "type": "object",
                        "title": "Usage"
                    }
                },
                "additionalProperties": true,
                "type": "object",
                "required": [
                    "id",
                    "model",
                    "content",
                    "usage"
                ],
                "title": "AnthropicMessagesResponse",
                "example": {
                    "content": [
                        {
                            "text": "Life is a brief, ever-shifting journey.",
                            "type": "text"
                        }
                    ],
                    "id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
                    "model": "SafeModel",
                    "role": "assistant",
                    "stop_reason": "end_turn",
                    "type": "message",
                    "usage": {
                        "input_tokens": 12,
                        "output_tokens": 18
                    }
                }
            },
            "ChatCompletionRequest": {
                "properties": {
                    "model": {
                        "type": "string",
                        "title": "Model",
                        "description": "The name of the Model configuration to use for the chat completion as defined in the MATVIS frontend",
                        "example": "SafeModel"
                    },
                    "messages": {
                        "items": {
                            "$ref": "#/components/schemas/ChatMessage"
                        },
                        "type": "array",
                        "title": "Messages",
                        "description": "A list of messages of the conversation so far",
                        "example": [
                            {
                                "content": "You are a helpful assistant.",
                                "role": "system"
                            },
                            {
                                "content": "Hello, how are you?",
                                "role": "user"
                            }
                        ]
                    }
                },
                "additionalProperties": true,
                "type": "object",
                "required": [
                    "model",
                    "messages"
                ],
                "title": "ChatCompletionRequest",
                "example": {
                    "messages": [
                        {
                            "content": "Tell me about life in one sentence.",
                            "role": "user"
                        }
                    ],
                    "model": "ollama-gpt-oss",
                    "stream": false,
                    "temperature": 1
                }
            },
            "ChatCompletionResponse": {
                "properties": {
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "model": {
                        "type": "string",
                        "title": "Model"
                    },
                    "choices": {
                        "items": {
                            "additionalProperties": true,
                            "type": "object"
                        },
                        "type": "array",
                        "title": "Choices"
                    }
                },
                "type": "object",
                "required": [
                    "id",
                    "model",
                    "choices"
                ],
                "title": "ChatCompletionResponse",
                "example": {
                    "choices": [
                        {
                            "finish_reason": "stop",
                            "index": 0,
                            "message": {
                                "annotations": [],
                                "content": "Life is a brief, ever-shifting journey of choices, growth, and connection that unfolds in quiet wonder and sudden surprise.",
                                "role": "assistant"
                            }
                        }
                    ],
                    "id": "chatcmpl-231",
                    "model": "ollama-gpt-oss"
                }
            },
            "ChatMessage": {
                "properties": {
                    "role": {
                        "type": "string",
                        "enum": [
                            "system",
                            "user",
                            "assistant",
                            "tool"
                        ],
                        "title": "Role",
                        "description": "The role of the message author"
                    },
                    "content": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "items": {
                                    "anyOf": [
                                        {
                                            "$ref": "#/components/schemas/ChatMessageExtraTextContent"
                                        },
                                        {
                                            "$ref": "#/components/schemas/ChatMessageImageContent"
                                        }
                                    ]
                                },
                                "type": "array"
                            },
                            {},
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Content",
                        "description": "The message content - can be text string, list of content blocks, or null for tool_calls messages"
                    }
                },
                "additionalProperties": true,
                "type": "object",
                "required": [
                    "role"
                ],
                "title": "ChatMessage"
            },
            "ChatMessageExtraTextContent": {
                "properties": {
                    "type": {
                        "type": "string",
                        "const": "text",
                        "title": "Type"
                    },
                    "text": {
                        "type": "string",
                        "title": "Text"
                    }
                },
                "type": "object",
                "required": [
                    "type",
                    "text"
                ],
                "title": "ChatMessageExtraTextContent"
            },
            "ChatMessageImageContent": {
                "properties": {
                    "type": {
                        "type": "string",
                        "const": "image_url",
                        "title": "Type"
                    },
                    "image_url": {
                        "$ref": "#/components/schemas/ChatMessageImageUrl"
                    }
                },
                "type": "object",
                "required": [
                    "type",
                    "image_url"
                ],
                "title": "ChatMessageImageContent"
            },
            "ChatMessageImageUrl": {
                "properties": {
                    "url": {
                        "type": "string",
                        "title": "Url"
                    }
                },
                "type": "object",
                "required": [
                    "url"
                ],
                "title": "ChatMessageImageUrl"
            },
            "FilterResponseDetails": {
                "properties": {
                    "valid": {
                        "type": "boolean",
                        "title": "Valid"
                    },
                    "score": {
                        "type": "number",
                        "title": "Score"
                    },
                    "monitoring_mode": {
                        "type": "boolean",
                        "title": "Monitoring Mode",
                        "description": "True when this filter's configuration is in Monitoring (non-blocking) mode, so its detections are recorded but not enforced.",
                        "default": false
                    },
                    "severity_level": {
                        "anyOf": [
                            {
                                "type": "integer",
                                "maximum": 10.0,
                                "minimum": 0.0
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Severity Level",
                        "default": 0
                    },
                    "details": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Details"
                    }
                },
                "type": "object",
                "required": [
                    "valid",
                    "score"
                ],
                "title": "FilterResponseDetails"
            },
            "FilterResponseResult": {
                "properties": {
                    "valid": {
                        "type": "boolean",
                        "title": "Valid",
                        "default": true
                    },
                    "block_reason": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Block Reason"
                    },
                    "severity": {
                        "type": "number",
                        "title": "Severity",
                        "default": 0.13
                    },
                    "severity_level": {
                        "anyOf": [
                            {
                                "type": "integer",
                                "maximum": 10.0,
                                "minimum": 0.0
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Severity Level",
                        "default": 0
                    },
                    "block_message": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Block Message"
                    },
                    "action": {
                        "type": "string",
                        "enum": [
                            "allow",
                            "block"
                        ],
                        "title": "Action",
                        "description": "What to do with this request: `block` to reject it, `allow` to let it through. Already accounts for monitoring mode, so no further logic is needed.",
                        "default": "allow"
                    },
                    "monitoring_mode": {
                        "type": "boolean",
                        "title": "Monitoring Mode",
                        "description": "True when the firewall configuration is in Monitoring (non-blocking) mode.",
                        "default": false
                    },
                    "modified": {
                        "type": "boolean",
                        "title": "Modified",
                        "description": "True when the payload was rewritten. Forward `content_modified` instead.",
                        "default": false
                    },
                    "handling": {
                        "items": {
                            "type": "string",
                            "enum": [
                                "pseudonymized",
                                "bypassed",
                                "allowlisted"
                            ]
                        },
                        "type": "array",
                        "title": "Handling",
                        "description": "How detections were handled. May contain several values: `pseudonymized` (PII masked), `bypassed` (prompt-injection bypass tag matched), `allowlisted` (matched an allowlist). Empty when nothing was handled."
                    },
                    "source": {
                        "anyOf": [
                            {
                                "type": "string",
                                "enum": [
                                    "chat",
                                    "tool"
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Source",
                        "description": "Which scan produced `block_reason`: `chat` for the content scan, `tool` for the tool-call or tool-response scan. Null when `valid` is true."
                    },
                    "highest_severity_filter": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Highest Severity Filter",
                        "description": "The filter with the most severe detection, whether or not it was enforced. Names a key in `filters`. Null when nothing was detected."
                    }
                },
                "type": "object",
                "title": "FilterResponseResult"
            },
            "HTTPValidationError": {
                "properties": {
                    "detail": {
                        "items": {
                            "$ref": "#/components/schemas/ValidationError"
                        },
                        "type": "array",
                        "title": "Detail"
                    }
                },
                "type": "object",
                "title": "HTTPValidationError"
            },
            "InboundFilterRequest": {
                "properties": {
                    "ip_address": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ip Address"
                    },
                    "config_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Config Id",
                        "description": "The UUID of the firewall configuration to use for validation"
                    },
                    "content": {
                        "anyOf": [
                            {
                                "type": "string",
                                "minLength": 1
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Content",
                        "description": "The user input content to validate"
                    },
                    "tool_response": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ToolResponseInput"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Tool response (result) to scan before sending back to the LLM \u2014 accepts OpenAI (tool_call_id) or Anthropic (tool_use_id) format"
                    },
                    "tool_config_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Tool Config Id",
                        "description": "UUID of the tool_response scan configuration to use when scanning a tool response"
                    },
                    "session_id": {
                        "anyOf": [
                            {
                                "type": "string",
                                "maxLength": 128,
                                "pattern": "^[A-Za-z0-9._:-]+$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Session Id",
                        "description": "Beta: groups calls into one chat session. /inbound remembers the PII mapping, /outbound restores it and can take a streamed reply part by part. The session is bound to the firewall configuration of its first call per endpoint and ends after 30 idle minutes by default.",
                        "x-beta": true
                    },
                    "session_end": {
                        "type": "boolean",
                        "title": "Session End",
                        "description": "Beta: end the session once this call has succeeded (requires session_id). A call that fails leaves the session open.",
                        "default": false,
                        "x-beta": true
                    }
                },
                "type": "object",
                "title": "InboundFilterRequest",
                "example": {
                    "config_id": "3f1343b0-b675-4ef4-bbfc-0c7a73078878",
                    "content": "Tell me about the evolution of the internet.",
                    "tool_config_id": "<tool_response_scan_config_uuid>",
                    "tool_response": {
                        "content": "<tool result content>",
                        "tool_call_id": "<openai_tool_call_id>"
                    }
                }
            },
            "InboundFilterResponse": {
                "properties": {
                    "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "title": "Timestamp"
                    },
                    "content": {
                        "type": "string",
                        "title": "Content",
                        "default": "Hello there, this is an example message payload for inbound processing!"
                    },
                    "content_modified": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Content Modified",
                        "description": "The rewritten payload to forward when `result.modified` is true."
                    },
                    "config_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Config Id",
                        "default": "00000000-0000-0000-0000-000000000000"
                    },
                    "session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Session Id",
                        "description": "Beta: the session this call belonged to, as sent; null without one.",
                        "x-beta": true
                    },
                    "result": {
                        "$ref": "#/components/schemas/FilterResponseResult",
                        "default": {
                            "valid": true,
                            "severity": 0.13,
                            "severity_level": 0,
                            "action": "allow",
                            "monitoring_mode": false,
                            "modified": false,
                            "handling": []
                        }
                    },
                    "filters": {
                        "additionalProperties": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/FilterResponseDetails"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "type": "object",
                        "title": "Filters"
                    }
                },
                "type": "object",
                "title": "InboundFilterResponse",
                "example": {
                    "config_id": "3f1343b0-b675-4ef4-bbfc-0c7a73078878",
                    "content": "Tell me about the evolution of the internet.",
                    "filters": {
                        "Content": {
                            "details": {
                                "Fraud Schemes": {
                                    "score": 0.03,
                                    "severity_level": 0
                                },
                                "Hate Incitement": {
                                    "score": 0.01,
                                    "severity_level": 0
                                },
                                "Unauthorized Hacking": {
                                    "score": 0.0,
                                    "severity_level": 0
                                }
                            },
                            "score": 0.03,
                            "severity_level": 0,
                            "valid": true
                        },
                        "Custom Regex": {
                            "details": {},
                            "score": 0,
                            "severity_level": 0,
                            "valid": true
                        },
                        "Language": {
                            "details": {
                                "label": "en",
                                "score": 0.74
                            },
                            "score": 0.01,
                            "severity_level": 0,
                            "valid": true
                        },
                        "PII": {
                            "details": {
                                "pseudonymized": "Tell me about the evolution of the internet."
                            },
                            "score": 0,
                            "severity_level": 0,
                            "valid": true
                        },
                        "PromptInjection": {
                            "score": 0,
                            "severity_level": 0,
                            "valid": true
                        }
                    },
                    "result": {
                        "action": "allow",
                        "handling": [],
                        "modified": false,
                        "monitoring_mode": false,
                        "severity": 0.01,
                        "valid": true
                    },
                    "timestamp": "2026-03-04T12:59:44.371681Z"
                }
            },
            "OpenAIModelEndpointModel": {
                "properties": {
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "object": {
                        "type": "string",
                        "title": "Object",
                        "default": "model"
                    },
                    "created": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "string"
                            }
                        ],
                        "title": "Created"
                    },
                    "owned_by": {
                        "type": "string",
                        "title": "Owned By"
                    }
                },
                "type": "object",
                "required": [
                    "id",
                    "created",
                    "owned_by"
                ],
                "title": "OpenAIModelEndpointModel"
            },
            "OpenAIModelEndpointResponse": {
                "properties": {
                    "object": {
                        "type": "string",
                        "title": "Object",
                        "default": "list"
                    },
                    "data": {
                        "items": {
                            "$ref": "#/components/schemas/OpenAIModelEndpointModel"
                        },
                        "type": "array",
                        "title": "Data"
                    }
                },
                "type": "object",
                "required": [
                    "data"
                ],
                "title": "OpenAIModelEndpointResponse",
                "example": {
                    "data": [
                        {
                            "created": "2026-03-03T12:38:49.786416",
                            "id": "MATVIS_Model_Openai",
                            "object": "model",
                            "owned_by": "custom"
                        },
                        {
                            "created": "2026-03-03T12:38:49.786416",
                            "id": "MATVIS_Model_Ollama",
                            "object": "model",
                            "owned_by": "custom"
                        },
                        {
                            "created": "2026-03-03T12:38:49.786416",
                            "id": "MATVIS_Model_Anthropic",
                            "object": "model",
                            "owned_by": "custom"
                        }
                    ],
                    "object": "list"
                }
            },
            "OutboundFilterRequest": {
                "properties": {
                    "ip_address": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ip Address"
                    },
                    "config_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Config Id",
                        "description": "The UUID of the firewall configuration to use for validation"
                    },
                    "content": {
                        "anyOf": [
                            {
                                "type": "string",
                                "minLength": 1
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Content",
                        "description": "The AI-generated content to validate"
                    },
                    "tool_call": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ToolCallInput"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Tool call to scan after it comes out of the LLM \u2014 accepts OpenAI (function object) or Anthropic (name + input) format"
                    },
                    "tool_config_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Tool Config Id",
                        "description": "UUID of the tool_call scan configuration to use when scanning a tool call"
                    },
                    "session_id": {
                        "anyOf": [
                            {
                                "type": "string",
                                "maxLength": 128,
                                "pattern": "^[A-Za-z0-9._:-]+$"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Session Id",
                        "description": "Beta: groups calls into one chat session. /inbound remembers the PII mapping, /outbound restores it and can take a streamed reply part by part. The session is bound to the firewall configuration of its first call per endpoint and ends after 30 idle minutes by default.",
                        "x-beta": true
                    },
                    "session_end": {
                        "type": "boolean",
                        "title": "Session End",
                        "description": "Beta: end the session once this call has succeeded (requires session_id). A call that fails leaves the session open.",
                        "default": false,
                        "x-beta": true
                    },
                    "stream": {
                        "type": "boolean",
                        "title": "Stream",
                        "description": "Beta: append `content` to the session's open stream (requires session_id and config_id). The response carries a verdict once a scan window filled; until then `content` is empty. Forward `content` when `result.action` is `allow`. End every reply with stream_end, also one that was blocked or stopped: until then the next part continues it. A call without stream or stream_end ends a stream left open, dropping its unscanned text. After a 503, send the same part again.",
                        "default": false,
                        "x-beta": true
                    },
                    "stream_end": {
                        "type": "boolean",
                        "title": "Stream End",
                        "description": "Beta: append `content` if given, then flush and scan the rest of the session's stream (requires session_id and config_id; content optional).",
                        "default": false,
                        "x-beta": true
                    }
                },
                "type": "object",
                "title": "OutboundFilterRequest",
                "example": {
                    "config_id": "824a67ff-0605-4abe-8c8d-c5592fbfdb97",
                    "content": "Life is a continuous journey of learning, growing, and connecting with others.",
                    "tool_call": {
                        "function": {
                            "arguments": "{\"<arg_name>\": \"<arg_value>\"}",
                            "name": "<tool_name>"
                        },
                        "id": "<openai_tool_call_id>",
                        "type": "function"
                    },
                    "tool_config_id": "<tool_call_scan_config_uuid>"
                }
            },
            "OutboundFilterResponse": {
                "properties": {
                    "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "title": "Timestamp"
                    },
                    "content": {
                        "type": "string",
                        "title": "Content",
                        "description": "The scanned content. Beta, under a session: the restored text this verdict covers, empty while a streamed reply is still being collected.",
                        "default": "Hi there! \ud83d\ude0a this is an example outbound message payload"
                    },
                    "content_modified": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Content Modified",
                        "description": "The rewritten payload to forward when `result.modified` is true."
                    },
                    "config_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Config Id",
                        "default": "00000000-0000-0000-0000-000000000000"
                    },
                    "session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Session Id",
                        "description": "Beta: the session this call belonged to, as sent; null without one.",
                        "x-beta": true
                    },
                    "result": {
                        "$ref": "#/components/schemas/FilterResponseResult",
                        "default": {
                            "valid": true,
                            "severity": 0.15,
                            "severity_level": 0,
                            "action": "allow",
                            "monitoring_mode": false,
                            "modified": false,
                            "handling": []
                        }
                    },
                    "filters": {
                        "additionalProperties": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/FilterResponseDetails"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "type": "object",
                        "title": "Filters"
                    }
                },
                "type": "object",
                "title": "OutboundFilterResponse",
                "example": {
                    "config_id": "824a67ff-0605-4abe-8c8d-c5592fbfdb97",
                    "content": "Life is a continuous journey of learning, growing, and connecting with others.",
                    "filters": {
                        "Content": {
                            "details": {
                                "Crime Incitement": {
                                    "score": 0.02,
                                    "severity_level": 0
                                },
                                "Weapons Misuse": {
                                    "score": 0.0,
                                    "severity_level": 0
                                }
                            },
                            "score": 0.02,
                            "severity_level": 0,
                            "valid": true
                        },
                        "Custom Regex": {
                            "details": {},
                            "score": 0,
                            "severity_level": 0,
                            "valid": true
                        },
                        "Language": {
                            "details": {
                                "label": "en",
                                "score": 0.98
                            },
                            "score": 0,
                            "severity_level": 0,
                            "valid": true
                        },
                        "PII": {
                            "details": {
                                "pseudonymized": "Life is a continuous journey of learning, growing, and connecting with others."
                            },
                            "score": 0,
                            "severity_level": 0,
                            "valid": true
                        }
                    },
                    "result": {
                        "action": "allow",
                        "handling": [],
                        "modified": false,
                        "monitoring_mode": false,
                        "severity": 0,
                        "valid": true
                    },
                    "timestamp": "2026-03-04T13:02:59.256253Z"
                }
            },
            "ToolCallInput": {
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Name",
                        "description": "Tool name (Anthropic format or normalized)"
                    },
                    "input": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Input",
                        "description": "Tool arguments as dict (Anthropic format)"
                    },
                    "function": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Function",
                        "description": "OpenAI function object: {name, arguments}"
                    },
                    "id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Id",
                        "description": "OpenAI tool call ID (accepted, not used in scanning)"
                    },
                    "type": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Type",
                        "description": "OpenAI type field (accepted, not used in scanning)"
                    }
                },
                "type": "object",
                "title": "ToolCallInput",
                "description": "Accepts both OpenAI and Anthropic tool call shapes.\n\nOpenAI  \u2014 pass the tool_calls[0] object verbatim:\n    {\"id\": \"call_xyz\", \"type\": \"function\", \"function\": {\"name\": \"get_weather\", \"arguments\": \"{\"city\": \"Berlin\"}\"}}\n\nAnthropic \u2014 pass the tool_use block:\n    {\"name\": \"get_weather\", \"input\": {\"city\": \"Berlin\"}}"
            },
            "ToolResponseInput": {
                "properties": {
                    "tool_call_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Tool Call Id",
                        "description": "OpenAI: ID of the tool call this result belongs to"
                    },
                    "tool_use_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Tool Use Id",
                        "description": "Anthropic: alias for tool_call_id"
                    },
                    "content": {
                        "type": "string",
                        "title": "Content",
                        "description": "The tool result content to scan"
                    }
                },
                "type": "object",
                "required": [
                    "content"
                ],
                "title": "ToolResponseInput",
                "description": "Accepts both OpenAI (tool_call_id) and Anthropic (tool_use_id) result shapes.\n\nOpenAI  \u2014 {\"tool_call_id\": \"call_xyz\", \"content\": \"...\"}\nAnthropic \u2014 {\"tool_use_id\": \"toolu_xxx\", \"content\": \"...\"}"
            },
            "ValidationError": {
                "properties": {
                    "loc": {
                        "items": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "integer"
                                }
                            ]
                        },
                        "type": "array",
                        "title": "Location"
                    },
                    "msg": {
                        "type": "string",
                        "title": "Message"
                    },
                    "type": {
                        "type": "string",
                        "title": "Error Type"
                    },
                    "input": {
                        "title": "Input"
                    },
                    "ctx": {
                        "type": "object",
                        "title": "Context"
                    }
                },
                "type": "object",
                "required": [
                    "loc",
                    "msg",
                    "type"
                ],
                "title": "ValidationError"
            }
        },
        "securitySchemes": {
            "Authorization": {
                "type": "apiKey",
                "in": "header",
                "name": "Authorization",
                "description": "Your MATVIS API key (format `sk-matvis-...`). The same key works for every endpoint. OpenAI-compatible endpoints read it from the `Authorization` header; the Anthropic-compatible `/api/v1/messages` endpoint additionally accepts it via the native `x-api-key` header. Paste the raw key here."
            }
        }
    },
    "tags": [
        {
            "name": "Inbound / Outbound",
            "description": "Real-time firewall filtering of inbound and outbound content."
        },
        {
            "name": "Models",
            "description": "List the AI models configured across all providers."
        },
        {
            "name": "Proxy OpenAI",
            "description": "OpenAI-compatible chat completions through the firewall."
        },
        {
            "name": "Proxy Anthropic",
            "description": "Anthropic-compatible messages through the firewall."
        },
        {
            "name": "Chat-Scan Configuration",
            "description": "Manage firewall configs (config-admin key)."
        },
        {
            "name": "Tool-Scan Configuration",
            "description": "Manage tool-scan configs (config-admin key)."
        },
        {
            "name": "Model Configuration",
            "description": "Manage model bindings (config-admin key)."
        },
        {
            "name": "Firewall Insights",
            "description": "Read-only firewall event records (config-admin key)."
        },
        {
            "name": "Policy as Code (experimental)",
            "description": "Declarative apply/export of the full configuration."
        },
        {
            "name": "Beta",
            "description": "Experimental endpoints - may change without notice."
        }
    ]
}
