curl --request GET \
--url 'https://api.computer.stateset.app/api/v1/jobs/stats' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY"
{
"windows": [
{
"window": "today",
"total": 102,
"succeeded": 1,
"failed": 1,
"cancelled": 1,
"in_flight": 1,
"success_rate": 7.5,
"avg_duration_seconds": 7.5,
"total_cost_usd": 1.5
}
]
}
Get Job Stats V1
Quick aggregate snapshot across three rolling windows. Useful for tenant operational dashboards — answers ‘how am I doing today / this week / this month’ in…
GET
/
api
/
v1
/
jobs
/
stats
curl --request GET \
--url 'https://api.computer.stateset.app/api/v1/jobs/stats' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY"
{
"windows": [
{
"window": "today",
"total": 102,
"succeeded": 1,
"failed": 1,
"cancelled": 1,
"in_flight": 1,
"success_rate": 7.5,
"avg_duration_seconds": 7.5,
"total_cost_usd": 1.5
}
]
}
Quick aggregate snapshot across three rolling windows.
Useful for tenant operational dashboards — answers ‘how am I doing
today / this week / this month’ in one round trip. Computed in
Python over a single query per window so the SQL stays portable
across SQLite + Postgres.
in_flight is the live count regardless of window (live jobs don’t
have a created_at filter applied, since ‘in flight’ is a current
state, not a historical event).
Response
JobStatsResponse
JobStatsWindow[]
required
Three windows in fixed order: today, last_7d, last_30d.
Show JobStatsWindow
Show JobStatsWindow
string
required
integer
required
Jobs created within the window.
integer
required
integer
required
integer
required
integer
required
Queued + running + awaiting_approval, AT THE TIME OF QUERY (not window-bounded).
number
required
succeeded / (succeeded + failed). 0.0 when neither bucket is populated. Excludes cancelled — those are user actions, not agent failures.
number
required
Mean wall-clock between created_at and updated_at across terminal-status jobs in the window. 0.0 when no terminal rows fell in the window.
number
required
Status codes
| Code | Meaning |
|---|---|
200 | Successful Response |
curl --request GET \
--url 'https://api.computer.stateset.app/api/v1/jobs/stats' \
--header "X-API-Key: $STATESET_COMPUTER_USE_API_KEY"
{
"windows": [
{
"window": "today",
"total": 102,
"succeeded": 1,
"failed": 1,
"cancelled": 1,
"in_flight": 1,
"success_rate": 7.5,
"avg_duration_seconds": 7.5,
"total_cost_usd": 1.5
}
]
}
Last modified on August 31, 2026