{"openapi": "3.0.3", "info": {"title": "abliteration.ai API", "version": "2026-04-14", "description": "OpenAI-compatible chat completions and responses APIs for abliteration.ai, plus Anthropic-compatible messages and Policy Gateway endpoints for enforcement, config, simulations, and audits.", "termsOfService": "https://abliteration.ai/terms-of-service", "contact": {"email": "help@abliteration.ai"}}, "servers": [{"url": "https://api.abliteration.ai", "description": "Production"}, {"url": "http://localhost:8080", "description": "Local development"}], "tags": [{"name": "Chat Completions", "description": "OpenAI-compatible chat completions."}, {"name": "Responses", "description": "OpenAI-compatible Responses API."}, {"name": "Policy Gateway", "description": "Policy-enforced chat completions."}, {"name": "Anthropic Messages", "description": "Anthropic-compatible Messages API."}, {"name": "Models", "description": "OpenAI-compatible model listing."}], "paths": {"/v1/chat/completions": {"post": {"tags": ["Chat Completions"], "summary": "Create a chat completion", "description": "Creates a chat completion. Set stream: true for server-sent events.", "operationId": "createChatCompletion", "security": [{"BearerAuth": []}], "parameters": [{"name": "X-Free-Tier", "in": "header", "description": "Set to true to use the single anonymous free request.", "required": false, "schema": {"type": "string", "enum": ["true"]}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChatCompletionRequest"}, "examples": {"basic": {"summary": "Basic request", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "Write one sentence about Stonehenge."}], "temperature": 0.7, "max_tokens": 128}}, "streaming": {"summary": "Streaming request", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "Stream a short greeting."}], "stream": true}}}}}}, "responses": {"200": {"description": "Chat completion response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChatCompletionResponse"}, "examples": {"success": {"summary": "200 OK", "value": {"id": "chatcmpl-abc123", "object": "chat.completion", "created": 1735958400, "model": "abliterated-model", "choices": [{"index": 0, "message": {"role": "assistant", "content": "Hello there. How can I help?"}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 12, "completion_tokens": 8, "total_tokens": 20}, "remaining_credits": 48, "estimated_credits_used": 1, "estimated_cost_usd": 0.000105}}}}, "text/event-stream": {"schema": {"type": "string", "description": "Streaming response as server-sent events."}, "examples": {"stream": {"summary": "SSE stream", "value": "data: {\"id\":\"chatcmpl-abc123\",\"object\":\"chat.completion.chunk\",\"created\":1735958400,\"model\":\"abliterated-model\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-abc123\",\"object\":\"chat.completion.chunk\",\"created\":1735958400,\"model\":\"abliterated-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello!\"},\"finish_reason\":null}]}\n\ndata: [DONE]\n"}}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "402": {"description": "Insufficient credits", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "502": {"description": "Upstream unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/v1/responses": {"post": {"tags": ["Responses"], "summary": "Create a response", "description": "Creates a response using the OpenAI Responses API format. Set stream: true for server-sent events.", "operationId": "createResponse", "security": [{"BearerAuth": []}], "parameters": [{"name": "X-Free-Tier", "in": "header", "description": "Set to true to use the single anonymous free request.", "required": false, "schema": {"type": "string", "enum": ["true"]}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ResponsesRequest"}, "examples": {"basic": {"summary": "Basic text request", "value": {"model": "abliterated-model", "input": "Write one sentence about Stonehenge."}}, "structured": {"summary": "Structured multimodal request", "value": {"model": "abliterated-model", "instructions": "Answer in two sentences.", "input": [{"role": "user", "content": [{"type": "input_text", "text": "What is shown in this image?"}, {"type": "input_image", "image_url": "https://example.com/stonehenge.jpg"}]}], "max_output_tokens": 256}}, "streaming": {"summary": "Streaming request", "value": {"model": "abliterated-model", "input": "Stream a short greeting.", "stream": true}}}}}}, "responses": {"200": {"description": "Responses API response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ResponsesResponse"}, "examples": {"success": {"summary": "200 OK", "value": {"id": "resp_abc123", "object": "response", "created_at": 1735958400, "status": "completed", "model": "abliterated-model", "output": [{"id": "msg_abc123", "type": "message", "status": "completed", "role": "assistant", "content": [{"type": "output_text", "text": "Stonehenge is a prehistoric monument in Wiltshire, England.", "annotations": []}]}], "usage": {"input_tokens": 14, "output_tokens": 10, "total_tokens": 24}, "remaining_credits": 487, "estimated_credits_used": 1, "estimated_cost_usd": 0.00012}}}}, "text/event-stream": {"schema": {"type": "string", "description": "Streaming response as server-sent events following the Responses API event format."}, "examples": {"stream": {"summary": "SSE stream", "value": "event: response.created\ndata: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_abc123\",\"object\":\"response\",\"status\":\"in_progress\",\"model\":\"abliterated-model\",\"output\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"delta\":\"Hello!\"}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"response\":{\"id\":\"resp_abc123\",\"object\":\"response\",\"status\":\"completed\",\"model\":\"abliterated-model\"}}\n"}}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "402": {"description": "Insufficient credits", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "502": {"description": "Upstream unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/v1/messages": {"post": {"tags": ["Anthropic Messages"], "summary": "Create a message", "description": "Creates a message using the Anthropic Messages API format. Set stream: true for server-sent events.", "operationId": "createAnthropicMessage", "security": [{"BearerAuth": []}, {"AnthropicApiKeyAuth": []}], "parameters": [{"name": "X-Free-Tier", "in": "header", "description": "Set to true to use the single anonymous free request.", "required": false, "schema": {"type": "string", "enum": ["true"]}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicMessagesRequest"}, "examples": {"basic": {"summary": "Basic request", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "Write one sentence about Stonehenge."}], "max_tokens": 256}}, "streaming": {"summary": "Streaming request", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "Stream a short greeting."}], "max_tokens": 128, "stream": true}}, "multiTurn": {"summary": "Multi-turn conversation", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "What is abliteration?"}, {"role": "assistant", "content": "Abliteration removes refusal vectors from language models."}, {"role": "user", "content": "How does it work?"}], "max_tokens": 1024}}, "withSystem": {"summary": "With system prompt", "value": {"model": "abliterated-model", "system": "You are a helpful coding assistant.", "messages": [{"role": "user", "content": "Write a Python function that reverses a string."}], "max_tokens": 512, "temperature": 0.3}}}}}}, "responses": {"200": {"description": "Message response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicMessagesResponse"}, "examples": {"success": {"summary": "200 OK", "value": {"id": "msg_01XFDUDYJgAACzvnptvVoYEL", "type": "message", "role": "assistant", "model": "abliterated-model", "content": [{"type": "text", "text": "Stonehenge is a prehistoric monument in Wiltshire, England, consisting of a ring of standing stones dating back to around 3000 BCE."}], "stop_reason": "end_turn", "stop_sequence": null, "usage": {"input_tokens": 14, "output_tokens": 32}, "remaining_credits": 487, "estimated_credits_used": 1, "estimated_cost_usd": 0.00023}}}}, "text/event-stream": {"schema": {"type": "string", "description": "Streaming response as server-sent events following the Anthropic streaming protocol."}, "examples": {"stream": {"summary": "SSE stream", "value": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"msg_01XFDUDYJgAACzvnptvVoYEL\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"abliterated-model\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":14,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Hello!\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"output_tokens\":2}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n"}}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicErrorResponse"}, "examples": {"invalidRequest": {"summary": "Invalid request body", "value": {"type": "error", "error": {"type": "invalid_request_error", "message": "Invalid request body."}}}}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicErrorResponse"}, "examples": {"unauthorized": {"summary": "Missing or invalid credentials", "value": {"type": "error", "error": {"type": "authentication_error", "message": "Sign up to continue after your free request."}}}}}}}, "402": {"description": "Insufficient credits", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicErrorResponse"}, "examples": {"noCredits": {"summary": "Credit balance exhausted", "value": {"type": "error", "error": {"type": "permission_error", "message": "Insufficient credits. Top up to keep chatting."}}}}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "502": {"description": "Upstream unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicErrorResponse"}}}}, "504": {"description": "Gateway timeout", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicErrorResponse"}}}}}}}, "/v1/messages/count_tokens": {"post": {"tags": ["Anthropic Messages"], "summary": "Count input tokens", "description": "Returns an estimated input token count for a message payload without generating a response. Useful for budget checks before sending expensive prompts.", "operationId": "countAnthropicTokens", "security": [{"BearerAuth": []}, {"AnthropicApiKeyAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicMessagesRequest"}, "examples": {"basic": {"summary": "Count tokens for a prompt", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "Count these tokens for me."}]}}}}}}, "responses": {"200": {"description": "Token count", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicTokenCountResponse"}, "examples": {"success": {"summary": "200 OK", "value": {"input_tokens": 12}}}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AnthropicErrorResponse"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/policy/chat/completions": {"post": {"tags": ["Policy Gateway"], "summary": "Create a policy-enforced chat completion", "description": "Creates a chat completion with Policy Gateway enforcement and audit metadata. Set stream: true for server-sent events.", "operationId": "createPolicyChatCompletion", "security": [{"BearerAuth": []}], "parameters": [{"name": "X-Policy-Target", "in": "header", "description": "Optional target label used for shadow/canary rollout targeting.", "required": false, "schema": {"type": "string"}}, {"name": "X-Policy-User", "in": "header", "description": "Optional end-user identifier for per-user quotas.", "required": false, "schema": {"type": "string"}}, {"name": "X-Policy-Project", "in": "header", "description": "Optional project identifier when using JWT auth or project budgets.", "required": false, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyChatCompletionRequest"}, "examples": {"policyBasic": {"summary": "Policy gateway request", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "Summarize our support refund policy."}], "policy_id": "policy-gateway", "policy_target": "support-bot", "stream": false}}, "policyOverride": {"summary": "Inline policy override", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "Explain how to reset my account."}], "policy": {"policy_id": "byop-gateway", "rules": {"allowlist": ["account support"], "denylist": ["illegal instructions"], "redact": true, "rewrite_instead_of_refuse": true, "response_pattern": "rewrite", "reason_codes": ["ALLOW", "REWRITE", "ESCALATE"], "flagged_categories": ["self-harm/intent"]}}}}, "policyStreaming": {"summary": "Policy gateway streaming request", "value": {"model": "abliterated-model", "messages": [{"role": "user", "content": "Stream a short customer support response."}], "stream": true}}}}}}, "responses": {"200": {"description": "Policy-enforced chat completion response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyChatCompletionResponse"}, "examples": {"success": {"summary": "200 OK", "value": {"id": "chatcmpl-policy-123", "object": "chat.completion", "created": 1735958400, "model": "abliterated-model", "choices": [{"index": 0, "message": {"role": "assistant", "content": "Here is a brief summary of the refund policy."}, "finish_reason": "stop"}], "usage": {"prompt_tokens": 18, "completion_tokens": 12, "total_tokens": 30}, "remaining_credits": 48, "estimated_credits_used": 1, "estimated_cost_usd": 0.00015, "policy": {"policy_id": "policy-gateway", "decision": "allow", "effective_decision": "allow", "reason_code": "ALLOW", "triggered_categories": [], "allowlist_hits": ["refund policy"], "denylist_hits": [], "rollout_mode": "enforced", "enforced": true, "policy_target": "support-bot"}}}}}, "text/event-stream": {"schema": {"type": "string", "description": "Streaming response as server-sent events with policy metadata."}, "examples": {"stream": {"summary": "SSE stream", "value": "data: {\"id\":\"chatcmpl-policy-123\",\"object\":\"chat.completion.chunk\",\"created\":1735958400,\"model\":\"abliterated-model\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}],\"policy\":{\"policy_id\":\"policy-gateway\",\"decision\":\"allow\",\"effective_decision\":\"allow\",\"reason_code\":\"ALLOW\",\"triggered_categories\":[],\"allowlist_hits\":[],\"denylist_hits\":[],\"rollout_mode\":\"enforced\",\"enforced\":true}}\n\ndata: {\"id\":\"chatcmpl-policy-123\",\"object\":\"chat.completion.chunk\",\"created\":1735958400,\"model\":\"abliterated-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello.\"},\"finish_reason\":null}],\"policy\":{\"policy_id\":\"policy-gateway\",\"decision\":\"allow\",\"effective_decision\":\"allow\",\"reason_code\":\"ALLOW\",\"triggered_categories\":[],\"allowlist_hits\":[],\"denylist_hits\":[],\"rollout_mode\":\"enforced\",\"enforced\":true}}\n\ndata: [DONE]\n"}}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "402": {"description": "Insufficient credits", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "502": {"description": "Upstream unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/v1/models": {"get": {"tags": ["Models"], "summary": "List models", "description": "Returns the list of available models.", "operationId": "listModels", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Model list", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ModelList"}, "examples": {"success": {"summary": "200 OK", "value": {"object": "list", "data": [{"id": "abliterated-model", "object": "model", "created": 1735958400, "owned_by": "abliteration.ai", "root": "abliterated-model", "parent": null}]}}}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/projects": {"get": {"tags": ["Policy Gateway"], "summary": "List policy projects", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Project list", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyProjectListResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}, "post": {"tags": ["Policy Gateway"], "summary": "Create or update a policy project", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyProjectCreateRequest"}}}}, "responses": {"200": {"description": "Project created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyProjectCreateResponse"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/projects/{project_id}/keys": {"get": {"tags": ["Policy Gateway"], "summary": "List project keys", "security": [{"BearerAuth": []}], "parameters": [{"name": "project_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Project keys", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyProjectKeysResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "404": {"description": "Not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}, "post": {"tags": ["Policy Gateway"], "summary": "Create a project API key", "security": [{"BearerAuth": []}], "parameters": [{"name": "project_id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": false, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyProjectKeyCreateRequest"}}}}, "responses": {"200": {"description": "Key created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyProjectKeyCreateResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "404": {"description": "Not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/keys/{key_id}": {"delete": {"tags": ["Policy Gateway"], "summary": "Revoke a project key", "security": [{"BearerAuth": []}], "parameters": [{"name": "key_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Key revoked", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyKeyRevokeResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "404": {"description": "Not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/config": {"get": {"tags": ["Policy Gateway"], "summary": "Get policy configuration", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Policy configuration", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayConfigResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}, "post": {"tags": ["Policy Gateway"], "summary": "Save policy configuration", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"config": {"$ref": "#/components/schemas/PolicyConfig"}}}}}}, "responses": {"200": {"description": "Policy saved", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayConfigResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/simulate": {"post": {"tags": ["Policy Gateway"], "summary": "Simulate a policy decision", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewaySimulateRequest"}}}}, "responses": {"200": {"description": "Simulation result", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewaySimulateResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/history": {"get": {"tags": ["Policy Gateway"], "summary": "List policy history", "security": [{"BearerAuth": []}], "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer"}}, {"name": "type", "in": "query", "required": false, "schema": {"type": "string", "enum": ["all", "simulation", "revision", "enforcement"]}}], "responses": {"200": {"description": "History entries", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayHistoryResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/pricing": {"get": {"tags": ["Policy Gateway"], "summary": "Get policy gateway pricing", "responses": {"200": {"description": "Pricing details", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayPricingResponse"}}}}}}}, "/api/policy-gateway/exports/destinations": {"get": {"tags": ["Policy Gateway"], "summary": "List export destinations", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Supported export destinations", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayExportDestinationsResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/exports": {"get": {"tags": ["Policy Gateway"], "summary": "List audit log export sinks", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Export sinks", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayExportListResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}, "post": {"tags": ["Policy Gateway"], "summary": "Create an audit log export sink", "security": [{"BearerAuth": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayExportRequest"}}}}, "responses": {"200": {"description": "Created export sink", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayExportResponse"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/exports/{export_id}": {"get": {"tags": ["Policy Gateway"], "summary": "Get an audit log export sink", "security": [{"BearerAuth": []}], "parameters": [{"name": "export_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Export sink", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayExportResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "404": {"description": "Not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}, "patch": {"tags": ["Policy Gateway"], "summary": "Update an audit log export sink", "security": [{"BearerAuth": []}], "parameters": [{"name": "export_id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayExportRequest"}}}}, "responses": {"200": {"description": "Updated export sink", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayExportResponse"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "404": {"description": "Not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}, "delete": {"tags": ["Policy Gateway"], "summary": "Delete an audit log export sink", "security": [{"BearerAuth": []}], "parameters": [{"name": "export_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Deleted", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}}}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "404": {"description": "Not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}, "/api/policy-gateway/exports/{export_id}/test": {"post": {"tags": ["Policy Gateway"], "summary": "Send a test audit log event to an export sink", "security": [{"BearerAuth": []}], "parameters": [{"name": "export_id", "in": "path", "required": true, "schema": {"type": "string"}}], "responses": {"200": {"description": "Test delivered", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PolicyGatewayExportTestResponse"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "401": {"description": "Unauthorized", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "404": {"description": "Not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}, "502": {"description": "Export delivery failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ErrorResponse"}}}}}}}}, "components": {"securitySchemes": {"BearerAuth": {"type": "http", "scheme": "bearer", "bearerFormat": "JWT", "description": "Use a JWT or abliteration.ai API key as a Bearer token."}, "AnthropicApiKeyAuth": {"type": "apiKey", "in": "header", "name": "x-api-key", "description": "Anthropic SDK compatibility. Use an abliteration.ai API key starting with ak_."}}, "schemas": {"ChatCompletionRequest": {"type": "object", "required": ["model", "messages"], "properties": {"model": {"type": "string", "description": "Model id."}, "messages": {"type": "array", "description": "Conversation messages. content can be a string or a list of parts for multimodal requests.", "items": {"$ref": "#/components/schemas/ChatMessage"}}, "temperature": {"type": "number", "minimum": 0, "maximum": 2, "description": "Sampling temperature."}, "top_p": {"type": "number", "minimum": 0, "maximum": 1}, "n": {"type": "integer", "minimum": 1}, "stream": {"type": "boolean", "default": false}, "max_tokens": {"type": "integer", "minimum": 1}, "stop": {"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "string"}}]}, "presence_penalty": {"type": "number", "minimum": -2, "maximum": 2}, "frequency_penalty": {"type": "number", "minimum": -2, "maximum": 2}, "user": {"type": "string", "description": "End-user identifier for abuse monitoring."}, "flagged_categories": {"type": "array", "description": "Optional moderation categories to block for this request. Supported: harassment, hate, illicit, sexual. Self-harm and sexual/minors are always blocked.", "items": {"type": "string"}}}}, "PolicyChatCompletionRequest": {"allOf": [{"$ref": "#/components/schemas/ChatCompletionRequest"}, {"type": "object", "properties": {"policy_id": {"type": "string", "description": "Optional policy id to validate against the saved policy."}, "policy_target": {"type": "string", "description": "Optional rollout target label for shadow/canary targeting."}, "policy": {"$ref": "#/components/schemas/PolicyConfig", "description": "Optional inline policy config. Overrides the saved policy for this request."}, "policy_user": {"type": "string", "description": "Optional end-user identifier for per-user quota enforcement."}, "policy_project_id": {"type": "string", "description": "Optional project identifier for project key budgets and usage tracking."}}}]}, "ChatMessage": {"type": "object", "required": ["role", "content"], "properties": {"role": {"type": "string", "enum": ["system", "user", "assistant", "tool"]}, "content": {"description": "Text content or an array of text/image_url parts.", "oneOf": [{"type": "string"}, {"type": "array", "items": {"$ref": "#/components/schemas/ContentPart"}}]}, "name": {"type": "string"}}}, "ContentPart": {"oneOf": [{"$ref": "#/components/schemas/TextContentPart"}, {"$ref": "#/components/schemas/ImageContentPart"}]}, "TextContentPart": {"type": "object", "required": ["type", "text"], "properties": {"type": {"type": "string", "enum": ["text"]}, "text": {"type": "string"}}}, "ImageContentPart": {"type": "object", "required": ["type", "image_url"], "properties": {"type": {"type": "string", "enum": ["image_url"]}, "image_url": {"$ref": "#/components/schemas/ImageUrl"}}}, "ImageUrl": {"type": "object", "required": ["url"], "properties": {"url": {"type": "string", "format": "uri"}, "detail": {"type": "string", "enum": ["low", "high", "auto"]}}}, "ChatCompletionResponse": {"type": "object", "required": ["id", "object", "created", "model", "choices"], "properties": {"id": {"type": "string"}, "object": {"type": "string", "enum": ["chat.completion"]}, "created": {"type": "integer"}, "model": {"type": "string"}, "choices": {"type": "array", "items": {"$ref": "#/components/schemas/ChatCompletionChoice"}}, "usage": {"$ref": "#/components/schemas/Usage"}, "remaining_credits": {"type": "integer", "nullable": true}, "estimated_credits_used": {"type": "integer"}, "estimated_cost_usd": {"type": "number"}}}, "ResponsesRequest": {"type": "object", "required": ["model"], "additionalProperties": true, "properties": {"model": {"type": "string", "description": "Model id."}, "input": {"description": "Plain text input or a structured Responses API input array.", "oneOf": [{"type": "string"}, {"type": "array", "items": {"oneOf": [{"type": "string"}, {"$ref": "#/components/schemas/ResponsesInputItem"}]}}]}, "instructions": {"type": "string", "description": "Optional system-style instruction."}, "stream": {"type": "boolean", "default": false}, "temperature": {"type": "number", "minimum": 0, "maximum": 2}, "max_output_tokens": {"type": "integer", "minimum": 1}, "tools": {"type": "array", "description": "Tool definitions passed through to the upstream Responses implementation.", "items": {"type": "object", "additionalProperties": true}}, "tool_choice": {"description": "Controls whether the model may call tools.", "oneOf": [{"type": "string"}, {"type": "object", "additionalProperties": true}]}, "flagged_categories": {"type": "array", "description": "Optional moderation categories to block for this request. Supported: harassment, hate, illicit, sexual. Self-harm and sexual/minors are always blocked.", "items": {"type": "string"}}}}, "ResponsesInputItem": {"type": "object", "additionalProperties": true, "properties": {"role": {"type": "string", "enum": ["system", "user", "assistant", "tool"]}, "content": {"description": "Structured Responses input content.", "oneOf": [{"type": "string"}, {"type": "array", "items": {"$ref": "#/components/schemas/ResponsesInputContentPart"}}]}}}, "ResponsesInputContentPart": {"oneOf": [{"$ref": "#/components/schemas/ResponsesInputTextPart"}, {"$ref": "#/components/schemas/ResponsesInputImagePart"}]}, "ResponsesInputTextPart": {"type": "object", "required": ["type", "text"], "properties": {"type": {"type": "string", "enum": ["input_text", "text"]}, "text": {"type": "string"}}}, "ResponsesInputImagePart": {"type": "object", "required": ["type"], "properties": {"type": {"type": "string", "enum": ["input_image", "image_url"]}, "image_url": {"description": "Image URL as a string or object.", "oneOf": [{"type": "string", "format": "uri"}, {"$ref": "#/components/schemas/ImageUrl"}]}}}, "ResponsesResponse": {"type": "object", "required": ["id", "object", "status", "model"], "additionalProperties": true, "properties": {"id": {"type": "string"}, "object": {"type": "string", "enum": ["response"]}, "created_at": {"type": "integer"}, "status": {"type": "string"}, "model": {"type": "string"}, "output": {"type": "array", "items": {"$ref": "#/components/schemas/ResponsesOutputItem"}}, "usage": {"$ref": "#/components/schemas/ResponsesUsage"}, "remaining_credits": {"type": "integer", "nullable": true}, "estimated_credits_used": {"type": "integer"}, "estimated_cost_usd": {"type": "number"}}}, "ResponsesOutputItem": {"type": "object", "additionalProperties": true, "properties": {"id": {"type": "string"}, "type": {"type": "string", "enum": ["message"]}, "status": {"type": "string"}, "role": {"type": "string", "enum": ["assistant"]}, "content": {"type": "array", "items": {"$ref": "#/components/schemas/ResponsesOutputContentPart"}}}}, "ResponsesOutputContentPart": {"type": "object", "additionalProperties": true, "properties": {"type": {"type": "string", "enum": ["output_text"]}, "text": {"type": "string"}, "annotations": {"type": "array", "items": {"type": "object", "additionalProperties": true}}}}, "ResponsesUsage": {"type": "object", "properties": {"input_tokens": {"type": "integer"}, "output_tokens": {"type": "integer"}, "total_tokens": {"type": "integer"}}}, "PolicyDecision": {"type": "object", "properties": {"policy_id": {"type": "string"}, "decision": {"type": "string", "enum": ["allow", "rewrite", "summary", "escalate", "refuse"]}, "effective_decision": {"type": "string", "enum": ["allow", "rewrite", "summary", "escalate", "refuse"]}, "reason_code": {"type": "string"}, "triggered_categories": {"type": "array", "items": {"type": "string"}}, "allowlist_hits": {"type": "array", "items": {"type": "string"}}, "denylist_hits": {"type": "array", "items": {"type": "string"}}, "rollout_mode": {"type": "string"}, "enforced": {"type": "boolean"}, "policy_target": {"type": "string", "nullable": true}, "policy_user": {"type": "string", "nullable": true}, "project_id": {"type": "string", "nullable": true}, "project_label": {"type": "string", "nullable": true}, "data_classification": {"type": "string", "nullable": true}, "rollback": {"type": "object", "nullable": true, "properties": {"active": {"type": "boolean"}, "rollback_until": {"type": "string"}, "reason": {"type": "string"}, "threshold": {"type": "number"}, "observed_rate": {"type": "number"}, "total_requests": {"type": "integer"}}}, "quota": {"type": "object", "nullable": true, "additionalProperties": true}}}, "PolicyChatCompletionResponse": {"allOf": [{"$ref": "#/components/schemas/ChatCompletionResponse"}, {"type": "object", "properties": {"policy": {"$ref": "#/components/schemas/PolicyDecision"}}}]}, "ChatCompletionChoice": {"type": "object", "required": ["index", "message", "finish_reason"], "properties": {"index": {"type": "integer"}, "message": {"$ref": "#/components/schemas/ChatMessageResponse"}, "finish_reason": {"type": "string", "nullable": true}}}, "ChatMessageResponse": {"type": "object", "required": ["role", "content"], "properties": {"role": {"type": "string", "enum": ["assistant"]}, "content": {"type": "string"}}}, "Usage": {"type": "object", "properties": {"prompt_tokens": {"type": "integer"}, "completion_tokens": {"type": "integer"}, "total_tokens": {"type": "integer"}}}, "ErrorResponse": {"type": "object", "required": ["error"], "properties": {"error": {"type": "string"}, "code": {"type": "string"}}}, "AnthropicMessagesRequest": {"type": "object", "required": ["model", "messages"], "properties": {"model": {"type": "string", "description": "Model id (e.g. abliterated-model)."}, "messages": {"type": "array", "description": "Non-empty array of message objects. Each has role (user or assistant) and content (string or content-block array).", "items": {"$ref": "#/components/schemas/AnthropicMessage"}, "minItems": 1}, "max_tokens": {"type": "integer", "minimum": 1, "description": "Maximum number of tokens to generate."}, "temperature": {"type": "number", "minimum": 0, "maximum": 2, "description": "Sampling temperature."}, "stream": {"type": "boolean", "default": false, "description": "Enable Server-Sent Events streaming."}, "system": {"description": "System prompt. Can be a string or an array of content blocks.", "oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "object"}}]}, "flagged_categories": {"type": "array", "description": "Optional moderation categories to block. Supported: harassment, hate, illicit, sexual. Self-harm and sexual/minors are always blocked.", "items": {"type": "string"}}}}, "AnthropicMessage": {"type": "object", "required": ["role", "content"], "properties": {"role": {"type": "string", "enum": ["user", "assistant"]}, "content": {"description": "Text string or array of content blocks (text, image).", "oneOf": [{"type": "string"}, {"type": "array", "items": {"$ref": "#/components/schemas/AnthropicContentBlock"}}]}}}, "AnthropicContentBlock": {"oneOf": [{"type": "object", "required": ["type", "text"], "properties": {"type": {"type": "string", "enum": ["text"]}, "text": {"type": "string"}}}, {"type": "object", "required": ["type", "source"], "properties": {"type": {"type": "string", "enum": ["image"]}, "source": {"type": "object", "required": ["type", "media_type", "data"], "properties": {"type": {"type": "string", "enum": ["base64"]}, "media_type": {"type": "string"}, "data": {"type": "string"}}}}}]}, "AnthropicMessagesResponse": {"type": "object", "required": ["id", "type", "role", "model", "content"], "properties": {"id": {"type": "string", "description": "Unique message id (e.g. msg_01XFDUDYJgAACzvnptvVoYEL)."}, "type": {"type": "string", "enum": ["message"]}, "role": {"type": "string", "enum": ["assistant"]}, "model": {"type": "string"}, "content": {"type": "array", "items": {"$ref": "#/components/schemas/AnthropicContentBlock"}}, "stop_reason": {"type": "string", "nullable": true, "description": "Reason the model stopped generating (e.g. end_turn, max_tokens)."}, "stop_sequence": {"type": "string", "nullable": true}, "usage": {"$ref": "#/components/schemas/AnthropicUsage"}, "remaining_credits": {"type": "integer", "nullable": true, "description": "User's remaining credit balance after this call."}, "estimated_credits_used": {"type": "integer", "description": "Credits consumed by this call."}, "estimated_cost_usd": {"type": "number", "description": "Estimated cost in USD."}}}, "AnthropicUsage": {"type": "object", "properties": {"input_tokens": {"type": "integer", "description": "Number of input tokens."}, "output_tokens": {"type": "integer", "description": "Number of output tokens."}}}, "AnthropicErrorResponse": {"type": "object", "required": ["type", "error"], "properties": {"type": {"type": "string", "enum": ["error"]}, "error": {"type": "object", "required": ["type", "message"], "properties": {"type": {"type": "string", "description": "Error type (e.g. invalid_request_error, authentication_error, permission_error, api_error)."}, "message": {"type": "string"}}}}}, "AnthropicTokenCountResponse": {"type": "object", "required": ["input_tokens"], "properties": {"input_tokens": {"type": "integer", "description": "Estimated number of input tokens."}}}, "Model": {"type": "object", "required": ["id", "object", "created", "owned_by"], "properties": {"id": {"type": "string"}, "object": {"type": "string", "enum": ["model"]}, "created": {"type": "integer"}, "owned_by": {"type": "string"}, "root": {"type": "string", "nullable": true}, "parent": {"type": "string", "nullable": true}}}, "ModelList": {"type": "object", "required": ["object", "data"], "properties": {"object": {"type": "string", "enum": ["list"]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Model"}}}}, "PolicyProject": {"type": "object", "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "status": {"type": "string"}, "monthly_token_limit": {"type": "integer"}, "monthly_request_limit": {"type": "integer"}, "usage": {"type": "object", "properties": {"requests": {"type": "integer"}, "tokens": {"type": "integer"}, "window": {"type": "string"}}}, "created_at": {"type": "string"}, "updated_at": {"type": "string"}}}, "PolicyProjectRef": {"type": "object", "properties": {"id": {"type": "string"}, "name": {"type": "string"}}}, "PolicyProjectKey": {"type": "object", "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "key_preview": {"type": "string"}, "revoked": {"type": "boolean"}, "created_at": {"type": "string"}, "last_used_at": {"type": "string"}}}, "PolicyProjectListResponse": {"type": "object", "properties": {"projects": {"type": "array", "items": {"$ref": "#/components/schemas/PolicyProject"}}}}, "PolicyProjectCreateRequest": {"type": "object", "properties": {"name": {"type": "string"}, "project_id": {"type": "string"}, "monthly_token_limit": {"type": "integer"}, "monthly_request_limit": {"type": "integer"}}, "required": ["name"]}, "PolicyProjectCreateResponse": {"type": "object", "properties": {"project": {"$ref": "#/components/schemas/PolicyProjectRef"}}}, "PolicyProjectKeysResponse": {"type": "object", "properties": {"project": {"$ref": "#/components/schemas/PolicyProjectRef"}, "keys": {"type": "array", "items": {"$ref": "#/components/schemas/PolicyProjectKey"}}}}, "PolicyProjectKeyCreateRequest": {"type": "object", "properties": {"label": {"type": "string"}}}, "PolicyProjectKeyCreateResponse": {"type": "object", "properties": {"api_key": {"type": "string"}, "key_preview": {"type": "string"}}}, "PolicyKeyRevokeResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}}}, "PolicyQuota": {"type": "object", "properties": {"requests": {"type": "integer"}, "tokens": {"type": "integer"}, "window": {"type": "string"}}}, "PolicyRules": {"type": "object", "properties": {"allowlist": {"type": "array", "items": {"type": "string"}}, "denylist": {"type": "array", "items": {"type": "string"}}, "redact": {"type": "boolean"}, "rewrite_instead_of_refuse": {"type": "boolean"}, "response_pattern": {"type": "string"}, "reason_codes": {"type": "array", "items": {"type": "string"}}, "flagged_categories": {"type": "array", "items": {"type": "string"}}}}, "PolicyOrgControls": {"type": "object", "properties": {"project_keys": {"type": "boolean"}, "user_quotas": {"type": "boolean"}, "audit_logs": {"type": "boolean"}, "data_classification": {"type": "string"}, "user_quota": {"$ref": "#/components/schemas/PolicyQuota"}, "project_quota": {"$ref": "#/components/schemas/PolicyQuota"}}}, "PolicyRolloutTarget": {"type": "object", "properties": {"enabled": {"type": "boolean"}, "sample_percent": {"type": "number"}, "targets": {"type": "array", "items": {"type": "string"}}}}, "PolicyRollout": {"type": "object", "properties": {"shadow": {"$ref": "#/components/schemas/PolicyRolloutTarget"}, "canary": {"$ref": "#/components/schemas/PolicyRolloutTarget"}, "rollback_on_spike": {"type": "boolean"}}}, "PolicyRefusalReplacement": {"type": "object", "properties": {"mode": {"type": "string"}, "escalation_path": {"type": "string"}}}, "PolicyConfig": {"type": "object", "properties": {"policy_id": {"type": "string"}, "name": {"type": "string"}, "owner": {"type": "string"}, "description": {"type": "string"}, "rules": {"$ref": "#/components/schemas/PolicyRules"}, "org_controls": {"$ref": "#/components/schemas/PolicyOrgControls"}, "rollout": {"$ref": "#/components/schemas/PolicyRollout"}, "refusal_replacement": {"$ref": "#/components/schemas/PolicyRefusalReplacement"}}}, "PolicyGatewayConfigResponse": {"type": "object", "properties": {"config": {"$ref": "#/components/schemas/PolicyConfig"}, "created_at": {"type": "string", "nullable": true}, "updated_at": {"type": "string", "nullable": true}}}, "PolicyGatewaySimulateRequest": {"type": "object", "properties": {"config": {"$ref": "#/components/schemas/PolicyConfig"}, "policy": {"$ref": "#/components/schemas/PolicyConfig"}, "scenario": {"type": "object", "properties": {"categories": {"type": "array", "items": {"type": "string"}}}}, "categories": {"type": "array", "items": {"type": "string"}}, "persist": {"type": "boolean"}}}, "PolicyGatewaySimulateResponse": {"type": "object", "properties": {"decision": {"type": "string"}, "reason_code": {"type": "string"}, "triggered_categories": {"type": "array", "items": {"type": "string"}}, "rollout_mode": {"type": "string"}, "policy_id": {"type": "string"}}}, "PolicyHistoryEntry": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"type": "string"}, "created_at": {"type": "string"}, "policy_id": {"type": "string"}, "policy_name": {"type": "string"}, "decision": {"type": "string"}, "reason_code": {"type": "string"}, "triggered_categories": {"type": "array", "items": {"type": "string"}}, "scenario_categories": {"type": "array", "items": {"type": "string"}}, "rollout_mode": {"type": "string"}, "enforced": {"type": "boolean"}, "allowlist_hits": {"type": "array", "items": {"type": "string"}}, "denylist_hits": {"type": "array", "items": {"type": "string"}}, "policy_target": {"type": "string"}, "policy_user": {"type": "string"}, "quota_subject": {"type": "string"}, "project_id": {"type": "string"}, "project_label": {"type": "string"}, "data_classification": {"type": "string"}, "model": {"type": "string"}, "config": {"$ref": "#/components/schemas/PolicyConfig"}}}, "PolicyGatewayHistoryResponse": {"type": "object", "properties": {"entries": {"type": "array", "items": {"$ref": "#/components/schemas/PolicyHistoryEntry"}}}}, "PricingPack": {"type": "object", "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "tokens": {"type": "integer"}, "credits": {"type": "integer"}, "price_usd": {"type": "number"}}}, "PolicyGatewayEquivalentPack": {"type": "object", "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "multiplier": {"type": "integer"}}}, "PolicyGatewayTier": {"type": "object", "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "multiplier": {"type": "integer"}, "tokens": {"type": "integer"}, "credits": {"type": "integer"}, "price_usd": {"type": "number"}, "equivalent_pack": {"$ref": "#/components/schemas/PolicyGatewayEquivalentPack"}, "list_price_usd": {"type": "number"}}}, "PolicyGatewayPricingResponse": {"type": "object", "properties": {"base_pack": {"$ref": "#/components/schemas/PricingPack"}, "tiers": {"type": "array", "items": {"$ref": "#/components/schemas/PolicyGatewayTier"}}, "currency": {"type": "string"}, "tokens_per_credit": {"type": "integer"}, "price_per_million_tokens_usd": {"type": "number"}, "promo": {"$ref": "#/components/schemas/PolicyGatewayPromo"}}}, "PolicyGatewayExport": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"type": "string"}, "label": {"type": "string"}, "enabled": {"type": "boolean"}, "config": {"type": "object"}, "created_at": {"type": "string"}, "updated_at": {"type": "string"}, "last_success_at": {"type": "string"}, "last_error_at": {"type": "string"}, "last_error": {"type": "string"}}}, "PolicyGatewayExportRequest": {"type": "object", "properties": {"type": {"type": "string", "description": "Destination type (splunk_hec, datadog_logs, elastic, s3, azure_monitor)"}, "label": {"type": "string"}, "enabled": {"type": "boolean"}, "config": {"type": "object"}}}, "PolicyGatewayExportResponse": {"type": "object", "properties": {"export": {"$ref": "#/components/schemas/PolicyGatewayExport"}}}, "PolicyGatewayExportListResponse": {"type": "object", "properties": {"exports": {"type": "array", "items": {"$ref": "#/components/schemas/PolicyGatewayExport"}}}}, "PolicyGatewayExportDestination": {"type": "object", "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "required": {"type": "array", "items": {"type": "string"}}, "event_types": {"type": "array", "items": {"type": "string"}}}}, "PolicyGatewayExportDestinationsResponse": {"type": "object", "properties": {"destinations": {"type": "array", "items": {"$ref": "#/components/schemas/PolicyGatewayExportDestination"}}}}, "PolicyGatewayExportTestResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}}}, "PolicyGatewayPromo": {"type": "object", "properties": {"active": {"type": "boolean"}, "discount_percent": {"type": "number"}, "duration_months": {"type": "integer"}, "starts_at": {"type": "string"}, "ends_at": {"type": "string"}, "applied": {"type": "boolean"}}}}}}