{"openapi": "3.1.0", "info": {"title": "LOOPCHii Stream API", "description": "Public research API for measurable media bias, music virality, cultural attention, and inspectable data-engineering contracts.", "contact": {"name": "LOOPCHii Stream", "url": "https://github.com/loopchii/Stream"}, "license": {"name": "Apache-2.0", "url": "https://github.com/loopchii/Stream/blob/main/LICENSE"}, "version": "1.1.0"}, "paths": {"/api/health": {"get": {"summary": "Health", "operationId": "health_api_health_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/results": {"get": {"summary": "Results", "description": "Full analysis results (cached)", "operationId": "results_api_results_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/analyze": {"post": {"summary": "Analyze", "description": "Re-run the analysis pipeline", "operationId": "analyze_api_analyze_post", "parameters": [{"name": "n_samples", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100000, "minimum": 100, "default": 5000, "title": "N Samples"}}, {"name": "X-API-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Api-Key"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/metrics/overview": {"get": {"summary": "Overview", "operationId": "overview_api_metrics_overview_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/temporal": {"get": {"summary": "Temporal", "operationId": "temporal_api_metrics_temporal_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/platforms": {"get": {"summary": "Platforms", "operationId": "platforms_api_metrics_platforms_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/bias": {"get": {"summary": "Bias", "operationId": "bias_api_metrics_bias_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/genres": {"get": {"summary": "Genres", "operationId": "genres_api_metrics_genres_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/media": {"get": {"summary": "Media Types", "description": "Per-media-type diversity and parity metrics", "operationId": "media_types_api_metrics_media_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/platform-media": {"get": {"summary": "Platform Media Types", "description": "Per-platform media-type breakdown (film vs series vs docs, etc.).", "operationId": "platform_media_types_api_metrics_platform_media_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/network": {"get": {"summary": "Network", "operationId": "network_api_metrics_network_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/intersectionality": {"get": {"summary": "Intersectionality", "description": "Most under- and over-represented intersectional groups", "operationId": "intersectionality_api_metrics_intersectionality_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 50, "minimum": 1, "default": 10, "title": "Limit"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/metrics/advanced": {"get": {"summary": "Advanced Metrics", "description": "Premium analytics: inequality (Gini/Lorenz/Theil), Simpson diversity,\nchi-square effect sizes, trend regression and bootstrap confidence bands.", "operationId": "advanced_metrics_api_metrics_advanced_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/metrics/scorecard": {"get": {"summary": "Scorecard", "description": "Per-platform A-F report card across four representation dimensions", "operationId": "scorecard_api_metrics_scorecard_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/simulate/parity": {"get": {"summary": "Simulate Parity", "description": "What-if: gender parity index and grade for a hypothetical female lead share.\n\nparity = 1 - |0.5 - female_ratio| * 2. Pure formula, exposed so the\ninteractive simulator round-trips through the backend like every other control.", "operationId": "simulate_parity_api_simulate_parity_get", "parameters": [{"name": "female_ratio", "in": "query", "required": false, "schema": {"type": "number", "maximum": 1.0, "minimum": 0.0, "default": 0.5, "title": "Female Ratio"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/insights": {"get": {"summary": "Insights", "description": "Narrative findings generated from the latest analysis run", "operationId": "insights_api_insights_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/lenses/catalog": {"get": {"summary": "Lenses Catalog", "description": "Public catalog of the active lens SDK registry.", "operationId": "lenses_catalog_api_lenses_catalog_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/lenses/demo-stream": {"get": {"summary": "Lenses Demo Stream", "description": "Evaluate grouped stream records with the public lens registry.", "operationId": "lenses_demo_stream_api_lenses_demo_stream_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 80, "minimum": 1, "default": 18, "title": "Limit"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/media-lab/overview": {"get": {"summary": "Media Lab Overview", "description": "Public enterprise-media research snapshot.", "operationId": "media_lab_overview_api_media_lab_overview_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/media-lab/compulsive-loop": {"get": {"summary": "Media Lab Compulsive Loop", "description": "Analyze a deterministic sample recommendation stream for compulsive-loop risk.", "operationId": "media_lab_compulsive_loop_api_media_lab_compulsive_loop_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/media-lab/generative-guard": {"get": {"summary": "Media Lab Generative Guard", "description": "Run the public generative buffer guard against a sample liability payload.", "operationId": "media_lab_generative_guard_api_media_lab_generative_guard_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/media-lab/causal-map": {"get": {"summary": "Media Lab Causal Map", "description": "Export a readable causal map of recommendation flow.", "operationId": "media_lab_causal_map_api_media_lab_causal_map_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/media-lab/insurability": {"get": {"summary": "Media Lab Insurability", "description": "Translate recommendation and generated-media signals into a bounded risk posture.", "operationId": "media_lab_insurability_api_media_lab_insurability_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}, "post": {"summary": "Media Lab Insurability Review", "description": "Review custom recommendation events and an optional payload through the liability translator.", "operationId": "media_lab_insurability_review_api_media_lab_insurability_post", "parameters": [{"name": "X-API-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Api-Key"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MediaLiabilityRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/export": {"get": {"summary": "Export", "description": "Download the full analysis results as JSON", "operationId": "export_api_export_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/bias-library": {"get": {"summary": "Bias Library", "description": "Library of 50+ documented bias types; optional ?category= filter", "operationId": "bias_library_api_bias_library_get", "parameters": [{"name": "category", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Category"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/system/bias-propagation": {"get": {"summary": "Bias Propagation", "description": "Public map of where bias enters and how it tends to propagate.", "operationId": "bias_propagation_api_system_bias_propagation_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/learn": {"get": {"summary": "Learn", "description": "Educational explanations of every metric used in the analysis", "operationId": "learn_api_learn_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/data-engineering": {"get": {"summary": "Data Engineering Surface", "description": "Public contract, lineage, and quality surface for the Stream repo.", "operationId": "data_engineering_surface_api_system_data_engineering_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/trojan-horse": {"get": {"summary": "Trojan Horse Surface", "description": "Public zero-friction adoption surface for the browser playground.", "operationId": "trojan_horse_surface_api_system_trojan_horse_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/catalog": {"get": {"summary": "System Catalog", "description": "High-level catalog of the repo's polyglot backend surfaces.", "operationId": "system_catalog_api_system_catalog_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/model-registry": {"get": {"summary": "System Model Registry", "description": "Executable model and method registry for the public repo.", "operationId": "system_model_registry_api_system_model_registry_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/api-contracts": {"get": {"summary": "System Api Contracts", "description": "Machine-readable API contract index derived from OpenAPI.", "operationId": "system_api_contracts_api_system_api_contracts_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/runtime": {"get": {"summary": "System Runtime", "description": "Generated runtime state computed by the Python orchestration spine.", "operationId": "system_runtime_api_system_runtime_get", "parameters": [{"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100000, "minimum": 100, "default": 5000, "title": "Sample Size"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/system/runtime/latest": {"get": {"summary": "System Runtime Latest", "description": "Last persisted runtime snapshot when SQLite materialization has been run.", "operationId": "system_runtime_latest_api_system_runtime_latest_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/runtime/ledger": {"get": {"summary": "System Runtime Ledger", "description": "Readable verification surface for the local runtime ledger.", "operationId": "system_runtime_ledger_api_system_runtime_ledger_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 50, "minimum": 1, "default": 12, "title": "Limit"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/runtime/events/latest": {"get": {"summary": "Runtime Events Latest", "description": "Latest ingested runtime events for the rolling market window.", "operationId": "runtime_events_latest_api_runtime_events_latest_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 250, "minimum": 1, "default": 25, "title": "Limit"}}, {"name": "platform", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Platform"}}, {"name": "market", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Market"}}, {"name": "genre", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Genre"}}, {"name": "language", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Language"}}, {"name": "label_tier", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Label Tier"}}, {"name": "source", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Source"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/runtime/metrics/live": {"get": {"summary": "Runtime Metrics Live", "description": "Rolling live metrics for the local runtime event surface.", "operationId": "runtime_metrics_live_api_runtime_metrics_live_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 2000, "minimum": 10, "default": 250, "title": "Limit"}}, {"name": "platform", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Platform"}}, {"name": "market", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Market"}}, {"name": "genre", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Genre"}}, {"name": "language", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Language"}}, {"name": "label_tier", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Label Tier"}}, {"name": "source", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Source"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/runtime/invariants/live": {"get": {"summary": "Runtime Invariants Live", "description": "Deterministic review boundaries for the current live event window.", "operationId": "runtime_invariants_live_api_runtime_invariants_live_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 2000, "minimum": 10, "default": 250, "title": "Limit"}}, {"name": "platform", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Platform"}}, {"name": "market", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Market"}}, {"name": "genre", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Genre"}}, {"name": "language", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Language"}}, {"name": "label_tier", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Label Tier"}}, {"name": "source", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Source"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/runtime/events/contract": {"get": {"summary": "Runtime Events Contract", "description": "Ingress shape, retention policy, and query filters for the local event window.", "operationId": "runtime_events_contract_api_runtime_events_contract_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/frontend-state": {"get": {"summary": "System Frontend State", "description": "Frontend payload generated from Python so the browser owns less logic.", "operationId": "system_frontend_state_api_system_frontend_state_get", "parameters": [{"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100000, "minimum": 100, "default": 5000, "title": "Sample Size"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/system/governance": {"get": {"summary": "System Governance", "description": "Public governance contract for fairness, claim boundaries, and review posture.", "operationId": "system_governance_api_system_governance_get", "parameters": [{"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100000, "minimum": 100, "default": 5000, "title": "Sample Size"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/system/readiness": {"get": {"summary": "System Readiness", "description": "Readiness surface for onboarding, bounded commercial use, and contribution.", "operationId": "system_readiness_api_system_readiness_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/integrations": {"get": {"summary": "System Integrations", "description": "Current adoption paths and the boundary between usable now versus still-to-build.", "operationId": "system_integrations_api_system_integrations_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/bias-dynamics": {"get": {"summary": "System Bias Dynamics", "description": "Structural bias surface combining representation balance, isolation, and public drift.", "operationId": "system_bias_dynamics_api_system_bias_dynamics_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/streaming-readiness": {"get": {"summary": "System Streaming Readiness", "description": "Candid streaming-systems review of the public repo's current operating posture.", "operationId": "system_streaming_readiness_api_system_streaming_readiness_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/system/critical-spine": {"get": {"summary": "System Critical Spine", "description": "Per-visual purpose, caveat, and improvement guidance generated by the backend.", "operationId": "system_critical_spine_api_system_critical_spine_get", "parameters": [{"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100000, "minimum": 100, "default": 5000, "title": "Sample Size"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/system/comparatives": {"get": {"summary": "System Comparatives", "description": "Cross-lane comparative surface for synthetic vs public music evidence.", "operationId": "system_comparatives_api_system_comparatives_get", "parameters": [{"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100000, "minimum": 100, "default": 5000, "title": "Sample Size"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/system/materialize": {"post": {"summary": "System Materialize", "description": "Write the runtime snapshot to JSON exports and SQLite for local inspection.", "operationId": "system_materialize_api_system_materialize_post", "parameters": [{"name": "sample_size", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 100000, "minimum": 100, "default": 5000, "title": "Sample Size"}}, {"name": "X-API-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Api-Key"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/runtime/events": {"post": {"summary": "Runtime Events Ingest", "description": "Ingest a bounded batch of runtime events into the local SQLite event window.", "operationId": "runtime_events_ingest_api_runtime_events_post", "parameters": [{"name": "X-API-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Api-Key"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RuntimeEventBatch"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/runtime/events/demo-seed": {"post": {"summary": "Runtime Events Demo Seed", "description": "Seed the local runtime window with a safe demonstration batch.", "operationId": "runtime_events_demo_seed_api_runtime_events_demo_seed_post", "parameters": [{"name": "X-API-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Api-Key"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/playground/simulate": {"get": {"summary": "Playground Simulate", "description": "Deterministic public guard simulation for the split-screen playground.", "operationId": "playground_simulate_api_playground_simulate_get", "parameters": [{"name": "prompt", "in": "query", "required": true, "schema": {"type": "string", "minLength": 4, "maxLength": 600, "title": "Prompt"}}, {"name": "draft_response", "in": "query", "required": false, "schema": {"type": "string", "maxLength": 8000, "default": "", "title": "Draft Response"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/runtime/review/demo": {"get": {"summary": "Runtime Review Demo", "description": "Sample runtime review showing prompt intent and drafted output inspected together.", "operationId": "runtime_review_demo_api_runtime_review_demo_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/runtime/review": {"post": {"summary": "Runtime Review", "description": "Review a prompt and drafted response before the text is treated as final output.", "operationId": "runtime_review_api_runtime_review_post", "parameters": [{"name": "X-API-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Api-Key"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RuntimeReviewRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/runtime/drift/demo": {"get": {"summary": "Runtime Drift Demo", "description": "Sample drift-watch window for the public repo.", "operationId": "runtime_drift_demo_api_runtime_drift_demo_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/runtime/drift": {"post": {"summary": "Runtime Drift", "description": "Review a small output window for text-path drift, leakage, and inconsistency.", "operationId": "runtime_drift_api_runtime_drift_post", "parameters": [{"name": "X-API-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-Api-Key"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DriftWindowRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/characters": {"get": {"summary": "Characters", "description": "Filterable character-level records from the latest analysis run", "operationId": "characters_api_characters_get", "parameters": [{"name": "platform", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Platform"}}, {"name": "genre", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Genre"}}, {"name": "media_type", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Media Type"}}, {"name": "year", "in": "query", "required": false, "schema": {"anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Year"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 5000, "minimum": 1, "default": 100, "title": "Limit"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/music/overview": {"get": {"summary": "Music Overview", "description": "Headline stats for the real top-music dataset.", "operationId": "music_overview_api_music_overview_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/powerlaw": {"get": {"summary": "Music Powerlaw", "description": "Power-law fit of view counts (alpha, KS, bootstrap CI, CCDF points).", "operationId": "music_powerlaw_api_music_powerlaw_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/inequality": {"get": {"summary": "Music Inequality", "description": "Attention inequality: Gini, Lorenz, Theil, channel concentration.", "operationId": "music_inequality_api_music_inequality_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/correlations": {"get": {"summary": "Music Correlations", "description": "Spearman + partial correlations of each feature with view count.", "operationId": "music_correlations_api_music_correlations_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/archetypes": {"get": {"summary": "Music Archetypes", "description": "K-means viral archetypes and the per-song scatter.", "operationId": "music_archetypes_api_music_archetypes_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/network": {"get": {"summary": "Music Network", "description": "Tag co-occurrence graph (nodes, edges, density, communities).", "operationId": "music_network_api_music_network_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/predictability": {"get": {"summary": "Music Predictability", "description": "Cross-validated ensemble R-squared and feature importances.", "operationId": "music_predictability_api_music_predictability_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/resonance": {"get": {"summary": "Music Resonance", "description": "Public resonance proxy: repetition, concentration, and release pressure.", "operationId": "music_resonance_api_music_resonance_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/songs": {"get": {"summary": "Music Songs", "description": "The real songs table, sortable for the explorer.", "operationId": "music_songs_api_music_songs_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 1000, "minimum": 1, "default": 700, "title": "Limit"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"type": "string", "default": "view_count", "title": "Sort By"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/music/simulate": {"get": {"summary": "Music Simulate", "description": "What-if virality predictor: maps a hypothetical upload to a view percentile.", "operationId": "music_simulate_api_music_simulate_get", "parameters": [{"name": "duration_min", "in": "query", "required": false, "schema": {"type": "number", "maximum": 15.0, "minimum": 0.2, "default": 3.2, "title": "Duration Min"}}, {"name": "channel_follower_count", "in": "query", "required": false, "schema": {"type": "number", "maximum": 500000000, "minimum": 0, "default": 5000000, "title": "Channel Follower Count"}}, {"name": "tag_count", "in": "query", "required": false, "schema": {"type": "number", "maximum": 200, "minimum": 0, "default": 20, "title": "Tag Count"}}, {"name": "is_official", "in": "query", "required": false, "schema": {"type": "number", "maximum": 1.0, "minimum": 0.0, "default": 1.0, "title": "Is Official"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/music/status": {"get": {"summary": "Music Status", "description": "Whether live YouTube Data API extraction is wired (key present) or not.", "operationId": "music_status_api_music_status_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/bias": {"get": {"summary": "Music Bias", "description": "Gender, genre, collaboration, and concentration bias metrics.", "operationId": "music_bias_api_music_bias_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/quality": {"get": {"summary": "Music Quality", "description": "Source audit, cleaning steps, and model guardrails for the music lane.", "operationId": "music_quality_api_music_quality_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/decision-lab": {"get": {"summary": "Music Decision Lab", "description": "Higher-rigor cohort drift and controlled comparison surface for the music lane.", "operationId": "music_decision_lab_api_music_decision_lab_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/intelligence": {"get": {"summary": "Music Intelligence Summary", "description": "Score-aware repository harvest for note, chord, and notation coverage.", "operationId": "music_intelligence_summary_api_music_intelligence_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/theory": {"get": {"summary": "Music Theory Surface", "description": "Score-aware note, harmony, and coverage surface built from linked notation assets.", "operationId": "music_theory_surface_api_music_theory_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/living-media": {"get": {"summary": "Music Living Media", "description": "Living media field read built from public structural proxies.", "operationId": "music_living_media_api_music_living_media_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/index": {"get": {"summary": "Music Index", "description": "Piece-level index linking catalog songs to any local notation assets.", "operationId": "music_index_api_music_index_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 500, "minimum": 1, "default": 60, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 5000, "minimum": 0, "default": 0, "title": "Offset"}}, {"name": "q", "in": "query", "required": false, "schema": {"type": "string", "maxLength": 200, "default": "", "title": "Q"}}, {"name": "score_linked", "in": "query", "required": false, "schema": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "title": "Score Linked"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/music/genres": {"get": {"summary": "Music Genres", "description": "Per-genre breakdown with view share, duration, and collaboration mix.", "operationId": "music_genres_api_music_genres_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/timeline": {"get": {"summary": "Music Timeline", "description": "Upload/publication time series from the public supplemental datasets.", "operationId": "music_timeline_api_music_timeline_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/api/music/refresh": {"post": {"summary": "Music Refresh", "description": "Pull a fresh, larger sample from the YouTube Data API (needs a key).", "operationId": "music_refresh_api_music_refresh_post", "parameters": [{"name": "max_results", "in": "query", "required": false, "schema": {"type": "integer", "maximum": 200, "minimum": 10, "default": 100, "title": "Max Results"}}, {"name": "region", "in": "query", "required": false, "schema": {"type": "string", "default": "US", "title": "Region"}}, {"name": "X-API-Key", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "X-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": {"DriftWindowRequest": {"properties": {"turns": {"items": {"type": "string"}, "type": "array", "maxItems": 40, "minItems": 1, "title": "Turns"}}, "type": "object", "required": ["turns"], "title": "DriftWindowRequest"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "MediaLiabilityRequest": {"properties": {"events": {"items": {"$ref": "#/components/schemas/RecommendationEventInput"}, "type": "array", "maxItems": 200, "title": "Events"}, "payload_text": {"type": "string", "maxLength": 12000, "title": "Payload Text", "default": ""}}, "type": "object", "title": "MediaLiabilityRequest"}, "RecommendationEventInput": {"properties": {"event_id": {"type": "string", "maxLength": 120, "minLength": 3, "title": "Event Id"}, "creator_id": {"type": "string", "maxLength": 120, "minLength": 3, "title": "Creator Id"}, "title": {"type": "string", "maxLength": 240, "minLength": 1, "title": "Title"}, "category": {"type": "string", "maxLength": 120, "minLength": 1, "title": "Category"}, "dwell_ms": {"type": "integer", "maximum": 3600000.0, "minimum": 0.0, "title": "Dwell Ms"}, "watch_ratio": {"type": "number", "maximum": 1.0, "minimum": 0.0, "title": "Watch Ratio"}}, "type": "object", "required": ["event_id", "creator_id", "title", "category", "dwell_ms", "watch_ratio"], "title": "RecommendationEventInput"}, "RuntimeEventBatch": {"properties": {"events": {"items": {"$ref": "#/components/schemas/RuntimeEventInput"}, "type": "array", "maxItems": 500, "minItems": 1, "title": "Events"}}, "type": "object", "required": ["events"], "title": "RuntimeEventBatch"}, "RuntimeEventInput": {"properties": {"event_id": {"type": "string", "maxLength": 160, "minLength": 3, "title": "Event Id"}, "observed_at": {"type": "string", "maxLength": 80, "minLength": 10, "title": "Observed At"}, "platform": {"type": "string", "maxLength": 40, "minLength": 2, "title": "Platform"}, "market": {"type": "string", "maxLength": 40, "minLength": 2, "title": "Market"}, "track_id": {"type": "string", "maxLength": 120, "minLength": 2, "title": "Track Id"}, "track_title": {"type": "string", "maxLength": 240, "minLength": 1, "title": "Track Title"}, "artist_id": {"type": "string", "maxLength": 120, "minLength": 2, "title": "Artist Id"}, "artist_name": {"type": "string", "maxLength": 160, "minLength": 1, "title": "Artist Name"}, "genre": {"type": "string", "maxLength": 80, "minLength": 1, "title": "Genre"}, "language": {"type": "string", "maxLength": 40, "minLength": 1, "title": "Language"}, "label_tier": {"type": "string", "maxLength": 40, "minLength": 1, "title": "Label Tier"}, "independent_flag": {"type": "boolean", "title": "Independent Flag", "default": false}, "editorial_flag": {"type": "boolean", "title": "Editorial Flag", "default": false}, "exposure_share": {"type": "number", "maximum": 1.0, "minimum": 0.0, "title": "Exposure Share"}, "recommendation_share": {"type": "number", "maximum": 1.0, "minimum": 0.0, "title": "Recommendation Share"}, "completion_rate": {"type": "number", "maximum": 1.0, "minimum": 0.0, "title": "Completion Rate"}, "skip_rate": {"type": "number", "maximum": 1.0, "minimum": 0.0, "title": "Skip Rate"}, "save_rate": {"type": "number", "maximum": 1.0, "minimum": 0.0, "title": "Save Rate"}, "source": {"type": "string", "maxLength": 80, "title": "Source", "default": "api_ingest"}}, "type": "object", "required": ["event_id", "observed_at", "platform", "market", "track_id", "track_title", "artist_id", "artist_name", "genre", "language", "label_tier", "exposure_share", "recommendation_share", "completion_rate", "skip_rate", "save_rate"], "title": "RuntimeEventInput"}, "RuntimeReviewRequest": {"properties": {"prompt": {"type": "string", "maxLength": 1000, "minLength": 4, "title": "Prompt"}, "draft_response": {"type": "string", "maxLength": 8000, "title": "Draft Response", "default": ""}}, "type": "object", "required": ["prompt"], "title": "RuntimeReviewRequest"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}}}}