{"openapi":"3.1.0","info":{"title":"Trustify Gateway","description":"MCP proxy layer for AI bias detection and compliance","version":"0.1.0"},"paths":{"/v1/{path}":{"delete":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Compat","description":"OpenAI-compatible transparent proxy (backward-compat mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/v1/\")","operationId":"proxy_openai_compat_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Compat","description":"OpenAI-compatible transparent proxy (backward-compat mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/v1/\")","operationId":"proxy_openai_compat_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Compat","description":"OpenAI-compatible transparent proxy (backward-compat mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/v1/\")","operationId":"proxy_openai_compat_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Compat","description":"OpenAI-compatible transparent proxy (backward-compat mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/v1/\")","operationId":"proxy_openai_compat_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Compat","description":"OpenAI-compatible transparent proxy (backward-compat mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/v1/\")","operationId":"proxy_openai_compat_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/openai/v1/{path}":{"delete":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Explicit","description":"OpenAI transparent proxy (explicit mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/openai/v1/\")","operationId":"proxy_openai_explicit_openai_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Explicit","description":"OpenAI transparent proxy (explicit mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/openai/v1/\")","operationId":"proxy_openai_explicit_openai_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Explicit","description":"OpenAI transparent proxy (explicit mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/openai/v1/\")","operationId":"proxy_openai_explicit_openai_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Explicit","description":"OpenAI transparent proxy (explicit mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/openai/v1/\")","operationId":"proxy_openai_explicit_openai_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Transparent Proxy"],"summary":"Proxy Openai Explicit","description":"OpenAI transparent proxy (explicit mount).\n\n    client = OpenAI(api_key=\"sk-...\", base_url=\"http://localhost:8000/openai/v1/\")","operationId":"proxy_openai_explicit_openai_v1__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anthropic/{path}":{"delete":{"tags":["Transparent Proxy"],"summary":"Proxy Anthropic","description":"Anthropic transparent proxy.\n\n    client = anthropic.Anthropic(\n        api_key=\"sk-ant-...\",\n        base_url=\"http://localhost:8000/anthropic\",\n    )\n\nAll Anthropic API paths work: /v1/messages, /v1/models, etc.\nThe original  x-api-key  (Anthropic auth) and  anthropic-version  headers\nare forwarded untouched.","operationId":"proxy_anthropic_anthropic__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Transparent Proxy"],"summary":"Proxy Anthropic","description":"Anthropic transparent proxy.\n\n    client = anthropic.Anthropic(\n        api_key=\"sk-ant-...\",\n        base_url=\"http://localhost:8000/anthropic\",\n    )\n\nAll Anthropic API paths work: /v1/messages, /v1/models, etc.\nThe original  x-api-key  (Anthropic auth) and  anthropic-version  headers\nare forwarded untouched.","operationId":"proxy_anthropic_anthropic__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Transparent Proxy"],"summary":"Proxy Anthropic","description":"Anthropic transparent proxy.\n\n    client = anthropic.Anthropic(\n        api_key=\"sk-ant-...\",\n        base_url=\"http://localhost:8000/anthropic\",\n    )\n\nAll Anthropic API paths work: /v1/messages, /v1/models, etc.\nThe original  x-api-key  (Anthropic auth) and  anthropic-version  headers\nare forwarded untouched.","operationId":"proxy_anthropic_anthropic__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Transparent Proxy"],"summary":"Proxy Anthropic","description":"Anthropic transparent proxy.\n\n    client = anthropic.Anthropic(\n        api_key=\"sk-ant-...\",\n        base_url=\"http://localhost:8000/anthropic\",\n    )\n\nAll Anthropic API paths work: /v1/messages, /v1/models, etc.\nThe original  x-api-key  (Anthropic auth) and  anthropic-version  headers\nare forwarded untouched.","operationId":"proxy_anthropic_anthropic__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Transparent Proxy"],"summary":"Proxy Anthropic","description":"Anthropic transparent proxy.\n\n    client = anthropic.Anthropic(\n        api_key=\"sk-ant-...\",\n        base_url=\"http://localhost:8000/anthropic\",\n    )\n\nAll Anthropic API paths work: /v1/messages, /v1/models, etc.\nThe original  x-api-key  (Anthropic auth) and  anthropic-version  headers\nare forwarded untouched.","operationId":"proxy_anthropic_anthropic__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gemini/{path}":{"delete":{"tags":["Transparent Proxy"],"summary":"Proxy Gemini","description":"Google Gemini transparent proxy.\n\n    # google-genai SDK\n    client = genai.Client(\n        api_key=\"AIza...\",\n        http_options={\"base_url\": \"http://localhost:8000/gemini\"},\n    )\n\n    # OR direct REST\n    # POST http://localhost:8000/gemini/v1beta/models/gemini-2.0-flash:generateContent\n\nThe API key (?key= query param or x-goog-api-key header) is forwarded as-is.","operationId":"proxy_gemini_gemini__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Transparent Proxy"],"summary":"Proxy Gemini","description":"Google Gemini transparent proxy.\n\n    # google-genai SDK\n    client = genai.Client(\n        api_key=\"AIza...\",\n        http_options={\"base_url\": \"http://localhost:8000/gemini\"},\n    )\n\n    # OR direct REST\n    # POST http://localhost:8000/gemini/v1beta/models/gemini-2.0-flash:generateContent\n\nThe API key (?key= query param or x-goog-api-key header) is forwarded as-is.","operationId":"proxy_gemini_gemini__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Transparent Proxy"],"summary":"Proxy Gemini","description":"Google Gemini transparent proxy.\n\n    # google-genai SDK\n    client = genai.Client(\n        api_key=\"AIza...\",\n        http_options={\"base_url\": \"http://localhost:8000/gemini\"},\n    )\n\n    # OR direct REST\n    # POST http://localhost:8000/gemini/v1beta/models/gemini-2.0-flash:generateContent\n\nThe API key (?key= query param or x-goog-api-key header) is forwarded as-is.","operationId":"proxy_gemini_gemini__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Transparent Proxy"],"summary":"Proxy Gemini","description":"Google Gemini transparent proxy.\n\n    # google-genai SDK\n    client = genai.Client(\n        api_key=\"AIza...\",\n        http_options={\"base_url\": \"http://localhost:8000/gemini\"},\n    )\n\n    # OR direct REST\n    # POST http://localhost:8000/gemini/v1beta/models/gemini-2.0-flash:generateContent\n\nThe API key (?key= query param or x-goog-api-key header) is forwarded as-is.","operationId":"proxy_gemini_gemini__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Transparent Proxy"],"summary":"Proxy Gemini","description":"Google Gemini transparent proxy.\n\n    # google-genai SDK\n    client = genai.Client(\n        api_key=\"AIza...\",\n        http_options={\"base_url\": \"http://localhost:8000/gemini\"},\n    )\n\n    # OR direct REST\n    # POST http://localhost:8000/gemini/v1beta/models/gemini-2.0-flash:generateContent\n\nThe API key (?key= query param or x-goog-api-key header) is forwarded as-is.","operationId":"proxy_gemini_gemini__path__delete","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["Health"],"summary":"Health Check","description":"Health check — verifies API is running.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheck"}}}}}}},"/api/v1/detectors":{"get":{"tags":["Detectors"],"summary":"List all available bias detectors","description":"Return the full list of detectors supported by the TrustEngine,\nalong with their display names and descriptions.","operationId":"list_detectors_api_v1_detectors_get","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DetectorInfo"},"title":"Response List Detectors Api V1 Detectors Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/detectors/preferences":{"get":{"tags":["Detectors"],"summary":"Get the current user's detector preferences","description":"Return the authenticated user's detector on/off preferences.\nRequires JWT authentication (not supported for raw API-key callers).","operationId":"get_detector_preferences_api_v1_detectors_preferences_get","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectorPrefsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Detectors"],"summary":"Update the current user's detector preferences","description":"Enable or disable specific detectors for the authenticated user.\n\nRules enforced server-side:\n- At least one detector must remain enabled (cannot disable all detectors).\n- Unknown detector IDs are silently ignored.","operationId":"update_detector_preferences_api_v1_detectors_preferences_put","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectorPrefsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectorPrefsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyze":{"post":{"tags":["Analysis"],"summary":"Analyse a prompt for bias","description":"Run Trustify's full bias-detection pipeline on a single prompt.\n\nThe engine:\n1. Generates a model completion for the prompt.\n2. Runs detectors in parallel:\n   - **GenderCounterfactualDetector** — gender counterfactual divergence\n   - **ToxicityDifferentialDetector** — toxicity and harmful content scoring\n   - **SentimentParityDetector** — 7-group demographic sentiment parity\n3. Aggregates results into a composite TrustReport.\n\nResults are cached in Redis (TTL: 1 hour) and persisted to MongoDB.\nDetectors disabled by the authenticated user are honoured per-request.","operationId":"analyze_prompt_api_v1_analyze_post","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeRequest"}}}},"responses":{"200":{"description":"Full TrustReport with per-detector scores","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analyze/batch":{"post":{"tags":["Analysis"],"summary":"Analyse multiple prompts in parallel","description":"Run trust analysis on a list of prompts with controlled concurrency.\n\nEach prompt is individually cache-checked before hitting the LLM APIs.\nUp to `concurrency` prompts are analysed simultaneously (default 5).","operationId":"analyze_batch_api_v1_analyze_batch_post","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchAnalyzeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchTrustReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports/{request_id}":{"get":{"tags":["Reports"],"summary":"Retrieve a stored TrustReport by ID","description":"Fetch a previously generated TrustReport from MongoDB by its `request_id`.\nReturns 404 if the report does not exist.","operationId":"get_report_api_v1_reports__request_id__get","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/verify/{report_id}":{"get":{"tags":["Verify"],"summary":"Publicly verify a TrustReport by its unique ID","description":"Public endpoint — no authentication required.\n\nGiven a report's ``report_id`` (the UUID assigned at analysis time),\nreturns the full TrustReport including detector scores, flags, severity,\ncomposite trust score and EU AI Act compliance mapping.\n\nReturns 404 if no report with that ID exists.\n\nThis endpoint is intentionally unauthenticated so that externally-generated\nreports can be independently verified by third parties.","operationId":"verify_report_api_v1_verify__report_id__get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/reports":{"get":{"tags":["Reports"],"summary":"List all TrustReports","description":"Return a paginated list of trust reports (newest first), scoped to the caller's keys.","operationId":"list_reports_api_v1_reports_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"name":"min_score","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Filter by min trust score","title":"Min Score"},"description":"Filter by min trust score"},{"name":"max_score","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Filter by max trust score","title":"Max Score"},"description":"Filter by max trust score"},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by severity: critical/high/medium/low/none","title":"Severity"},"description":"Filter by severity: critical/high/medium/low/none"},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/overview":{"get":{"tags":["Analytics"],"summary":"Dashboard overview statistics","description":"Return aggregate statistics for the dashboard overview cards:\n- total_requests, avg_trust_score, flagged_count, by_severity, by_detector\n\nAll heavy computation is performed inside MongoDB via aggregation pipelines\nso that no individual documents need to be transferred to the application\nlayer. This remains correct regardless of collection size.","operationId":"analytics_overview_api_v1_analytics_overview_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Rolling window in days","default":7,"title":"Days"},"description":"Rolling window in days"},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/analytics/trend":{"get":{"tags":["Analytics"],"summary":"Trust score trend over time","description":"Return daily aggregates useful for a Recharts LineChart:\n[{date, avg_score, request_count, flagged_count}]\n\nGrouping by calendar day is performed entirely inside MongoDB so only\nthe aggregated result (≤ `days` rows) is transferred to Python, not\nthe full collection of individual log documents.","operationId":"analytics_trend_api_v1_analytics_trend_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of days to look back","default":7,"title":"Days"},"description":"Number of days to look back"},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance/report":{"get":{"tags":["Compliance"],"summary":"Get Compliance Report","description":"Aggregated EU AI Act compliance report.\n\nFast path (no date filter): reads a single precomputed document from the\ncompliance_cache collection — O(number of API keys), not O(analyses).\n\nThe cache is updated atomically after every analysis.  On first use after\ndeployment (cold start) it is populated from existing data, which is slow\nonce; every subsequent request is instant.\n\nDate-filtered requests fall back to on-demand computation because the\ncache stores all-time totals only.","operationId":"get_compliance_report_api_v1_compliance_report_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2024-01-01","title":"Start Date"},"description":"ISO date, e.g. 2024-01-01"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2024-12-31","title":"End Date"},"description":"ISO date, e.g. 2024-12-31"},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/compliance/snapshot":{"post":{"tags":["Compliance"],"summary":"Persist a compliance report snapshot and return its verifiable TRF ID","description":"Called by the dashboard before rendering a compliance PDF export.\nStores the compliance metrics in MongoDB under a unique ``TRF-XXXXXXXX``\nreport ID so that the ID printed in the PDF can later be verified via\n``GET /api/v1/verify/{report_id}`` (public endpoint, no auth required).\n\nReturns ``{report_id, verified_url}``.","operationId":"create_compliance_snapshot_api_v1_compliance_snapshot_post","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceSnapshotRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys":{"post":{"tags":["Key Management"],"summary":"Create a new API key","description":"Generate a new Trustify API key for an organisation.\n\nThe plain-text key is returned **once** in `api_key` — store it securely.\nOnly the SHA-256 hash is persisted in MongoDB; the raw value is discarded.","operationId":"create_key_api_v1_keys_post","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Key Management"],"summary":"List API keys","description":"List API keys (metadata only — plain-text keys are never stored).\n\nWhen called with a JWT Bearer token, returns only keys owned by the\nauthenticated user.  When called with a TRUSTIFY-API-KEY, returns all\nkeys (admin-style access).","operationId":"list_keys_api_v1_keys_get","parameters":[{"name":"organization_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by organisation","title":"Organization Name"},"description":"Filter by organisation"},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys/{key_id}":{"delete":{"tags":["Key Management"],"summary":"Revoke an API key","description":"Deactivate a key by its document ID. It can no longer be used for auth.","operationId":"revoke_key_api_v1_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys/{key_id}/permanent":{"delete":{"tags":["Key Management"],"summary":"Permanently delete an API key","description":"Permanently erase a key from MongoDB — it will no longer appear in any\nlisting or be usable for authentication. This action is irreversible.\nUse DELETE /api/v1/keys/{key_id} for a soft revoke instead.","operationId":"delete_key_api_v1_keys__key_id__permanent_delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/keys/{key_id}/rotate":{"post":{"tags":["Key Management"],"summary":"Rotate an API key","description":"Create a new key for the same organisation and immediately revoke the old one.\nThe new plain-text key is returned once — store it securely.","operationId":"rotate_key_api_v1_keys__key_id__rotate_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["Auth"],"summary":"Register a dashboard account","operationId":"auth_register_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Login and obtain a JWT","operationId":"auth_login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["Auth"],"summary":"Verify token and return current user","operationId":"auth_me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/auth/logout":{"post":{"tags":["Auth"],"summary":"Logout and revoke Keycloak session","description":"Revokes the Keycloak session via the refresh token (if provided in the\nX-Refresh-Token header or the JSON body).  The client must also discard\nits locally stored tokens.","operationId":"auth_logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/account":{"delete":{"tags":["Auth"],"summary":"Permanently delete the authenticated user's account","description":"Permanently removes the Keycloak account of the currently authenticated user.\nThe user will be immediately unable to log in again.\nAll existing API keys and reports remain in the database but will be\ninaccessible because the credential no longer exists in Keycloak.\nThe client **must** discard its locally stored tokens after this call.","operationId":"auth_delete_account_api_v1_auth_account_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/billing/plan":{"get":{"tags":["Billing"],"summary":"Get the authenticated user's current subscription plan","description":"Returns the current plan ('free', 'starter', or 'pro') and its per-request rate.","operationId":"get_billing_plan_api_v1_billing_plan_get","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Billing"],"summary":"Subscribe to a plan (starter or pro)","description":"Subscribe the authenticated user to a plan.\nBody: { \"plan\": \"starter\" | \"pro\" | \"free\" }\nPaid plans require a saved payment method (mock or Stripe).\nIn Stripe mode a monthly metered subscription is created / updated / cancelled\nautomatically so the user is charged on their billing anniversary each month.","operationId":"set_billing_plan_api_v1_billing_plan_post","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"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"}}}}}}},"/api/v1/billing/payment-methods":{"get":{"tags":["Billing"],"summary":"List saved payment methods for the authenticated user","operationId":"list_payment_methods_api_v1_billing_payment_methods_get","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Billing"],"summary":"Add a mock payment method (development / mock mode only)","description":"Saves a payment method in mock mode.  The full card number and CVV are\nnever sent to the server — only the last4, brand, expiry, and cardholder\nname are stored in MongoDB.\n\nIn Stripe mode this endpoint returns 400; use POST /api/v1/billing/setup-intent\nfollowed by POST /api/v1/billing/payment-methods/stripe/confirm instead.","operationId":"add_mock_payment_method_api_v1_billing_payment_methods_post","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMockPaymentMethodRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/payment-methods/{pm_id}":{"delete":{"tags":["Billing"],"summary":"Remove a saved payment method","operationId":"delete_payment_method_api_v1_billing_payment_methods__pm_id__delete","parameters":[{"name":"pm_id","in":"path","required":true,"schema":{"type":"string","title":"Pm Id"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/payment-methods/{pm_id}/default":{"put":{"tags":["Billing"],"summary":"Set a payment method as the default","operationId":"set_default_payment_method_api_v1_billing_payment_methods__pm_id__default_put","parameters":[{"name":"pm_id","in":"path","required":true,"schema":{"type":"string","title":"Pm Id"}},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/setup-intent":{"post":{"tags":["Billing"],"summary":"Create a Stripe SetupIntent (Stripe mode only)","description":"Creates a Stripe SetupIntent so the frontend can collect card details via\nStripe.js without the card data ever touching our servers.\n\nReturns { client_secret, customer_id }.\nOnly available when PAYMENT_MODE=stripe.","operationId":"create_stripe_setup_intent_api_v1_billing_setup_intent_post","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/payment-methods/stripe/confirm":{"post":{"tags":["Billing"],"summary":"Confirm a Stripe PaymentMethod after SetupIntent completes (Stripe mode only)","description":"After Stripe.js confirms the SetupIntent on the client side, the browser\nsends the resulting PaymentMethod ID here.  The backend retrieves the card\nmetadata from Stripe and persists it locally.\n\nBody: { \"payment_method_id\": \"pm_...\" }","operationId":"confirm_stripe_payment_method_api_v1_billing_payment_methods_stripe_confirm_post","parameters":[{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"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"}}}}}}},"/api/v1/billing/usage":{"get":{"tags":["Billing"],"summary":"Spending estimate grouped by key, provider, day and month","description":"Returns spending estimates for the authenticated user based on the number\nof analysis requests processed through each API key.\n\nBilling is a flat per-request rate determined by the user's plan:\n- Starter → $0.004 / request\n- Pro     → $0.005 / request\n\nProvider breakdown shows request counts only (no per-provider billing).","operationId":"billing_usage_api_v1_billing_usage_get","parameters":[{"name":"months","in":"query","required":false,"schema":{"type":"integer","maximum":12,"minimum":1,"description":"Number of past months to include","default":3,"title":"Months"},"description":"Number of past months to include"},{"name":"trustify-api-key","in":"header","required":false,"schema":{"type":"string","title":"Trustify-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AddMockPaymentMethodRequest":{"properties":{"last4":{"type":"string","maxLength":4,"minLength":4,"pattern":"^\\d{4}$","title":"Last4"},"brand":{"type":"string","maxLength":20,"minLength":1,"title":"Brand"},"exp_month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Exp Month"},"exp_year":{"type":"integer","maximum":2099.0,"minimum":2024.0,"title":"Exp Year"},"cardholder":{"type":"string","maxLength":120,"title":"Cardholder","default":""}},"type":"object","required":["last4","brand","exp_month","exp_year"],"title":"AddMockPaymentMethodRequest","description":"Request body for POST /api/v1/billing/payment-methods (mock mode only).\n\nThe full card number and CVV are validated and processed client-side; only\nthe non-sensitive display fields are sent to the server — mirroring the\nway Stripe tokenises card data in production."},"AnalyzeRequest":{"properties":{"prompt":{"type":"string","maxLength":32000,"minLength":1,"title":"Prompt"},"response":{"anyOf":[{"type":"string","maxLength":64000},{"type":"null"}],"title":"Response","description":"Pre-generated LLM response to analyse. When provided the engine skips its internal completion call and analyses this response directly."},"provider":{"type":"string","title":"Provider","description":"Completion provider: 'openai' or 'anthropic'","default":"openai"},"model":{"type":"string","title":"Model","description":"Override model name. Leave blank to use provider default.","default":""},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.7},"max_tokens":{"type":"integer","maximum":8000.0,"minimum":1.0,"title":"Max Tokens","default":800}},"type":"object","required":["prompt"],"title":"AnalyzeRequest","description":"Request body for single-prompt trust analysis."},"BatchAnalyzeRequest":{"properties":{"prompts":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Prompts"},"provider":{"type":"string","title":"Provider","default":"openai"},"model":{"type":"string","title":"Model","default":""},"concurrency":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Concurrency","default":5}},"type":"object","required":["prompts"],"title":"BatchAnalyzeRequest","description":"Request body for batch trust analysis."},"BatchTrustReportResponse":{"properties":{"total":{"type":"integer","title":"Total"},"reports":{"items":{"$ref":"#/components/schemas/TrustReportResponse"},"type":"array","title":"Reports"}},"type":"object","required":["total","reports"],"title":"BatchTrustReportResponse","description":"HTTP response for batch analysis."},"ComplianceSnapshotRequest":{"properties":{"status":{"type":"string","title":"Status"},"total_analyses":{"type":"integer","title":"Total Analyses"},"eu_ai_act_relevant_count":{"type":"integer","title":"Eu Ai Act Relevant Count"},"avg_trust_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Trust Score"},"overall_compliance_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall Compliance Rate"},"detector_compliance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detector Compliance"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"owner_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Username"},"owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Email"}},"type":"object","required":["status","total_analyses","eu_ai_act_relevant_count"],"title":"ComplianceSnapshotRequest"},"CreateKeyRequest":{"properties":{"organization_name":{"type":"string","maxLength":120,"minLength":1,"title":"Organization Name","description":"Human-readable organisation / project name for this key.","examples":["acme-production"]},"expires_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires Hours","description":"Hours until this key expires. Allowed: 24, 48, 168 (1 week). Omit for no expiration."}},"type":"object","required":["organization_name"],"title":"CreateKeyRequest","description":"Request body for creating a new API key."},"CreateKeyResponse":{"properties":{"key_id":{"type":"string","title":"Key Id"},"api_key":{"type":"string","title":"Api Key","description":"Plain-text key — shown once, never stored."},"organization_name":{"type":"string","title":"Organization Name"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"active":{"type":"boolean","title":"Active"},"message":{"type":"string","title":"Message"}},"type":"object","required":["key_id","api_key","organization_name","created_at","active","message"],"title":"CreateKeyResponse","description":"Returned ONCE after key creation — api_key is never stored."},"DetectorInfo":{"properties":{"id":{"type":"string","title":"Id"},"display_name":{"type":"string","title":"Display Name"},"description":{"type":"string","title":"Description"},"eu_ai_act_relevant":{"type":"boolean","title":"Eu Ai Act Relevant"},"default_enabled":{"type":"boolean","title":"Default Enabled"},"pre_release":{"type":"boolean","title":"Pre Release","default":false}},"type":"object","required":["id","display_name","description","eu_ai_act_relevant","default_enabled"],"title":"DetectorInfo","description":"Metadata about a single available detector."},"DetectorPrefsRequest":{"properties":{"disabled_detectors":{"items":{"type":"string"},"type":"array","title":"Disabled Detectors","description":"List of detector IDs to disable. Must leave at least one detector enabled."}},"type":"object","title":"DetectorPrefsRequest","description":"Request body for updating detector preferences."},"DetectorPrefsResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"disabled_detectors":{"items":{"type":"string"},"type":"array","title":"Disabled Detectors"},"enabled_detectors":{"items":{"type":"string"},"type":"array","title":"Enabled Detectors"}},"type":"object","required":["user_id","disabled_detectors","enabled_detectors"],"title":"DetectorPrefsResponse","description":"Response describing the user's current detector preferences."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthCheck":{"properties":{"status":{"type":"string","title":"Status","default":"healthy"},"version":{"type":"string","title":"Version"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"}},"type":"object","required":["version","timestamp"],"title":"HealthCheck","description":"Health check response."},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"LoginResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"user":{"$ref":"#/components/schemas/UserInfo"}},"type":"object","required":["access_token","user"],"title":"LoginResponse"},"RegisterRequest":{"properties":{"username":{"type":"string","maxLength":64,"minLength":3,"title":"Username"},"email":{"type":"string","title":"Email"},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["username","email","password"],"title":"RegisterRequest"},"TrustReportResponse":{"properties":{"request_id":{"type":"string","title":"Request Id"},"timestamp":{"type":"string","title":"Timestamp"},"prompt":{"type":"string","title":"Prompt"},"response":{"type":"string","title":"Response"},"model_used":{"type":"string","title":"Model Used"},"bias_scores":{"additionalProperties":{"type":"number"},"type":"object","title":"Bias Scores"},"flags":{"items":{"type":"string"},"type":"array","title":"Flags"},"severity":{"type":"string","title":"Severity"},"composite_trust_score":{"type":"number","title":"Composite Trust Score"},"eu_ai_act_relevant":{"type":"boolean","title":"Eu Ai Act Relevant"},"detector_results":{"additionalProperties":true,"type":"object","title":"Detector Results"},"recommended_action":{"type":"string","title":"Recommended Action"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"cached":{"type":"boolean","title":"Cached","default":false}},"type":"object","required":["request_id","timestamp","prompt","response","model_used","bias_scores","flags","severity","composite_trust_score","eu_ai_act_relevant","detector_results","recommended_action","metadata"],"title":"TrustReportResponse","description":"HTTP response schema for a completed trust analysis.\nMirrors TrustReport.to_dict() from trustify_engine.aggregator."},"UserInfo":{"properties":{"id":{"type":"string","title":"Id"},"username":{"type":"string","title":"Username"},"email":{"type":"string","title":"Email"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"}},"type":"object","required":["id","username","email"],"title":"UserInfo"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}