API ReferenceUsage

Usage for the calling workspace

GET
/v1/usage

What this workspace spent, how many tasks ran, how many completed, and what drove the cost, for the last 7, 30, or 90 days, with the prior range of equal length for comparison. Sums come from rollup rows written at run settlement. Typical cost and time are medians over the newest completed runs in the range and are null under 5.

Authorization

bearerAuth
AuthorizationBearer <token>

Send a SimpleServe API key as Authorization: Bearer <key>.

In: header

Query Parameters

range?string
Default"30d"

Value in

  • "7d"
  • "30d"
  • "90d"

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/v1/usage"
{  "object": "workspace.usage",  "range": "30d",  "range_start": "2026-08-04T00:00:00Z",  "range_end": "2026-09-03T00:00:00Z",  "totals": {    "spent_usd": 2.71,    "tasks": 50,    "completed": 46,    "failed": 3,    "limit_reached": 1,    "failed_cost_usd": 0.31,    "completion_rate": 0.9388,    "median_cost_usd": 0.05,    "median_duration_seconds": 27  },  "prior": null,  "daily": [    {      "date": "2026-09-02",      "spent_usd": 1.12,      "completed": 31,      "failed": 3,      "cancelled": 1    }  ],  "by_agent": [    {      "agent_id": "simpleserve/deepseek-v4-flash",      "agent_name": "DeepSeek V4 Flash",      "spent_usd": 1.94,      "tasks": 35,      "completed": 31,      "failed": 3,      "failed_cost_usd": 0.31,      "median_cost_usd": 0.02,      "daily_spent_usd": [        1.12      ]    }  ],  "by_source": [    {      "source": "chat",      "label": "Chat",      "spent_usd": 1.6,      "tasks": 30    },    {      "source": "workstream",      "label": "Workstreams",      "spent_usd": 0.81,      "tasks": 14    }  ],  "by_meter": [    {      "id": "model_input_tokens",      "label": "Input",      "unit": "tokens",      "quantity": 1560000,      "cost_usd": 1.67,      "share": 0.62    }  ],  "sample_size": 46}