{"openapi":"3.1.0","info":{"title":"Metaculus AI API","version":"0.1.0"},"paths":{"/api/v1/forecast/":{"post":{"tags":["v1"],"summary":"Create Forecast Task","operationId":"create_forecast_task_api_v1_forecast__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastRequestV1"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastAcceptedV1"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forecast/{forecast_id}/":{"get":{"tags":["v1"],"summary":"Get Forecast Task","operationId":"get_forecast_task_api_v1_forecast__forecast_id___get","parameters":[{"name":"forecast_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Forecast Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastResultV1"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/forecast/{forecast_id}/stream/":{"get":{"tags":["v1"],"summary":"Stream Forecast Task","operationId":"stream_forecast_task_api_v1_forecast__forecast_id__stream__get","parameters":[{"name":"forecast_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Forecast Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/balance/":{"get":{"tags":["v1"],"summary":"Get Balance","operationId":"get_balance_api_v1_balance__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceV1"}}}}}}}},"components":{"schemas":{"BalanceV1":{"properties":{"credits_remaining":{"type":"integer","title":"Credits Remaining"}},"type":"object","required":["credits_remaining"],"title":"BalanceV1"},"ForecastAcceptedV1":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/RunStatus"},"forecast_effort":{"type":"string","enum":["low","medium","high","xhigh"],"title":"Forecast Effort"}},"type":"object","required":["id","status","forecast_effort"],"title":"ForecastAcceptedV1"},"ForecastRequestV1":{"properties":{"question":{"$ref":"#/components/schemas/QuestionV1"},"forecast_effort":{"type":"string","enum":["low","medium","high","xhigh"],"title":"Forecast Effort"}},"additionalProperties":false,"type":"object","required":["question","forecast_effort"],"title":"ForecastRequestV1"},"ForecastResultV1":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/RunStatus"},"result":{"anyOf":[{},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"forecast_effort":{"type":"string","enum":["low","medium","high","xhigh"],"title":"Forecast Effort"},"credits_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Used"}},"type":"object","required":["id","status","forecast_effort","credits_used"],"title":"ForecastResultV1"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"QuestionV1":{"properties":{"title":{"type":"string","title":"Title"},"type":{"type":"string","enum":["binary","multiple_choice","numeric","discrete","date"],"title":"Type"},"resolution_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Criteria"},"fine_print":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fine Print"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"open_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Open Time"},"scheduled_close_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Scheduled Close Time"},"scheduled_resolve_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Scheduled Resolve Time"},"scaling":{"anyOf":[{"$ref":"#/components/schemas/ScalingV1"},{"type":"null"}]},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"}},"additionalProperties":false,"type":"object","required":["title","type"],"title":"QuestionV1"},"RunStatus":{"type":"string","enum":["pending","running","cancelling","completed","failed","cancelled"],"title":"RunStatus"},"ScalingV1":{"properties":{"range_min":{"type":"number","title":"Range Min","description":"Lower bound of the forecast range. A plain number here is a regular value, except for `date`-type questions, where it is a Unix epoch **seconds** timestamp (not milliseconds). For `date`-type questions only, an ISO 8601 date or datetime string (e.g. \"2026-08-01\" or \"2026-08-01T00:00:00Z\") may be given instead and is converted to epoch seconds automatically; timezone-naive strings are treated as UTC."},"range_max":{"type":"number","title":"Range Max","description":"Upper bound of the forecast range. A plain number here is a regular value, except for `date`-type questions, where it is a Unix epoch **seconds** timestamp (not milliseconds). For `date`-type questions only, an ISO 8601 date or datetime string (e.g. \"2026-08-01\" or \"2026-08-01T00:00:00Z\") may be given instead and is converted to epoch seconds automatically; timezone-naive strings are treated as UTC."},"zero_point":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Zero Point","description":"Anchor for logarithmic scaling; omit for linear scaling. A plain number here is a regular value, except for `date`-type questions, where it is a Unix epoch **seconds** timestamp (not milliseconds). For `date`-type questions only, an ISO 8601 date or datetime string (e.g. \"2026-08-01\" or \"2026-08-01T00:00:00Z\") may be given instead and is converted to epoch seconds automatically; timezone-naive strings are treated as UTC."},"inbound_outcome_count":{"type":"integer","title":"Inbound Outcome Count","description":"Number of in-bound buckets in a forecast on this question, between 1 and 201","default":200},"open_lower_bound":{"type":"boolean","title":"Open Lower Bound"},"open_upper_bound":{"type":"boolean","title":"Open Upper Bound"},"nominal_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nominal Min","description":"Display label for the lower bound. A plain number here is a regular value, except for `date`-type questions, where it is a Unix epoch **seconds** timestamp (not milliseconds). For `date`-type questions only, an ISO 8601 date or datetime string (e.g. \"2026-08-01\" or \"2026-08-01T00:00:00Z\") may be given instead and is converted to epoch seconds automatically; timezone-naive strings are treated as UTC."},"nominal_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nominal Max","description":"Display label for the upper bound. A plain number here is a regular value, except for `date`-type questions, where it is a Unix epoch **seconds** timestamp (not milliseconds). For `date`-type questions only, an ISO 8601 date or datetime string (e.g. \"2026-08-01\" or \"2026-08-01T00:00:00Z\") may be given instead and is converted to epoch seconds automatically; timezone-naive strings are treated as UTC."}},"additionalProperties":false,"type":"object","required":["range_min","range_max","open_lower_bound","open_upper_bound"],"title":"ScalingV1"},"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"}}}}