{ "openapi": "3.1.0", "info": { "title": "Helperium API", "description": "LLM agent orchestration service", "version": "1.1.0" }, "paths": { "/api/chat": { "post": { "summary": "Chat Endpoint", "operationId": "chat_endpoint_api_chat_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/api/chat/voice": { "post": { "summary": "Chat Voice Endpoint", "operationId": "chat_voice_endpoint_api_chat_voice_post", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_chat_voice_endpoint_api_chat_voice_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/chat/{name}": { "post": { "summary": "Chat Agent Handler", "operationId": "chat_agent_handler_api_chat__name__post", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/reports": { "post": { "summary": "Create Report", "description": "Accept a problem report from the embed widget.", "operationId": "create_report_api_reports_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReportCreateRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/agents/{name}/widget-config": { "get": { "summary": "Agent Widget Config Endpoint", "operationId": "agent_widget_config_endpoint_api_agents__name__widget_config_get", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Agent Widget Config Endpoint Api Agents Name Widget Config Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/health": { "get": { "summary": "Health check", "operationId": "health_endpoint_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthResponse" } } } } } } }, "/api/session/history": { "get": { "summary": "Session History Endpoint", "operationId": "session_history_endpoint_api_session_history_get", "parameters": [ { "name": "session_id", "in": "query", "required": false, "schema": { "type": "string", "default": "default", "title": "Session Id" } }, { "name": "agent_name", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Agent Name" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } }, { "name": "X-Session-Token", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Session-Token" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionHistoryResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/agents": { "post": { "summary": "Create Agent Endpoint", "operationId": "create_agent_endpoint_api_agents_post", "parameters": [ { "name": "X-Full-Keys", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Full-Keys" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentCreateRequest" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "get": { "summary": "List Agents Endpoint", "operationId": "list_agents_endpoint_api_agents_get", "parameters": [ { "name": "X-Full-Keys", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Full-Keys" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/agents/{name}": { "get": { "summary": "Get Agent Endpoint", "operationId": "get_agent_endpoint_api_agents__name__get", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } }, { "name": "X-Full-Keys", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Full-Keys" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "put": { "summary": "Update Agent Endpoint", "operationId": "update_agent_endpoint_api_agents__name__put", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } }, { "name": "X-Full-Keys", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "X-Full-Keys" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentUpdateRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "summary": "Delete Agent Endpoint", "operationId": "delete_agent_endpoint_api_agents__name__delete", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "204": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/reports": { "get": { "summary": "List Reports", "description": "List widget problem reports, newest first, with a total count.", "operationId": "list_reports_admin_reports_get", "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } }, { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/reports/{report_id}/status": { "post": { "summary": "Update Report Status", "description": "Mark a report as reviewed (or back to new).", "operationId": "update_report_status_admin_reports__report_id__status_post", "parameters": [ { "name": "report_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Report Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReportStatusUpdateRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/guardrails": { "get": { "summary": "Get Guardrails", "description": "Get current guard config.", "operationId": "get_guardrails_admin_guardrails_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "summary": "Update Guardrails", "description": "Update guard config. Accepts: enabled, block_on_match.", "operationId": "update_guardrails_admin_guardrails_post", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Config" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/spending": { "get": { "summary": "Get All Spending", "description": "Get spending overview.", "operationId": "get_all_spending_admin_spending_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/spending/{tenant_id}": { "get": { "summary": "Get Tenant Spending", "description": "Get spending for a specific tenant.", "operationId": "get_tenant_spending_admin_spending__tenant_id__get", "parameters": [ { "name": "tenant_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Tenant Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "summary": "Set Tenant Budget", "description": "Set per-tenant budget override.\n\nBody: {\"budget\": 100.0}", "operationId": "set_tenant_budget_admin_spending__tenant_id__post", "parameters": [ { "name": "tenant_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Tenant Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Config" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/abuse-config": { "get": { "summary": "Get Abuse Config", "description": "Get the current effective abuse configuration (from file + env).", "operationId": "get_abuse_config_admin_abuse_config_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "summary": "Save Abuse Config", "description": "Save new abuse config directly (admin dashboard alternative endpoint).", "operationId": "save_abuse_config_admin_abuse_config_post", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Data" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/abuse-config/reload": { "post": { "summary": "Reload Abuse Config", "description": "Reload abuse config from disk and apply runtime settings.\n\nCalled by admin-dashboard after saving new config.\nApplies runtime settings (history, loops) to the live settings object.", "operationId": "reload_abuse_config_admin_abuse_config_reload_post", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/llm-providers": { "get": { "summary": "List Llm Providers", "description": "List all LLM providers with masked API keys.", "operationId": "list_llm_providers_admin_llm_providers_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "post": { "summary": "Add Llm Provider", "description": "Add a new LLM provider.\n\nBody:\n name (required): unique provider name\n model (required): model identifier (e.g. openai/gpt-4o, anthropic/claude-3-sonnet)\n provider: provider type \u2014 auto-detected from model prefix if omitted\n api_key: API key (will not be returned in full)\n api_base: custom API base URL\n enabled: whether the provider is active (default: true)", "operationId": "add_llm_provider_admin_llm_providers_post", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Body" } } } }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/llm-provider-list": { "get": { "summary": "List Litellm Providers", "description": "List all available providers from LiteLLM (live, no hardcode).", "operationId": "list_litellm_providers_admin_llm_provider_list_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/llm-providers/{name}": { "get": { "summary": "Get Llm Provider", "description": "Get a single LLM provider with masked API key.", "operationId": "get_llm_provider_admin_llm_providers__name__get", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "put": { "summary": "Update Llm Provider", "description": "Update an existing LLM provider.\n\nOmitted fields keep their current value.\nSet api_key=\"\" to keep existing key (not change it).\nSet api_key=\"__clear__\" to clear the key.", "operationId": "update_llm_provider_admin_llm_providers__name__put", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Body" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "delete": { "summary": "Delete Llm Provider", "description": "Delete an LLM provider.", "operationId": "delete_llm_provider_admin_llm_providers__name__delete", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/llm-providers/{name}/toggle": { "post": { "summary": "Toggle Llm Provider", "description": "Toggle a provider on/off.", "operationId": "toggle_llm_provider_admin_llm_providers__name__toggle_post", "parameters": [ { "name": "name", "in": "path", "required": true, "schema": { "type": "string", "title": "Name" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/admin/llm-config": { "get": { "summary": "Get Llm Config", "description": "Get current LLM provider fallback configuration.", "operationId": "get_llm_config_admin_llm_config_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/backlog": { "get": { "summary": "Backlog List Endpoint", "operationId": "backlog_list_endpoint_api_backlog_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BacklogListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/backlog/errors": { "get": { "summary": "Backlog Errors Endpoint", "operationId": "backlog_errors_endpoint_api_backlog_errors_get", "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "maximum": 200, "minimum": 1, "default": 50, "title": "Limit" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/backlog/{session_id}": { "get": { "summary": "Backlog Detail Endpoint", "operationId": "backlog_detail_endpoint_api_backlog__session_id__get", "parameters": [ { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "default": 500, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 0, "default": 0, "title": "Offset" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BacklogDetailResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/backlog/stats/{session_id}": { "get": { "summary": "Backlog Stats Endpoint", "operationId": "backlog_stats_endpoint_api_backlog_stats__session_id__get", "parameters": [ { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/backlog/export/{session_id}": { "get": { "summary": "Export Backlog", "operationId": "export_backlog_api_backlog_export__session_id__get", "parameters": [ { "name": "session_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Session Id" } }, { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response" }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/api/voice-config": { "get": { "summary": "Get Voice Config", "operationId": "get_voice_config_api_voice_config_get", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }, "put": { "summary": "Update Voice Config", "operationId": "update_voice_config_api_voice_config_put", "parameters": [ { "name": "authorization", "in": "header", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Authorization" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Body" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Update Voice Config Api Voice Config Put" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } } }, "components": { "schemas": { "AbuseConfigOverride": { "properties": { "rps": { "anyOf": [ { "type": "number", "exclusiveMinimum": 0.0 }, { "type": "null" } ], "title": "Rps" }, "burst": { "anyOf": [ { "type": "integer", "minimum": 1.0 }, { "type": "null" } ], "title": "Burst" }, "max_message_length": { "anyOf": [ { "type": "integer", "minimum": 1.0 }, { "type": "null" } ], "title": "Max Message Length" }, "min_interval_ms": { "anyOf": [ { "type": "integer", "minimum": 0.0 }, { "type": "null" } ], "title": "Min Interval Ms" }, "max_user_turns_per_session": { "anyOf": [ { "type": "integer", "minimum": 1.0 }, { "type": "null" } ], "title": "Max User Turns Per Session" }, "block_empty_user_agent": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Block Empty User Agent" }, "blocked_user_agents": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Blocked User Agents" } }, "additionalProperties": false, "type": "object", "title": "AbuseConfigOverride", "description": "Restrictive per-agent anti-abuse overrides with an explicit public contract." }, "AgentCreateRequest": { "properties": { "name": { "type": "string", "minLength": 1, "pattern": "^[a-z][a-z0-9_-]*$", "title": "Name", "description": "Unique agent name (lowercase, no spaces)" }, "description": { "type": "string", "title": "Description", "description": "Human-readable description", "default": "" }, "tenant_ids": { "items": { "type": "string" }, "type": "array", "title": "Tenant Ids", "description": "Tenant IDs for this agent" }, "widget_config": { "anyOf": [ { "$ref": "#/components/schemas/WidgetConfig" }, { "type": "null" } ], "description": "Embed widget display configuration" }, "llm_config": { "anyOf": [ { "$ref": "#/components/schemas/LLMConfig" }, { "type": "null" } ], "description": "Per-agent LLM overrides" }, "provider_priority": { "items": { "type": "string" }, "type": "array", "title": "Provider Priority", "description": "Provider names in priority order (from ProviderStore)" }, "abuse_config": { "anyOf": [ { "$ref": "#/components/schemas/AbuseConfigOverride" }, { "type": "null" } ], "description": "Per-agent anti-abuse overrides; only explicit AbuseConfigOverride fields are accepted" }, "system_prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "System Prompt", "description": "Per-agent system prompt override" }, "voice_config": { "anyOf": [ { "$ref": "#/components/schemas/VoiceAgentConfig" }, { "type": "null" } ], "description": "Per-agent voice configuration overrides" } }, "type": "object", "required": [ "name" ], "title": "AgentCreateRequest", "description": "Request to create a new agent." }, "AgentListResponse": { "properties": { "agents": { "items": { "$ref": "#/components/schemas/AgentResponse" }, "type": "array", "title": "Agents", "description": "List of agents" } }, "type": "object", "required": [ "agents" ], "title": "AgentListResponse", "description": "List of agents." }, "AgentResponse": { "properties": { "name": { "type": "string", "title": "Name", "description": "Unique agent name" }, "description": { "type": "string", "title": "Description", "description": "Human-readable description", "default": "" }, "tenant_ids": { "items": { "type": "string" }, "type": "array", "title": "Tenant Ids", "description": "Tenant IDs" }, "widget_config": { "anyOf": [ { "$ref": "#/components/schemas/WidgetConfig" }, { "type": "null" } ], "description": "Embed widget display configuration" }, "llm_config": { "anyOf": [ { "$ref": "#/components/schemas/LLMConfig" }, { "type": "null" } ], "description": "Per-agent LLM overrides" }, "provider_priority": { "items": { "type": "string" }, "type": "array", "title": "Provider Priority", "description": "Provider names in priority order (from ProviderStore)" }, "abuse_config": { "anyOf": [ { "$ref": "#/components/schemas/AbuseConfigOverride" }, { "type": "null" } ], "description": "Per-agent anti-abuse overrides; legacy message-based quota fields are rejected" }, "system_prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "System Prompt", "description": "Per-agent system prompt override" }, "voice_config": { "anyOf": [ { "$ref": "#/components/schemas/VoiceAgentConfig" }, { "type": "null" } ], "description": "Per-agent voice configuration overrides" }, "created_at": { "type": "string", "title": "Created At", "description": "ISO timestamp" }, "updated_at": { "type": "string", "title": "Updated At", "description": "ISO timestamp" } }, "type": "object", "required": [ "name", "created_at", "updated_at" ], "title": "AgentResponse", "description": "Agent metadata." }, "AgentUpdateRequest": { "properties": { "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Description", "description": "Human-readable description" }, "tenant_ids": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Tenant Ids", "description": "Tenant IDs for this agent" }, "widget_config": { "anyOf": [ { "$ref": "#/components/schemas/WidgetConfig" }, { "type": "null" } ], "description": "Embed widget display configuration" }, "llm_config": { "anyOf": [ { "$ref": "#/components/schemas/LLMConfig" }, { "type": "null" } ], "description": "Per-agent LLM overrides" }, "provider_priority": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Provider Priority", "description": "Provider names in priority order (from ProviderStore)" }, "abuse_config": { "anyOf": [ { "$ref": "#/components/schemas/AbuseConfigOverride" }, { "type": "null" } ], "description": "Per-agent anti-abuse overrides; legacy message-based quota fields are rejected" }, "system_prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "System Prompt", "description": "Per-agent system prompt override" }, "voice_config": { "anyOf": [ { "$ref": "#/components/schemas/VoiceAgentConfig" }, { "type": "null" } ], "description": "Per-agent voice configuration overrides" } }, "type": "object", "title": "AgentUpdateRequest", "description": "Request to update an existing agent." }, "BacklogDetailResponse": { "properties": { "records": { "items": { "$ref": "#/components/schemas/BacklogEvent" }, "type": "array", "title": "Records", "description": "List of session events" }, "session_id": { "type": "string", "title": "Session Id", "description": "Requested session ID" }, "count": { "type": "integer", "title": "Count", "description": "Number of records" } }, "type": "object", "required": [ "records", "session_id", "count" ], "title": "BacklogDetailResponse", "description": "Events of a specific backlog session." }, "BacklogEvent": { "properties": { "session_id": { "type": "string", "title": "Session Id", "description": "Session ID" }, "turn_id": { "type": "string", "title": "Turn Id", "description": "Turn ID" }, "iteration": { "type": "integer", "title": "Iteration", "description": "Iteration number" }, "event": { "type": "string", "title": "Event", "description": "Event type" }, "ts": { "type": "string", "title": "Ts", "description": "Timestamp" }, "data": { "additionalProperties": true, "type": "object", "title": "Data", "description": "Event data" } }, "additionalProperties": true, "type": "object", "required": [ "session_id", "turn_id", "iteration", "event", "ts", "data" ], "title": "BacklogEvent", "description": "A single event/record in a backlog session.\n\nFields vary by ``event`` type \u2014 ``model_response`` events contain\n``duration_ms`` and ``tokens``. Extra fields are preserved via\n``extra='allow'``." }, "BacklogListResponse": { "properties": { "sessions": { "items": { "$ref": "#/components/schemas/BacklogSessionMetadata" }, "type": "array", "title": "Sessions", "description": "List of session metadata entries" } }, "type": "object", "required": [ "sessions" ], "title": "BacklogListResponse", "description": "List of backlog sessions." }, "BacklogSessionMetadata": { "properties": { "session_id": { "type": "string", "title": "Session Id", "description": "Session ID" }, "size_bytes": { "type": "integer", "title": "Size Bytes", "description": "File size in bytes" }, "num_events": { "type": "integer", "title": "Num Events", "description": "Number of events" }, "first_event": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "First Event", "description": "First event" }, "last_event": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Last Event", "description": "Last event" } }, "type": "object", "required": [ "session_id", "size_bytes", "num_events" ], "title": "BacklogSessionMetadata", "description": "Metadata for one backlog session entry." }, "Body_chat_voice_endpoint_api_chat_voice_post": { "properties": { "audio": { "type": "string", "contentMediaType": "application/octet-stream", "title": "Audio" }, "session_id": { "type": "string", "title": "Session Id" }, "agent": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Agent" }, "lang": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Lang" } }, "type": "object", "required": [ "audio", "session_id" ], "title": "Body_chat_voice_endpoint_api_chat_voice_post" }, "ChatMessage": { "properties": { "role": { "type": "string", "title": "Role", "description": "Role: user / assistant / system" }, "content": { "type": "string", "title": "Content", "description": "Message text", "default": "" }, "tool_calls": { "anyOf": [ { "items": { "additionalProperties": true, "type": "object" }, "type": "array" }, { "type": "null" } ], "title": "Tool Calls", "description": "Tool calls" } }, "type": "object", "required": [ "role" ], "title": "ChatMessage", "description": "A single message in chat history." }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "HealthResponse": { "properties": { "api": { "type": "string", "title": "Api", "default": "ok" }, "ollama": { "additionalProperties": true, "type": "object", "title": "Ollama", "description": "LLM provider connection status" } }, "type": "object", "required": [ "ollama" ], "title": "HealthResponse", "description": "API service health status." }, "LLMConfig": { "properties": { "provider": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Provider", "description": "LLM provider: ollama, mistral, openai, anthropic" }, "api_key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Api Key", "description": "API key for the provider" }, "model": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Model", "description": "Model name (e.g. qwen2.5:0.5b or mistral/mistral-small)" }, "api_base": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Api Base", "description": "Base URL for the API" }, "system_prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "System Prompt", "description": "System prompt (overrides global)" }, "temperature": { "anyOf": [ { "type": "number", "maximum": 2.0, "minimum": 0.0 }, { "type": "null" } ], "title": "Temperature", "description": "Model temperature" }, "max_tokens": { "anyOf": [ { "type": "integer", "minimum": 1.0 }, { "type": "null" } ], "title": "Max Tokens", "description": "Maximum tokens in response" } }, "type": "object", "title": "LLMConfig", "description": "Per-agent LLM configuration. All fields optional \u2014 falls back to global defaults when null." }, "ReportCreateRequest": { "properties": { "agent": { "type": "string", "maxLength": 128, "minLength": 1, "title": "Agent", "description": "Agent name" }, "session_id": { "type": "string", "maxLength": 128, "minLength": 1, "title": "Session Id", "description": "Widget session id" }, "lang": { "anyOf": [ { "type": "string", "pattern": "^(ru|en)$" }, { "type": "null" } ], "title": "Lang", "description": "Widget language" }, "message": { "$ref": "#/components/schemas/ReportMessageContext", "description": "The message being reported" }, "transcript": { "items": { "$ref": "#/components/schemas/ReportTranscriptMessage" }, "type": "array", "maxItems": 20, "title": "Transcript", "description": "Recent session transcript (client-capped)" }, "comment": { "anyOf": [ { "type": "string", "maxLength": 1000 }, { "type": "null" } ], "title": "Comment", "description": "Optional visitor comment" }, "last_error": { "anyOf": [ { "$ref": "#/components/schemas/ReportLastError" }, { "type": "null" } ], "description": "Last error seen in this session" }, "page_url": { "anyOf": [ { "type": "string", "maxLength": 2048 }, { "type": "null" } ], "title": "Page Url", "description": "Host page URL the widget runs on" } }, "additionalProperties": false, "type": "object", "required": [ "agent", "session_id", "message" ], "title": "ReportCreateRequest", "description": "Widget problem report payload (public ``POST /api/reports``).\n\nStored verbatim for operator review; the content is never fed to the LLM,\nso report text cannot steer model behaviour." }, "ReportLastError": { "properties": { "text": { "type": "string", "maxLength": 500, "title": "Text", "description": "Error bubble text", "default": "" }, "correlation_id": { "anyOf": [ { "type": "string", "maxLength": 64 }, { "type": "null" } ], "title": "Correlation Id", "description": "Correlation id from the SSE error event" } }, "additionalProperties": false, "type": "object", "title": "ReportLastError", "description": "Last SSE error observed by the widget, with its correlation id." }, "ReportMessageContext": { "properties": { "kind": { "type": "string", "pattern": "^(assistant|error)$", "title": "Kind", "description": "assistant answer or an error bubble", "default": "assistant" }, "text": { "type": "string", "maxLength": 4000, "title": "Text", "description": "Message text", "default": "" }, "tools": { "items": { "type": "string" }, "type": "array", "maxItems": 20, "title": "Tools", "description": "Tool names used for the answer" }, "display_names": { "items": { "type": "string" }, "type": "array", "maxItems": 20, "title": "Display Names", "description": "Human-readable tool labels" } }, "additionalProperties": false, "type": "object", "title": "ReportMessageContext", "description": "The assistant message a visitor is complaining about." }, "ReportStatusUpdateRequest": { "properties": { "status": { "type": "string", "pattern": "^(new|reviewed)$", "title": "Status", "description": "New status" } }, "additionalProperties": false, "type": "object", "required": [ "status" ], "title": "ReportStatusUpdateRequest", "description": "Operator update of a report's review status." }, "ReportTranscriptMessage": { "properties": { "kind": { "type": "string", "pattern": "^(user|assistant)$", "title": "Kind", "description": "Message kind" }, "text": { "type": "string", "maxLength": 2000, "title": "Text", "description": "Message text", "default": "" }, "tools": { "items": { "type": "string" }, "type": "array", "maxItems": 20, "title": "Tools" }, "ts": { "anyOf": [ { "type": "string", "maxLength": 64 }, { "type": "null" } ], "title": "Ts", "description": "Client timestamp" } }, "additionalProperties": false, "type": "object", "required": [ "kind" ], "title": "ReportTranscriptMessage", "description": "One transcript entry attached to a widget problem report." }, "SessionHistoryResponse": { "properties": { "messages": { "items": { "$ref": "#/components/schemas/ChatMessage" }, "type": "array", "title": "Messages", "description": "Messages (role, content, tool_calls)" } }, "type": "object", "required": [ "messages" ], "title": "SessionHistoryResponse", "description": "Chat message history for a session." }, "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" }, "VoiceAgentConfig": { "properties": { "enabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Enabled", "description": "Override master switch for this agent" }, "stt_provider": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Stt Provider", "description": "STT provider name (must match a name in VoiceConfig.stt_providers)" }, "stt_fallback": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Stt Fallback", "description": "Override STT fallback setting for this agent" }, "voice_input_disabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "title": "Voice Input Disabled", "description": "Explicitly disable voice input for this agent (hide mic in widget)" } }, "type": "object", "title": "VoiceAgentConfig", "description": "Per-agent STT voice configuration overrides.\n\nAll fields are optional (None = fall back to global VoiceConfig)." }, "WidgetConfig": { "properties": { "title": { "type": "string", "title": "Title", "description": "Widget header title", "default": "\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442" }, "greeting": { "type": "string", "title": "Greeting", "description": "Greeting message in chat", "default": "\u0427\u0435\u043c \u043c\u043e\u0433\u0443 \u043f\u043e\u043c\u043e\u0447\u044c?" }, "accent_color": { "type": "string", "title": "Accent Color", "description": "Accent color (hex)", "default": "#0f766e" }, "position": { "type": "string", "title": "Position", "description": "Widget position: right | left", "default": "right" } }, "type": "object", "title": "WidgetConfig", "description": "Embed widget display configuration for an agent." } } } }