{"openapi":"3.1.0","info":{"title":"Harpoon","description":"REST API gateway for the inference gRPC service","version":"0.1.0"},"paths":{"/healthz":{"get":{"summary":"Healthz","operationId":"getHealth","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Gethealth"}}}}}}},"/api/live-bench/snapshot":{"get":{"summary":"Get Snapshot","description":"Return the latest LiveBenchSnapshot.","operationId":"get_snapshot_api_live_bench_snapshot_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/register":{"post":{"summary":"Register","operationId":"registerUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"summary":"Login","operationId":"loginUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"summary":"Logout","operationId":"logoutUser","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/forgot-password":{"post":{"summary":"Forgot Password","operationId":"forgotPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/reset-password":{"post":{"summary":"Reset Password","operationId":"resetPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/oauth/start":{"get":{"summary":"Oauth Start","operationId":"startOAuth","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"next","in":"query","required":false,"schema":{"type":"string","default":"/account/keys","title":"Next"}},{"name":"intent","in":"query","required":false,"schema":{"type":"string","default":"login","title":"Intent"}},{"name":"posthog_distinct_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posthog Distinct Id"}},{"name":"accepted_free_tier_data_terms","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted Free Tier Data Terms"}},{"name":"consent_version","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Version"}},{"name":"ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/oauth/callback/{provider}":{"get":{"summary":"Oauth Callback","operationId":"completeOAuthCallback","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/account/me":{"get":{"summary":"Me","operationId":"getAccountMe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"summary":"Delete Account","description":"Permanently delete the authenticated user's account and all associated data.","operationId":"deleteAccountMe","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/account/keys":{"get":{"summary":"Keys List","operationId":"listAccountKeys","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Keys Create","operationId":"createAccountKey","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/account/keys/{key_id}":{"delete":{"summary":"Keys Revoke","operationId":"revokeAccountKey","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/account/oauth/identities":{"get":{"summary":"Oauth Identities","operationId":"listOAuthIdentities","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/account/oauth/identities/{provider}":{"delete":{"summary":"Oauth Unlink Identity","operationId":"unlinkOAuthIdentity","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/account/privacy":{"get":{"summary":"Get Privacy Settings","operationId":"getPrivacySettings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Post Privacy Settings","operationId":"postPrivacySettings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacySettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Patch Privacy Settings","operationId":"patchPrivacySettings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacySettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/account/usage":{"get":{"summary":"Usage History","operationId":"listUsageEvents","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":1000,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":100000,"minimum":0,"default":0,"title":"Offset"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Usage History","operationId":"deleteUsageEvents","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/account/usage/summary":{"get":{"summary":"Usage Summary","description":"Return pre-aggregated usage summary (daily, by-model, by-source, totals, recent events).","operationId":"getUsageSummary","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/account/billing":{"get":{"summary":"Billing Summary","operationId":"getBillingSummary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/account/billing/stripe":{"get":{"summary":"Stripe Billing Profile","operationId":"getStripeBillingProfile","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Stripe Billing Session","operationId":"createStripeBillingSession","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeBillingSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/billing/credits":{"post":{"summary":"Admin Grant Credits","description":"Grant credits to a target user.\n\nRequires admin.  Writes an immutable audit record.","operationId":"adminGrantCredits","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantCreditsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/billing/usage/reset":{"post":{"summary":"Admin Reset Usage","description":"Delete usage events for a target user (all time or within a window).\n\nRequires admin.  Writes an immutable audit record.","operationId":"adminResetUsage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetUsageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/billing/adjustments":{"get":{"summary":"Admin List Adjustments","description":"List billing adjustments, optionally filtered by target user.","operationId":"adminListAdjustments","parameters":[{"name":"target_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contact":{"post":{"summary":"Submit Contact Form","description":"Accept a contact form submission and forward it to Slack.","operationId":"submitContactForm","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/playground/session":{"get":{"summary":"Create Session","operationId":"createPlaygroundSession","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/forecast":{"post":{"summary":"Forecast","description":"Run a forecast against the inference gRPC service.","operationId":"forecast","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastResponseBody"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/forecast/batch":{"post":{"summary":"Forecast Batch","description":"Run a batch of forecast requests.","operationId":"forecastBatch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastBatchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastBatchResponseBody"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/forecast/ensemble":{"post":{"summary":"Forecast Ensemble","description":"Run multiple TSFMs, rank by fit quality, and return a blended forecast.","operationId":"forecastEnsemble","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnsembleForecastRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnsembleForecastResponseBody"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/models":{"get":{"summary":"List Models","operationId":"listModels","parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"capability","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capability"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"family","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Family"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"enum":["popular","context","latency"],"type":"string"},{"type":"null"}],"description":"Sort order: popular, context, latency","title":"Sort"},"description":"Sort order: popular, context, latency"},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by tier (e.g. free, paid)","title":"Tier"},"description":"Filter by tier (e.g. free, paid)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/models/{model_id}":{"get":{"summary":"Get Model","operationId":"getModelById","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schedules":{"post":{"summary":"Create","operationId":"createSchedule","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScheduleRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List All","operationId":"listSchedules","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schedules/{schedule_id}":{"get":{"summary":"Get By Id","operationId":"getSchedule","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update","operationId":"updateSchedule","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete","operationId":"deleteSchedule","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schedules/{schedule_id}/pause":{"post":{"summary":"Pause","operationId":"pauseSchedule","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schedules/{schedule_id}/resume":{"post":{"summary":"Resume","operationId":"resumeSchedule","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/schedules/{schedule_id}/runs":{"get":{"summary":"Get Runs","operationId":"listScheduleRuns","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stripe/webhook":{"post":{"summary":"Stripe Webhook","operationId":"handleStripeWebhook","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Handlestripewebhook"}}}}}}},"/api/system/status":{"get":{"summary":"System Status","operationId":"getSystemStatus","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/schema":{"get":{"summary":"Api Schema","operationId":"getApiSchema","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/validate":{"post":{"summary":"Validate Credential","operationId":"validateCredential","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateCredentialRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"summary":"Oauth Metadata","description":"Return OAuth 2.1 authorization server metadata (RFC 8414).","operationId":"getOAuthAuthorizationServerMetadata","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-protected-resource/mcp":{"get":{"summary":"Oauth Protected Resource Metadata","description":"Return OAuth protected resource metadata for the hosted MCP endpoint.","operationId":"getMcpProtectedResourceMetadata","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/register":{"post":{"summary":"Oauth Register","description":"Register a new OAuth client (RFC 7591).","operationId":"registerOAuthClient","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterClientRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/authorize":{"get":{"summary":"Oauth Authorize Get","description":"Render the consent page or sign-in form for the authorization flow.","operationId":"getOAuthAuthorize","parameters":[{"name":"client_id","in":"query","required":true,"schema":{"type":"string","title":"Client Id"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","title":"Redirect Uri"}},{"name":"response_type","in":"query","required":true,"schema":{"type":"string","title":"Response Type"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string","title":"Code Challenge"}},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string","default":"S256","title":"Code Challenge Method"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"mcp","title":"Scope"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"resource","in":"query","required":false,"schema":{"type":"string","default":"","title":"Resource"}},{"name":"switch_account","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Switch Account"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Oauth Authorize Post","description":"Process a consent action or sign-in submission.","operationId":"postOAuthAuthorize","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_postOAuthAuthorize"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/token":{"post":{"summary":"Oauth Token","description":"Exchange an authorization code for an access token.","operationId":"createOAuthToken","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_createOAuthToken"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/costs":{"post":{"summary":"Look up per-request costs in nano-USD","description":"Return ``costNanoUsd`` for each ``requestId`` owned by the caller.\n\nCalled by HuggingFace's reconciliation system every minute in batches of up\nto 10,000 request IDs. Each requested ID is echoed back in the response,\nwith ``costNanoUsd: 0`` if the caller does not own the request or if it\ndoes not exist, to avoid leaking information about other tenants.","operationId":"billingCosts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCostsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCostsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/campaigns/referral":{"get":{"summary":"Get User Referral","description":"Return the current user's referral code and link for the default campaign.","operationId":"getUserReferral","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/campaigns/referral/invite":{"post":{"summary":"Send Referral Invites","description":"Send referral invite emails to the provided addresses.","operationId":"sendReferralInvites","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInviteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/campaigns/credits":{"get":{"summary":"Get Promo Credits","description":"Return the user's promotional credit ledger.","operationId":"getPromoCreditLedger","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/campaigns/info/{code}":{"get":{"summary":"Get Campaign Info","description":"Return public metadata about a referral code (for the /invite landing page).","operationId":"getCampaignInfo","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"BillingCostItem":{"properties":{"requestId":{"type":"string","title":"Requestid"},"costNanoUsd":{"type":"integer","minimum":0.0,"title":"Costnanousd"}},"type":"object","required":["requestId","costNanoUsd"],"title":"BillingCostItem","description":"HF spec: ``{\"requestId\": \"...\", \"costNanoUsd\": 100}`` (non-negative int)."},"BillingCostsRequest":{"properties":{"requestIds":{"items":{"type":"string"},"type":"array","maxItems":10000,"title":"Requestids"}},"type":"object","required":["requestIds"],"title":"BillingCostsRequest","description":"HF spec: ``{\"requestIds\": [\"...\"]}``."},"BillingCostsResponse":{"properties":{"requests":{"items":{"$ref":"#/components/schemas/BillingCostItem"},"type":"array","title":"Requests"}},"type":"object","required":["requests"],"title":"BillingCostsResponse","description":"HF spec: ``{\"requests\": [BillingCostItem, ...]}``."},"Body_createOAuthToken":{"properties":{"grant_type":{"type":"string","title":"Grant Type"},"code":{"type":"string","title":"Code"},"code_verifier":{"type":"string","title":"Code Verifier"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"client_id":{"type":"string","title":"Client Id"}},"type":"object","required":["grant_type"],"title":"Body_createOAuthToken"},"Body_postOAuthAuthorize":{"properties":{"client_id":{"type":"string","title":"Client Id"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"code_challenge":{"type":"string","title":"Code Challenge"},"code_challenge_method":{"type":"string","title":"Code Challenge Method","default":"S256"},"scope":{"type":"string","title":"Scope","default":"mcp"},"state":{"type":"string","title":"State","default":""},"resource":{"type":"string","title":"Resource","default":""},"action":{"type":"string","title":"Action","default":""},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"}},"type":"object","required":["client_id","redirect_uri","code_challenge"],"title":"Body_postOAuthAuthorize"},"ContactRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"company":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Company"},"topic":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Topic"},"message":{"type":"string","maxLength":2500,"minLength":1,"title":"Message"},"posthog_distinct_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Posthog Distinct Id"}},"type":"object","required":["name","email","message"],"title":"ContactRequest"},"ContactResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","status","created_at"],"title":"ContactResponse"},"CreateKeyRequest":{"properties":{"label":{"type":"string","title":"Label"}},"type":"object","required":["label"],"title":"CreateKeyRequest"},"CreateScheduleRequest":{"properties":{"name":{"type":"string","title":"Name"},"model":{"type":"string","title":"Model"},"source_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Source Url"},"cron_expression":{"type":"string","title":"Cron Expression"},"parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters"},"callback_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Callback Url"},"callback_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Secret"}},"type":"object","required":["name","model","source_url","cron_expression"],"title":"CreateScheduleRequest"},"EnsembleCostBreakdownBody":{"properties":{"model":{"type":"string","title":"Model"},"credits":{"type":"integer","title":"Credits"}},"type":"object","required":["model","credits"],"title":"EnsembleCostBreakdownBody"},"EnsembleForecastRequest":{"properties":{"inputs":{"items":{"$ref":"#/components/schemas/ForecastInputBody"},"type":"array","title":"Inputs"},"parameters":{"$ref":"#/components/schemas/ForecastParametersBody"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models"},"max_models":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Models"},"top_n":{"type":"integer","minimum":1.0,"title":"Top N","default":3},"scoring_metric":{"type":"string","enum":["smape","mase","crps"],"title":"Scoring Metric","default":"smape"},"budget":{"anyOf":[{"type":"integer","minimum":2.0},{"type":"null"}],"title":"Budget"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["inputs"],"title":"EnsembleForecastRequest"},"EnsembleForecastResponseBody":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"ensemble_forecast"},"created":{"type":"integer","title":"Created"},"ranked_results":{"items":{"$ref":"#/components/schemas/EnsembleModelResultBody"},"type":"array","title":"Ranked Results"},"ensemble_result":{"$ref":"#/components/schemas/ForecastResponseBody"},"ensemble_metadata":{"$ref":"#/components/schemas/EnsembleMetadataBody"}},"type":"object","required":["ranked_results","ensemble_result","ensemble_metadata"],"title":"EnsembleForecastResponseBody"},"EnsembleMetadataBody":{"properties":{"models_evaluated":{"items":{"type":"string"},"type":"array","title":"Models Evaluated"},"models_in_ensemble":{"items":{"type":"string"},"type":"array","title":"Models In Ensemble"},"scoring_metric":{"type":"string","title":"Scoring Metric"},"top_n":{"type":"integer","title":"Top N"},"weights":{"additionalProperties":{"type":"number"},"type":"object","title":"Weights"},"cost_breakdown":{"items":{"$ref":"#/components/schemas/EnsembleCostBreakdownBody"},"type":"array","title":"Cost Breakdown"},"total_cost_credits":{"type":"integer","title":"Total Cost Credits"},"selection":{"$ref":"#/components/schemas/EnsembleSelectionMetadataBody"}},"type":"object","required":["models_evaluated","models_in_ensemble","scoring_metric","top_n","weights","cost_breakdown","total_cost_credits","selection"],"title":"EnsembleMetadataBody"},"EnsembleModelResultBody":{"properties":{"model":{"type":"string","title":"Model"},"rank":{"type":"integer","title":"Rank"},"score":{"type":"number","title":"Score"},"scoring_metric":{"type":"string","title":"Scoring Metric"},"weight":{"type":"number","title":"Weight"},"selection_reason":{"type":"string","title":"Selection Reason"},"result":{"$ref":"#/components/schemas/ForecastResponseBody"}},"type":"object","required":["model","rank","score","scoring_metric","weight","selection_reason","result"],"title":"EnsembleModelResultBody"},"EnsembleSelectionMetadataBody":{"properties":{"strategy":{"type":"string","const":"holdout_backtest","title":"Strategy","default":"holdout_backtest"},"selection_basis":{"type":"string","title":"Selection Basis"},"held_out_length":{"type":"integer","title":"Held Out Length"},"candidate_count":{"type":"integer","title":"Candidate Count"},"requested_model_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requested Model Count"},"filters_applied":{"items":{"type":"string"},"type":"array","title":"Filters Applied"}},"type":"object","required":["selection_basis","held_out_length","candidate_count","filters_applied"],"title":"EnsembleSelectionMetadataBody"},"ErrorCode":{"type":"string","enum":["invalid_credential","billing_required","model_access_denied","request_rejected","invalid_argument","payload_too_large","request_too_large","rate_limit_exceeded","upstream_timeout","upstream_unavailable","upstream_grpc_error","upstream_empty","request_error"],"title":"ErrorCode","description":"Canonical error codes for /v1/forecast and adjacent endpoints.\n\nSnake_case strings; one source of truth so callers can compare against a\nfixed set instead of guessing at the wire shape. Adding a new failure\nmode means adding it here and using it at the construction site."},"ErrorResponseBody":{"properties":{"error":{"type":"string","title":"Error"},"code":{"$ref":"#/components/schemas/ErrorCode"},"endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"}},"type":"object","required":["error","code"],"title":"ErrorResponseBody"},"ForecastBatchItemBody":{"properties":{"ok":{"type":"boolean","title":"Ok"},"result":{"anyOf":[{"$ref":"#/components/schemas/ForecastResponseBody"},{"type":"null"}]},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorResponseBody"},{"type":"null"}]}},"type":"object","required":["ok"],"title":"ForecastBatchItemBody"},"ForecastBatchRequest":{"properties":{"requests":{"items":{"$ref":"#/components/schemas/ForecastRequest"},"type":"array","title":"Requests"}},"type":"object","required":["requests"],"title":"ForecastBatchRequest"},"ForecastBatchResponseBody":{"properties":{"object":{"type":"string","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/ForecastBatchItemBody"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ForecastBatchResponseBody"},"ForecastInputBody":{"properties":{"target":{"anyOf":[{"items":{"items":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"array"},"type":"array"},{"type":"null"}],"title":"Target"},"start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"},"past_covariates":{"anyOf":[{"additionalProperties":{"items":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"array"},"type":"object"},{"type":"null"}],"title":"Past Covariates"},"future_covariates":{"anyOf":[{"additionalProperties":{"items":{"type":"number"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Future Covariates"},"static_covariates":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Static Covariates"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","title":"ForecastInputBody"},"ForecastParametersBody":{"properties":{"prediction_length":{"type":"integer","minimum":1.0,"title":"Prediction Length","default":24},"frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frequency"},"quantile_levels":{"items":{"type":"number"},"type":"array","title":"Quantile Levels"},"num_samples":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Num Samples"},"context_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Length"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"}},"type":"object","title":"ForecastParametersBody"},"ForecastRequest":{"properties":{"model":{"type":"string","title":"Model"},"inputs":{"items":{"$ref":"#/components/schemas/ForecastInputBody"},"type":"array","title":"Inputs"},"parameters":{"$ref":"#/components/schemas/ForecastParametersBody"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["model","inputs"],"title":"ForecastRequest"},"ForecastResponseBody":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"forecast"},"created":{"type":"integer","title":"Created"},"model":{"type":"string","title":"Model"},"provider":{"type":"string","title":"Provider","default":"harpoon"},"horizon":{"type":"integer","title":"Horizon"},"prediction_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prediction Length"},"quantile_levels":{"items":{"type":"number"},"type":"array","title":"Quantile Levels"},"input_points":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Points"},"outputs":{"items":{"$ref":"#/components/schemas/PredictionBody"},"type":"array","title":"Outputs"},"usage":{"$ref":"#/components/schemas/UsageBody"},"latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Ms"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"truncated_from":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Truncated From"},"max_context_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Context Length"}},"type":"object","required":["model","horizon","quantile_levels","outputs","usage"],"title":"ForecastResponseBody"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"GrantCreditsRequest":{"properties":{"target_user_id":{"type":"string","title":"Target User Id"},"amount":{"type":"integer","title":"Amount"},"reason":{"type":"string","title":"Reason"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["target_user_id","amount","reason"],"title":"GrantCreditsRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","minLength":8,"title":"Password"},"posthog_distinct_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posthog Distinct Id"},"cf_turnstile_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cf Turnstile Response"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"PredictionBody":{"properties":{"mean":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Mean"},"quantile_predictions":{"anyOf":[{"items":{"$ref":"#/components/schemas/QuantilePrediction"},"type":"array"},{"type":"null"}],"title":"Quantile Predictions"},"samples":{"anyOf":[{"items":{"items":{"items":{"type":"number"},"type":"array"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Samples"},"timestamps":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Timestamps"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["mean"],"title":"PredictionBody"},"PrivacySettingsRequest":{"properties":{"service_improvement_opt_in":{"type":"boolean","title":"Service Improvement Opt In"}},"type":"object","required":["service_improvement_opt_in"],"title":"PrivacySettingsRequest"},"QuantilePrediction":{"properties":{"level":{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0,"title":"Level"},"values":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Values"}},"type":"object","required":["level","values"],"title":"QuantilePrediction"},"RegisterClientRequest":{"properties":{"client_name":{"type":"string","title":"Client Name"},"redirect_uris":{"items":{"type":"string"},"type":"array","title":"Redirect Uris"}},"type":"object","required":["client_name","redirect_uris"],"title":"RegisterClientRequest"},"RegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","minLength":8,"title":"Password"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"posthog_distinct_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posthog Distinct Id"},"accepted_free_tier_data_terms":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Accepted Free Tier Data Terms"},"accepted_data_terms_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted Data Terms Version"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"},"cf_turnstile_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cf Turnstile Response"}},"type":"object","required":["email","password"],"title":"RegisterRequest"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["token","password"],"title":"ResetPasswordRequest"},"ResetUsageRequest":{"properties":{"target_user_id":{"type":"string","title":"Target User Id"},"reason":{"type":"string","title":"Reason"},"start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["target_user_id","reason"],"title":"ResetUsageRequest"},"SendInviteRequest":{"properties":{"emails":{"items":{"type":"string","format":"email"},"type":"array","title":"Emails"}},"type":"object","required":["emails"],"title":"SendInviteRequest"},"StripeBillingSessionRequest":{"properties":{"action":{"type":"string","title":"Action"},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url"},"return_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Url"}},"type":"object","required":["action"],"title":"StripeBillingSessionRequest"},"UpdateScheduleRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"source_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Source Url"},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron Expression"},"parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Parameters"},"callback_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Callback Url"},"callback_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Secret"}},"type":"object","title":"UpdateScheduleRequest"},"UsageBody":{"properties":{"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"total_tokens":{"type":"integer","title":"Total Tokens"}},"type":"object","required":["input_tokens","output_tokens","total_tokens"],"title":"UsageBody"},"ValidateCredentialRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"}},"type":"object","title":"ValidateCredentialRequest"},"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"}}}}