{"openapi":"3.1.0","info":{"title":"Strem AI","description":"Your AI gets smarter. Your bill gets smaller.","version":"0.1.0"},"paths":{"/v1/chat/completions":{"post":{"summary":"Chat Completions","description":"OpenAI-compatible chat completions endpoint.\n\nDrop-in replacement — change your base_url and API key, everything else works.","operationId":"chat_completions_v1_chat_completions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"summary":"List Models","description":"List all available models (OpenAI-compatible).","operationId":"list_models_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsListResponse"}}}}}}},"/v1/models/{model_id}":{"get":{"summary":"Get Model","description":"Get a specific model (OpenAI-compatible).","operationId":"get_model_v1_models__model_id__get","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/ready":{"get":{"summary":"Readiness","description":"Check all dependencies are up.","operationId":"readiness_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/signup":{"post":{"tags":["auth"],"summary":"Signup","description":"Create account with invite code.","operationId":"signup_api_auth_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["auth"],"summary":"Login","description":"Login with email and password.","operationId":"login_api_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/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"tags":["auth"],"summary":"Get Me","description":"Get current user info.","operationId":"get_me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/invites":{"get":{"tags":["auth"],"summary":"List Invites","description":"List all invite codes (admin only).","operationId":"list_invites_api_auth_invites_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InviteResponse"},"type":"array","title":"Response List Invites Api Auth Invites Get"}}}}}},"post":{"tags":["auth"],"summary":"Create Invite","description":"Create a new invite code (admin only).","operationId":"create_invite_api_auth_invites_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/stats":{"get":{"tags":["dashboard"],"summary":"Get Stats","description":"Get usage stats for the current tenant.","operationId":"get_stats_api_dashboard_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsResponse"}}}}}}},"/api/dashboard/keys":{"get":{"tags":["dashboard"],"summary":"List Api Keys","description":"List all API keys for the current tenant.","operationId":"list_api_keys_api_dashboard_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"type":"array","title":"Response List Api Keys Api Dashboard Keys Get"}}}}}},"post":{"tags":["dashboard"],"summary":"Create Api Key","description":"Create a new API key.","operationId":"create_api_key_api_dashboard_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/keys/{key_id}":{"delete":{"tags":["dashboard"],"summary":"Revoke Api Key","description":"Revoke an API key.","operationId":"revoke_api_key_api_dashboard_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/requests":{"get":{"tags":["dashboard"],"summary":"Get Recent Requests","description":"Get recent request logs.","operationId":"get_recent_requests_api_dashboard_requests_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RequestLogResponse"},"title":"Response Get Recent Requests Api Dashboard Requests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/savings":{"get":{"tags":["dashboard"],"summary":"Get Savings Breakdown","description":"Detailed savings analytics for the current tenant.","operationId":"get_savings_breakdown_api_dashboard_savings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavingsBreakdownResponse"}}}}}}},"/api/tenants":{"get":{"tags":["tenants"],"summary":"List Tenants","description":"List all tenants.","operationId":"list_tenants_api_tenants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TenantStatsResponse"},"type":"array","title":"Response List Tenants Api Tenants Get"}}}}}},"post":{"tags":["tenants"],"summary":"Create Tenant","description":"Create a new tenant and generate their API key.","operationId":"create_tenant_api_tenants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tenants/{tenant_id}/stats":{"get":{"tags":["tenants"],"summary":"Get Tenant Stats","description":"Get tenant usage stats.","operationId":"get_tenant_stats_api_tenants__tenant_id__stats_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/model-versions":{"get":{"tags":["admin"],"summary":"List Model Versions","description":"List all tracked model versions.","operationId":"list_model_versions_api_admin_model_versions_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelVersionResponse"},"title":"Response List Model Versions Api Admin Model Versions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Create Model Version","description":"Register a new candidate model version for evaluation.","operationId":"create_model_version_api_admin_model_versions_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateModelVersionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/model-versions/{version_id}/evaluate":{"post":{"tags":["admin"],"summary":"Evaluate Version","description":"Trigger evaluation of a candidate model version.","operationId":"evaluate_version_api_admin_model_versions__version_id__evaluate_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/model-versions/{version_id}/promote":{"post":{"tags":["admin"],"summary":"Promote Version Endpoint","description":"Promote an approved version — updates the live model registry.","operationId":"promote_version_endpoint_api_admin_model_versions__version_id__promote_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agent-traces":{"get":{"tags":["admin"],"summary":"List Agent Traces","description":"List agent workflow runs.","operationId":"list_agent_traces_api_admin_agent_traces_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentTraceResponse"},"title":"Response List Agent Traces Api Admin Agent Traces Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agent-traces/{trace_id}":{"get":{"tags":["admin"],"summary":"Get Agent Trace","description":"Get full trace with all steps and evaluation details.","operationId":"get_agent_trace_api_admin_agent_traces__trace_id__get","parameters":[{"name":"trace_id","in":"path","required":true,"schema":{"type":"string","title":"Trace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTraceDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agent-insights":{"get":{"tags":["admin"],"summary":"Get Agent Insights","description":"Aggregate stats across all agent traces.","operationId":"get_agent_insights_api_admin_agent_insights_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInsightsResponse"}}}}}}},"/api/admin/dashboard/agent-traces":{"get":{"tags":["admin"],"summary":"List Tenant Agent Traces","description":"List agent traces for the authenticated tenant (via dashboard auth).","operationId":"list_tenant_agent_traces_api_admin_dashboard_agent_traces_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentTraceResponse"},"title":"Response List Tenant Agent Traces Api Admin Dashboard Agent Traces Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/training/eligible-clusters":{"get":{"tags":["admin"],"summary":"List Eligible Clusters","description":"List task clusters eligible for micro-model training.","operationId":"list_eligible_clusters_api_admin_training_eligible_clusters_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EligibleClusterResponse"},"type":"array","title":"Response List Eligible Clusters Api Admin Training Eligible Clusters Get"}}}}}}},"/api/admin/training/trigger":{"post":{"tags":["admin"],"summary":"Trigger Training Endpoint","description":"Manually trigger a training job for a cluster.","operationId":"trigger_training_endpoint_api_admin_training_trigger_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerTrainingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/training/jobs":{"get":{"tags":["admin"],"summary":"List Training Jobs","description":"List training jobs, optionally filtered by status.","operationId":"list_training_jobs_api_admin_training_jobs_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TrainingJobResponse"},"title":"Response List Training Jobs Api Admin Training Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/micro-models":{"get":{"tags":["admin"],"summary":"List Micro Models","description":"List all micro-models with quality and savings info.","operationId":"list_micro_models_api_admin_micro_models_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MicroModelResponse"},"title":"Response List Micro Models Api Admin Micro Models Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/micro-models/{model_id}/promote":{"post":{"tags":["admin"],"summary":"Promote Micro Model","description":"Promote an evaluated micro-model to shadow testing, then canary at 5%.","operationId":"promote_micro_model_api_admin_micro_models__model_id__promote_post","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicroModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/micro-models/{model_id}/retire":{"post":{"tags":["admin"],"summary":"Retire Micro Model","description":"Retire a micro-model — unregister from serving, stop routing.","operationId":"retire_micro_model_api_admin_micro_models__model_id__retire_post","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicroModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/micro-models/{model_id}/rollback":{"post":{"tags":["admin"],"summary":"Rollback Micro Model","description":"Emergency rollback — immediately stop all traffic to this micro-model.","operationId":"rollback_micro_model_api_admin_micro_models__model_id__rollback_post","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MicroModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/waitlist":{"get":{"tags":["admin"],"summary":"List Waitlist","description":"List all beta waitlist signups.","operationId":"list_waitlist_api_admin_waitlist_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WaitlistEntryResponse"},"type":"array","title":"Response List Waitlist Api Admin Waitlist Get"}}}}}}},"/api/admin/waitlist/{entry_id}/invite":{"post":{"tags":["admin"],"summary":"Mark Waitlist Invited","description":"Mark a waitlist entry as invited.","operationId":"mark_waitlist_invited_api_admin_waitlist__entry_id__invite_post","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/platform-stats":{"get":{"tags":["admin"],"summary":"Get Platform Stats","description":"Aggregate platform-wide statistics.","operationId":"get_platform_stats_api_admin_platform_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformStatsResponse"}}}}}}},"/api/admin/revenue":{"get":{"tags":["admin"],"summary":"Get Revenue Analytics","description":"Platform revenue analytics and scenario modeling.","operationId":"get_revenue_analytics_api_admin_revenue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevenueResponse"}}}}}}},"/api/waitlist":{"post":{"tags":["waitlist"],"summary":"Join Waitlist","description":"Submit email for beta waitlist. Silently succeeds on duplicates.","operationId":"join_waitlist_api_waitlist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AgentInsightsResponse":{"properties":{"total_traces":{"type":"integer","title":"Total Traces"},"completed_count":{"type":"integer","title":"Completed Count"},"failed_count":{"type":"integer","title":"Failed Count"},"avg_steps":{"type":"number","title":"Avg Steps"},"avg_eval_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Eval Score"},"avg_latency_ms":{"type":"number","title":"Avg Latency Ms"},"avg_cost_usd":{"type":"number","title":"Avg Cost Usd"},"failure_step_distribution":{"type":"object","title":"Failure Step Distribution"}},"type":"object","required":["total_traces","completed_count","failed_count","avg_steps","avg_eval_score","avg_latency_ms","avg_cost_usd","failure_step_distribution"],"title":"AgentInsightsResponse"},"AgentStepResponse":{"properties":{"id":{"type":"string","title":"Id"},"step_number":{"type":"integer","title":"Step Number"},"step_type":{"type":"string","title":"Step Type"},"model_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Used"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"tool_success":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tool Success"},"input_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Summary"},"output_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output Summary"},"latency_ms":{"type":"integer","title":"Latency Ms"},"cost_usd":{"type":"number","title":"Cost Usd"},"tokens_used":{"type":"integer","title":"Tokens Used"},"status":{"type":"string","title":"Status"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","step_number","step_type","model_used","tool_name","tool_success","input_summary","output_summary","latency_ms","cost_usd","tokens_used","status","failure_reason","quality_score","created_at"],"title":"AgentStepResponse"},"AgentTraceDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"task_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Hint"},"status":{"type":"string","title":"Status"},"total_steps":{"type":"integer","title":"Total Steps"},"completed_steps":{"type":"integer","title":"Completed Steps"},"failed_step":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Step"},"total_latency_ms":{"type":"integer","title":"Total Latency Ms"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"total_tokens":{"type":"integer","title":"Total Tokens"},"eval_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eval Score"},"created_at":{"type":"string","title":"Created At"},"finalized_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finalized At"},"steps":{"items":{"$ref":"#/components/schemas/AgentStepResponse"},"type":"array","title":"Steps"},"eval_details":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Eval Details"}},"type":"object","required":["id","session_id","task_hint","status","total_steps","completed_steps","failed_step","total_latency_ms","total_cost_usd","total_tokens","eval_score","created_at","finalized_at","steps","eval_details"],"title":"AgentTraceDetailResponse"},"AgentTraceResponse":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"task_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Hint"},"status":{"type":"string","title":"Status"},"total_steps":{"type":"integer","title":"Total Steps"},"completed_steps":{"type":"integer","title":"Completed Steps"},"failed_step":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Step"},"total_latency_ms":{"type":"integer","title":"Total Latency Ms"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"total_tokens":{"type":"integer","title":"Total Tokens"},"eval_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eval Score"},"created_at":{"type":"string","title":"Created At"},"finalized_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finalized At"}},"type":"object","required":["id","session_id","task_hint","status","total_steps","completed_steps","failed_step","total_latency_ms","total_cost_usd","total_tokens","eval_score","created_at","finalized_at"],"title":"AgentTraceResponse"},"ApiKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"key_prefix":{"type":"string","title":"Key Prefix"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","key_prefix","name","is_active","created_at","last_used_at"],"title":"ApiKeyResponse"},"AuthResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},"type":"object","required":["access_token","tenant_id","name","email"],"title":"AuthResponse"},"ChatCompletionRequest":{"properties":{"model":{"type":"string","title":"Model"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"N","default":1},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream","default":false},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"},"presence_penalty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Presence Penalty"},"frequency_penalty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Frequency Penalty"},"logit_bias":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Logit Bias"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/ToolDef"},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"anyOf":[{"type":"string"},{"type":"object"},{"type":"null"}],"title":"Tool Choice"},"response_format":{"anyOf":[{"$ref":"#/components/schemas/ResponseFormat"},{"type":"null"}]},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"}},"additionalProperties":true,"type":"object","required":["model","messages"],"title":"ChatCompletionRequest"},"ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"anyOf":[{"type":"string"},{"items":{},"type":"array"},{"type":"null"}],"title":"Content"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"tool_calls":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Tool Calls"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id"}},"type":"object","required":["role"],"title":"ChatMessage"},"CreateApiKeyRequest":{"properties":{"name":{"type":"string","title":"Name","default":"New Key"}},"type":"object","title":"CreateApiKeyRequest"},"CreateApiKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"message":{"type":"string","title":"Message"}},"type":"object","required":["id","key","name","message"],"title":"CreateApiKeyResponse"},"CreateInviteRequest":{"properties":{"max_uses":{"type":"integer","title":"Max Uses","default":1}},"type":"object","title":"CreateInviteRequest"},"CreateModelVersionRequest":{"properties":{"gateway_model_id":{"type":"string","title":"Gateway Model Id"},"provider_model_id":{"type":"string","title":"Provider Model Id"},"provider":{"type":"string","title":"Provider"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["gateway_model_id","provider_model_id","provider"],"title":"CreateModelVersionRequest"},"CreateTenantRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"}},"type":"object","required":["name","email"],"title":"CreateTenantRequest"},"CreateTenantResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"api_key":{"type":"string","title":"Api Key"},"message":{"type":"string","title":"Message"}},"type":"object","required":["tenant_id","api_key","message"],"title":"CreateTenantResponse"},"DailyRevenue":{"properties":{"date":{"type":"string","title":"Date"},"platform_fee_usd":{"type":"number","title":"Platform Fee Usd"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["date","platform_fee_usd","request_count"],"title":"DailyRevenue"},"DailySaving":{"properties":{"date":{"type":"string","title":"Date"},"savings_usd":{"type":"number","title":"Savings Usd"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["date","savings_usd","request_count"],"title":"DailySaving"},"EligibleClusterResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"total_requests":{"type":"integer","title":"Total Requests"},"training_data_count":{"type":"integer","title":"Training Data Count"},"monthly_cost_usd":{"type":"number","title":"Monthly Cost Usd"},"estimated_savings_usd":{"type":"number","title":"Estimated Savings Usd"},"payback_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Payback Days"},"primary_model_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Model Used"},"is_trainable":{"type":"boolean","title":"Is Trainable"},"auto_train_eligible":{"type":"boolean","title":"Auto Train Eligible"}},"type":"object","required":["id","name","category","tenant_id","total_requests","training_data_count","monthly_cost_usd","estimated_savings_usd","payback_days","primary_model_used","is_trainable","auto_train_eligible"],"title":"EligibleClusterResponse"},"FunctionDef":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"parameters":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Parameters"}},"type":"object","required":["name"],"title":"FunctionDef"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InviteResponse":{"properties":{"code":{"type":"string","title":"Code"},"max_uses":{"type":"integer","title":"Max Uses"},"times_used":{"type":"integer","title":"Times Used"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["code","max_uses","times_used","is_active","created_at"],"title":"InviteResponse"},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MicroModelResponse":{"properties":{"id":{"type":"string","title":"Id"},"task_cluster_id":{"type":"string","title":"Task Cluster Id"},"cluster_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cluster Name"},"name":{"type":"string","title":"Name"},"version":{"type":"integer","title":"Version"},"base_model":{"type":"string","title":"Base Model"},"adapter_type":{"type":"string","title":"Adapter Type"},"status":{"type":"string","title":"Status"},"training_examples":{"type":"integer","title":"Training Examples"},"training_cost_usd":{"type":"number","title":"Training Cost Usd"},"training_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Training Duration Seconds"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accuracy"},"teacher_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Model"},"traffic_percent":{"type":"number","title":"Traffic Percent"},"rollout_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rollout Stage"},"total_requests_served":{"type":"integer","title":"Total Requests Served"},"total_savings_generated_usd":{"type":"number","title":"Total Savings Generated Usd"},"payback_achieved":{"type":"boolean","title":"Payback Achieved"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","task_cluster_id","cluster_name","name","version","base_model","adapter_type","status","training_examples","training_cost_usd","training_duration_seconds","quality_score","accuracy","teacher_model","traffic_percent","rollout_stage","total_requests_served","total_savings_generated_usd","payback_achieved","created_at","updated_at"],"title":"MicroModelResponse"},"ModelInfo":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"model"},"created":{"type":"integer","title":"Created","default":0},"owned_by":{"type":"string","title":"Owned By","default":"strem-ai"}},"type":"object","required":["id"],"title":"ModelInfo"},"ModelSavings":{"properties":{"request_model":{"type":"string","title":"Request Model"},"total_savings_usd":{"type":"number","title":"Total Savings Usd"},"request_count":{"type":"integer","title":"Request Count"},"avg_savings_per_request":{"type":"number","title":"Avg Savings Per Request"}},"type":"object","required":["request_model","total_savings_usd","request_count","avg_savings_per_request"],"title":"ModelSavings"},"ModelVersionResponse":{"properties":{"id":{"type":"string","title":"Id"},"gateway_model_id":{"type":"string","title":"Gateway Model Id"},"provider_model_id":{"type":"string","title":"Provider Model Id"},"provider":{"type":"string","title":"Provider"},"status":{"type":"string","title":"Status"},"sample_count":{"type":"integer","title":"Sample Count"},"avg_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Quality Score"},"quality_pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Pass Rate"},"latency_p50_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency P50 Ms"},"latency_p99_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency P99 Ms"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","title":"Created At"},"evaluated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evaluated At"},"promoted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promoted At"}},"type":"object","required":["id","gateway_model_id","provider_model_id","provider","status","sample_count","avg_quality_score","quality_pass_rate","latency_p50_ms","latency_p99_ms","notes","created_at","evaluated_at","promoted_at"],"title":"ModelVersionResponse"},"ModelsListResponse":{"properties":{"object":{"type":"string","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/ModelInfo"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelsListResponse"},"OptimizationBreakdown":{"properties":{"optimization_type":{"type":"string","title":"Optimization Type"},"total_savings_usd":{"type":"number","title":"Total Savings Usd"},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["optimization_type","total_savings_usd","request_count"],"title":"OptimizationBreakdown"},"PlatformStatsResponse":{"properties":{"total_tenants":{"type":"integer","title":"Total Tenants"},"total_requests":{"type":"integer","title":"Total Requests"},"total_revenue_usd":{"type":"number","title":"Total Revenue Usd"},"total_platform_fees_usd":{"type":"number","title":"Total Platform Fees Usd"},"total_savings_usd":{"type":"number","title":"Total Savings Usd"},"active_micro_models":{"type":"integer","title":"Active Micro Models"},"waitlist_count":{"type":"integer","title":"Waitlist Count"}},"type":"object","required":["total_tenants","total_requests","total_revenue_usd","total_platform_fees_usd","total_savings_usd","active_micro_models","waitlist_count"],"title":"PlatformStatsResponse"},"RequestLogResponse":{"properties":{"id":{"type":"string","title":"Id"},"request_model":{"type":"string","title":"Request Model"},"routed_model":{"type":"string","title":"Routed Model"},"was_optimized":{"type":"boolean","title":"Was Optimized"},"used_micro_model":{"type":"boolean","title":"Used Micro Model"},"prompt_tokens":{"type":"integer","title":"Prompt Tokens"},"completion_tokens":{"type":"integer","title":"Completion Tokens"},"original_cost_usd":{"type":"number","title":"Original Cost Usd"},"charged_cost_usd":{"type":"number","title":"Charged Cost Usd"},"savings_usd":{"type":"number","title":"Savings Usd"},"latency_ms":{"type":"integer","title":"Latency Ms"},"task_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Hint"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","request_model","routed_model","was_optimized","used_micro_model","prompt_tokens","completion_tokens","original_cost_usd","charged_cost_usd","savings_usd","latency_ms","task_hint","created_at"],"title":"RequestLogResponse"},"ResponseFormat":{"properties":{"type":{"type":"string","title":"Type","default":"text"}},"type":"object","title":"ResponseFormat"},"RevenueResponse":{"properties":{"total_platform_fees_usd":{"type":"number","title":"Total Platform Fees Usd"},"total_potential_fees_usd":{"type":"number","title":"Total Potential Fees Usd"},"daily_revenue":{"items":{"$ref":"#/components/schemas/DailyRevenue"},"type":"array","title":"Daily Revenue"},"revenue_by_tenant":{"items":{"$ref":"#/components/schemas/TenantRevenue"},"type":"array","title":"Revenue By Tenant"},"scenarios":{"items":{"$ref":"#/components/schemas/RevenueScenario"},"type":"array","title":"Scenarios"}},"type":"object","required":["total_platform_fees_usd","total_potential_fees_usd","daily_revenue","revenue_by_tenant","scenarios"],"title":"RevenueResponse"},"RevenueScenario":{"properties":{"share_percent":{"type":"number","title":"Share Percent"},"projected_monthly_revenue":{"type":"number","title":"Projected Monthly Revenue"}},"type":"object","required":["share_percent","projected_monthly_revenue"],"title":"RevenueScenario"},"SavingsBreakdownResponse":{"properties":{"total_savings_usd":{"type":"number","title":"Total Savings Usd"},"total_requests":{"type":"integer","title":"Total Requests"},"savings_rate":{"type":"number","title":"Savings Rate"},"avg_savings_per_request":{"type":"number","title":"Avg Savings Per Request"},"daily_savings":{"items":{"$ref":"#/components/schemas/DailySaving"},"type":"array","title":"Daily Savings"},"by_optimization_type":{"items":{"$ref":"#/components/schemas/OptimizationBreakdown"},"type":"array","title":"By Optimization Type"},"top_models_saved_on":{"items":{"$ref":"#/components/schemas/ModelSavings"},"type":"array","title":"Top Models Saved On"}},"type":"object","required":["total_savings_usd","total_requests","savings_rate","avg_savings_per_request","daily_savings","by_optimization_type","top_models_saved_on"],"title":"SavingsBreakdownResponse"},"SignupRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"invite_code":{"type":"string","title":"Invite Code"}},"type":"object","required":["name","email","password","invite_code"],"title":"SignupRequest"},"StatsResponse":{"properties":{"total_requests":{"type":"integer","title":"Total Requests"},"total_tokens":{"type":"integer","title":"Total Tokens"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"total_savings_usd":{"type":"number","title":"Total Savings Usd"},"savings_percent":{"type":"number","title":"Savings Percent"},"requests_today":{"type":"integer","title":"Requests Today"},"cost_today":{"type":"number","title":"Cost Today"},"savings_today":{"type":"number","title":"Savings Today"},"tier":{"type":"string","title":"Tier"}},"type":"object","required":["total_requests","total_tokens","total_cost_usd","total_savings_usd","savings_percent","requests_today","cost_today","savings_today","tier"],"title":"StatsResponse"},"TenantRevenue":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"platform_revenue_usd":{"type":"number","title":"Platform Revenue Usd"},"total_requests":{"type":"integer","title":"Total Requests"}},"type":"object","required":["tenant_id","name","company","platform_revenue_usd","total_requests"],"title":"TenantRevenue"},"TenantStatsResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"tier":{"type":"string","title":"Tier"},"total_requests":{"type":"integer","title":"Total Requests"},"total_tokens":{"type":"integer","title":"Total Tokens"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"total_savings_usd":{"type":"number","title":"Total Savings Usd"},"optimization_enabled":{"type":"boolean","title":"Optimization Enabled"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["tenant_id","name","company","tier","total_requests","total_tokens","total_cost_usd","total_savings_usd","optimization_enabled","created_at"],"title":"TenantStatsResponse"},"ToolDef":{"properties":{"type":{"type":"string","title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/FunctionDef"}},"type":"object","required":["function"],"title":"ToolDef"},"TrainingJobResponse":{"properties":{"id":{"type":"string","title":"Id"},"task_cluster_id":{"type":"string","title":"Task Cluster Id"},"micro_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Micro Model Id"},"status":{"type":"string","title":"Status"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"base_model":{"type":"string","title":"Base Model"},"lora_rank":{"type":"integer","title":"Lora Rank"},"epochs":{"type":"integer","title":"Epochs"},"learning_rate":{"type":"number","title":"Learning Rate"},"train_examples":{"type":"integer","title":"Train Examples"},"eval_examples":{"type":"integer","title":"Eval Examples"},"provider":{"type":"string","title":"Provider"},"external_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Job Id"},"weights_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weights Path"},"training_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Training Loss"},"eval_loss":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eval Loss"},"training_cost_usd":{"type":"number","title":"Training Cost Usd"},"training_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Training Duration Seconds"},"created_at":{"type":"string","title":"Created At"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","task_cluster_id","micro_model_id","status","error_message","base_model","lora_rank","epochs","learning_rate","train_examples","eval_examples","provider","external_job_id","weights_path","training_loss","eval_loss","training_cost_usd","training_duration_seconds","created_at","started_at","completed_at"],"title":"TrainingJobResponse"},"TriggerTrainingRequest":{"properties":{"cluster_id":{"type":"string","title":"Cluster Id"},"base_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Model"},"lora_rank":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Lora Rank"},"epochs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Epochs"},"learning_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Learning Rate"}},"type":"object","required":["cluster_id"],"title":"TriggerTrainingRequest"},"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"},"WaitlistEntryResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"},"invited":{"type":"boolean","title":"Invited"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","email","company","use_case","invited","created_at"],"title":"WaitlistEntryResponse"},"WaitlistRequest":{"properties":{"email":{"type":"string","title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"use_case":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Use Case"}},"type":"object","required":["email"],"title":"WaitlistRequest"}}}}