Skip to content
Subako Docs
Esc
navigateopen⌘Jpreview

GET /v1/workspaces/{workspace_id}/usage

GET/v1/workspaces/{workspace_id}/usage
Authorization
AuthorizationBearer token · headerrequired
Path parameters
workspace_idstring<uuid>required
Workspace id
Query parameters
limitinteger<int64>
min 1 · max 200
afterstring<uuid>
orderOrderParam
Newest first when omitted.
Allowed:ascdesc
Responses
200One page, newest recorded first unless order=asc.
itemsUsageEventBody[]required
Show properties
Array of UsageEventBody
adjustsstring<uuid> | nullrequired
The event this one corrects.
costinteger<int64> | nullrequired
Hundred-millionths of a credit, as `balance`. Absent for a byok call or a platform one nothing priced.
idstring<uuid>required
occurred_atstring<date-time>required
recorded_atstring<date-time>required
resourceUsageResourceBodyrequired
What an event measured; `kind` names the shape.
Show properties
One of:
object
kindstringrequired
Allowed:llm_tokens
modelstringrequired
model_call_idstring<uuid>required
model_provider_idstring<uuid>required
provider_ownerModelProviderOwnerBodyrequired
Mirrors `ModelProviderOwner`'s spellings; same rule as the format body.
Allowed:platformworkspace
run_idstring<uuid>required
session_idstring<uuid>required
usageModelUsageBodyrequired
Show properties
One of:
object
formatstringrequired
Allowed:anthropic
usageAnthropicUsageBodyrequired
Show properties
cache_creation_input_tokensinteger<int64>required
cache_read_input_tokensinteger<int64>required
input_tokensinteger<int64>required
output_tokensinteger<int64>required
object
formatstringrequired
Allowed:openai_responses
usageOpenaiResponsesUsageBodyrequired
Show properties
cache_write_input_tokensinteger<int64>required
cached_input_tokensinteger<int64>required
input_tokensinteger<int64>required
output_tokensinteger<int64>required
reasoning_output_tokensinteger<int64>required
object
duration_msinteger<int64>required
harnessstringrequired
kindstringrequired
Allowed:harness_runtime
run_idstring<uuid>required
session_idstring<uuid>required
workspace_idstring<uuid>required
next_cursorstring<uuid> | nullrequired
`None` on the last page.
400Bad limit, cursor, order, or path parameter.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
403Caller lacks usage.read.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
404No such workspace, or the caller cannot see it.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET "https://api.us.cloud.subako.ai/v1/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/usage" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "items": [
    {
      "adjusts": "60135a0a-8dab-43fa-be89-97697a4b4be7",
      "cost": 0,
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "occurred_at": "2019-08-24T14:15:22Z",
      "recorded_at": "2019-08-24T14:15:22Z",
      "resource": {
        "kind": "llm_tokens",
        "model": "string",
        "model_call_id": "9b27d4e1-b224-4b1a-b5e9-e99e5c49f3ea",
        "model_provider_id": "e8dd39c4-1070-4c00-8ab5-c345bdef77c9",
        "provider_owner": "platform",
        "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
        "session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82",
        "usage": {
          "format": "anthropic",
          "usage": {
            "cache_creation_input_tokens": 0,
            "cache_read_input_tokens": 0,
            "input_tokens": 0,
            "output_tokens": 0
          }
        }
      },
      "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"
    }
  ],
  "next_cursor": "a7ec8888-a9c3-4732-a281-9a08510f220b"
}