> For the complete documentation index, see [llms.txt](https://docs.claret.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.claret.app/api-reference/compute/tenant-public-forecasts-generate.md).

# Tenant.public.forecasts.generate

```json
{"openapi":"3.1.0","info":{"title":"Claret","version":"1.0.0"},"tags":[{"name":"Compute","description":"Generate supply plans and forecasts. Runs asynchronously where noted."}],"servers":[{"url":"https://plan.claret.app/{tenant}/api/v1","description":"Production","variables":{"tenant":{"default":"your-tenant","description":"Your Claret tenant identifier (the slug in your Claret URL)."}}}],"security":[{"http":[]}],"components":{"securitySchemes":{"http":{"type":"http","scheme":"bearer"}},"schemas":{"GenerateForecastRequest":{"type":"object","properties":{"item_customer_group_id":{"type":"integer"},"item_name":{"type":"string","maxLength":255},"item_id":{"type":"integer"},"customer_group_name":{"type":"string","maxLength":255},"customer_group_id":{"type":"integer"},"scope":{"type":"string","enum":["all"]},"forecast_periods":{"type":"integer","minimum":1},"algorithm":{"type":"string","enum":["auto","AR","ARIMA","ETS","NAIVE","SNAIVE","TSLM","VAR"]},"missing_imputation":{"type":"string","enum":["auto","Mean"]},"forecast_constraint":{"type":"string","enum":["auto","Positivity"]},"history_start":{"type":"string","format":"date-time"},"history_end":{"type":"string","format":"date-time"},"dry_run":{"type":"boolean"}},"title":"GenerateForecastRequest"}},"responses":{"AuthenticationException":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}},"paths":{"/forecasts/generate":{"post":{"operationId":"tenant.public.forecasts.generate","tags":["Compute"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateForecastRequest"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","const":"Dry run completed. Forecast request validated successfully."},"data":{"type":"array","prefixItems":[{"type":"object","properties":{"dry_run":{"type":"boolean"},"item_count":{"type":"integer"},"forecast_periods":{},"estimated_credit_cost":{"type":"integer"},"validation_passed":{"type":"boolean"}},"required":["dry_run","item_count","forecast_periods","estimated_credit_cost","validation_passed"]}],"minItems":1,"maxItems":1,"additionalItems":false},"meta":{"anyOf":[{"type":"array","items":{}},{"type":"string"}]},"links":{"type":"string"}},"required":["message","data","meta","links"]}}}},"202":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"array","prefixItems":[{"type":"object","properties":{"job_id":{"type":"integer"},"item_count":{"type":"integer"},"forecast_periods":{"type":["integer","null"]},"algorithm":{},"status":{"type":"string","const":"queued"}},"required":["job_id","item_count","forecast_periods","algorithm","status"]}],"minItems":1,"maxItems":1,"additionalItems":false},"meta":{"anyOf":[{"type":"array","items":{}},{"type":"string"}]},"links":{"anyOf":[{"type":"object","properties":{"job_status":{"type":"string"}},"required":["job_status"]},{"type":"string"}]}},"required":["message","data","meta","links"]}}}},"401":{"$ref":"#/components/responses/AuthenticationException"},"422":{"$ref":"#/components/responses/ValidationException"},"500":{"description":"","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"https://httpstatuses.com/500"},"title":{"type":"string","const":"Internal Server Error"},"status":{"type":"integer","const":500},"detail":{"type":"string","const":"An error occurred while starting forecast generation."},"request_id":{"type":"string"},"errors":{"type":"string"}},"required":["type","title","status","detail","request_id","errors"]}}}},"503":{"description":"","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","const":"https://httpstatuses.com/503"},"title":{"type":"string","const":"Service Unavailable"},"status":{"type":"integer","const":503},"detail":{"type":"string","const":"The forecast compute queue is currently overloaded. Please try again later."},"request_id":{"type":"string"},"errors":{"type":"string"}},"required":["type","title","status","detail","request_id","errors"]}}}}}}}}}
```
