> For the complete documentation index, see [llms.txt](https://docs.ibexa.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ibexa.ai/developers/rest-api/agents/get-agent-cost-forecast.md).

# Get Agent Cost Forecast

Get a cost and credits forecast for an agent through the end of the current month.

Returns actual cumulative cost (`items`) and credits (`credits`) for each day from the start of the current month to yesterday, followed by projected cumulative values from today onwards. `items` may have multiple rows per date (one per currency); `credits` has at most one row per date, since credits carry no currency dimension. Requires platform administration role (admin or owner).

```json
{"openapi":"3.1.0","info":{"title":"Ibexa Agentic Marketing Platform","version":"0.1.0"},"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/login/access-token"}}}},"schemas":{"ForecastMethod":{"type":"string","enum":["SEASONALITY","LINEAR"],"title":"ForecastMethod","description":"Algorithm used to project future costs in a cost forecast."},"AgentCostForecastResponseSchema":{"properties":{"agent_id":{"type":"integer","title":"Agent Id"},"items":{"items":{"$ref":"#/components/schemas/CostForecastDaySchema"},"type":"array","title":"Items"},"credits":{"items":{"$ref":"#/components/schemas/CreditForecastDaySchema"},"type":"array","title":"Credits"}},"type":"object","required":["agent_id","items","credits"],"title":"AgentCostForecastResponseSchema","description":"Actual daily cost and credits plus end-of-month projection for a specific agent."},"CostForecastDaySchema":{"properties":{"date":{"type":"string","title":"Date","description":"Calendar date in YYYY-MM-DD format"},"cost_amount":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Cost Amount"},"cost_currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Currency"},"is_projection":{"type":"boolean","title":"Is Projection","description":"True when this value is a projected estimate; False when it is a recorded actual"}},"type":"object","required":["date","cost_currency","is_projection"],"title":"CostForecastDaySchema","description":"Cost for a single calendar day — either actual or projected."},"CreditForecastDaySchema":{"properties":{"date":{"type":"string","title":"Date","description":"Calendar date in YYYY-MM-DD format"},"credits_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Credits Amount"},"is_projection":{"type":"boolean","title":"Is Projection","description":"True when this value is a projected estimate; False when it is a recorded actual"}},"type":"object","required":["date","credits_amount","is_projection"],"title":"CreditForecastDaySchema","description":"Credits for a single calendar day — either actual or projected.\n\nCredits carry no currency, so unlike `CostForecastDaySchema` this is always\nexactly one entry per date."}}},"paths":{"/api/v1/agents/{agent_id}/usage/forecast":{"get":{"tags":["agents","public"],"summary":"Get Agent Cost Forecast","description":"Get a cost and credits forecast for an agent through the end of the current month.\n\nReturns actual cumulative cost (`items`) and credits (`credits`) for each day from the\nstart of the current month to yesterday, followed by projected cumulative values from\ntoday onwards. `items` may have multiple rows per date (one per currency); `credits` has\nat most one row per date, since credits carry no currency dimension.\nRequires platform administration role (admin or owner).","operationId":"agents-get_agent_cost_forecast","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ForecastMethod","description":"Forecast algorithm. SEASONALITY (default) uses 6 months of historical patterns; LINEAR extrapolates the current daily average.","default":"SEASONALITY"},"description":"Forecast algorithm. SEASONALITY (default) uses 6 months of historical patterns; LINEAR extrapolates the current daily average."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCostForecastResponseSchema"}}}},"401":{"description":"User not authenticated","content":{"application/json":{}}},"403":{"description":"User lacks permission","content":{"application/json":{}}},"404":{"description":"Resource not found or user has no permission to access it","content":{"application/json":{}}}}}}}}
```
