> 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-executions-comparison.md).

# Get Agent Executions Comparison

Get the "Execution status comparison" card for an agent's Executions tab.

Compares total executions, success rate and average execution time for the requested `daterange` against an earlier window, derived by the server via `compare_to`: `PREVIOUS_MONTH` (the default) is the whole calendar month before the month the range starts in; `PRECEDING_PERIOD` is the equally long window ending the day before the range starts. Also returns the current window's average credits consumed per execution.

Both ends of `daterange` are required, and the end may not precede the start. Accessible by any member of the agent's organisation.

```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":{"SpendComparisonBasis":{"type":"string","enum":["PREVIOUS_MONTH","PRECEDING_PERIOD"],"title":"SpendComparisonBasis","description":"What a spend comparison's previous window is.\n\nAn explicit choice rather than a rule inferred from the shape of the requested\nrange: \"the range starts on the 1st, so they must mean the previous month\"\nwould silently change basis when a caller shifted a rolling window by a day.\n\nThe window arithmetic lives on the enum so the two rules are stated in one\nplace, next to each other, where they can be compared."},"ExecutionsComparisonResponseSchema":{"properties":{"current":{"$ref":"#/components/schemas/ExecutionsWindowStatsSchema"},"previous":{"$ref":"#/components/schemas/ExecutionsWindowStatsSchema"},"compare_to":{"$ref":"#/components/schemas/SpendComparisonBasis","description":"Which rule produced the previous window (see SpendComparisonBasis)"},"change":{"type":"integer","title":"Change","description":"Absolute change in total executions against the previous window"},"change_ratio":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Change Ratio","description":"change as a fraction of the previous window's total, or null when the previous window had no executions at all"},"average_credit_cost":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Average Credit Cost","description":"Average credits consumed per execution in the current window, or null when the window had no executions"}},"type":"object","required":["current","previous","compare_to","change","change_ratio","average_credit_cost"],"title":"ExecutionsComparisonResponseSchema","description":"Response for the \"Execution status comparison\" card on the Executions tab:\nan agent's executions in a window against an earlier one, plus the current\nwindow's average credit cost per execution."},"ExecutionsWindowStatsSchema":{"properties":{"date_from":{"type":"string","title":"Date From","description":"Start of the window, YYYY-MM-DD, inclusive"},"date_to":{"type":"string","title":"Date To","description":"End of the window, YYYY-MM-DD, inclusive"},"total_count":{"type":"integer","title":"Total Count","description":"Total executions started in this window"},"success_count":{"type":"integer","title":"Success Count","description":"Executions that succeeded in this window"},"success_rate":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Success Rate","description":"success_count / total_count, or null when total_count is 0"},"duration_stats":{"$ref":"#/components/schemas/ExecutionDurationStatsSchema"}},"type":"object","required":["date_from","date_to","total_count","success_count","success_rate","duration_stats"],"title":"ExecutionsWindowStatsSchema","description":"Execution totals, success rate and duration stats over one closed date window."},"ExecutionDurationStatsSchema":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of executions with a recorded duration that this average/min/max is computed over — not the total number of executions in the requested scope. PENDING/STARTED runs have no duration yet and are excluded from both."},"average_duration_seconds":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Average Duration Seconds"},"min_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Duration Seconds"},"max_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Duration Seconds"}},"type":"object","required":["count","min_duration_seconds","max_duration_seconds"],"title":"ExecutionDurationStatsSchema","description":"Execution duration statistics.\n\nOnly executions with a recorded duration contribute — see\n`count`'s description."}}},"paths":{"/api/v1/agents/{agent_id}/executions/comparison":{"get":{"tags":["agents","public"],"summary":"Get Agent Executions Comparison","description":"Get the \"Execution status comparison\" card for an agent's Executions tab.\n\nCompares total executions, success rate and average execution time for the\nrequested `daterange` against an earlier window, derived by the server via\n`compare_to`: `PREVIOUS_MONTH` (the default) is the whole calendar month\nbefore the month the range starts in; `PRECEDING_PERIOD` is the equally\nlong window ending the day before the range starts. Also returns the\ncurrent window's average credits consumed per execution.\n\nBoth ends of `daterange` are required, and the end may not precede the\nstart. Accessible by any member of the agent's organisation.","operationId":"agents-get_agent_executions_comparison","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}},{"name":"compare_to","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SpendComparisonBasis","description":"What to compare the range against. `PREVIOUS_MONTH` is the whole calendar month before the month the range starts in (month-over-month). `PRECEDING_PERIOD` is the equally long window ending the day before the range starts, for a rolling window.","default":"PREVIOUS_MONTH"},"description":"What to compare the range against. `PREVIOUS_MONTH` is the whole calendar month before the month the range starts in (month-over-month). `PRECEDING_PERIOD` is the equally long window ending the day before the range starts, for a rolling window."},{"name":"daterange","in":"query","required":true,"schema":{"type":"string","description":"Date range as 'start,end' (ISO 8601 dates). Both ends are required for this endpoint, e.g. '2026-08-01,2026-08-31'; an open-ended range is rejected with 400.","title":"Daterange"},"description":"Date range as 'start,end' (ISO 8601 dates). Both ends are required for this endpoint, e.g. '2026-08-01,2026-08-31'; an open-ended range is rejected with 400."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionsComparisonResponseSchema"}}}},"400":{"description":"Malformed, open-ended, or inverted date range","content":{"application/json":{}}},"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":{}}}}}}}}
```
