Skip to content

Billing

List billing logs

List credit usage with source filtering and cursor pagination. The default `period` is `30d`; pagination covers only the selected time window. An inverted custom window returns `400`. OAuth scope: `api:read`.

GET/api/v2/billing/logs

List credit usage with source filtering and cursor pagination. The default period is 30d; pagination covers only the selected time window. An inverted custom window returns 400.

OAuth scope: api:read.

Authentication

Send a personal or workspace API key in X-API-Key. See key types and access; operations that reject workspace keys say so in their description.

Send X-API-Key in the request header.

Alternatively

Send a Sim OAuth access token in Authorization: Bearer. See OAuth authentication and scopes.

Authorization: Bearer YOUR_ACCESS_TOKEN

Required scopes: api:read

OAuth flows
json
{
  "authorizationCode": {
    "authorizationUrl": "https://www.sim.ai/api/auth/oauth2/authorize",
    "tokenUrl": "https://www.sim.ai/api/auth/oauth2/token",
    "refreshUrl": "https://www.sim.ai/api/auth/oauth2/token",
    "scopes": {
      "api:read": "Read your workspaces, workflows, files, tables, and logs",
      "api:write": "Read, create, change, run, and delete resources in your workspaces",
      "offline_access": "Stay signed in without asking again"
    }
  }
}

OAuth scope: api:read.

Query parameters

sourcestring

Restrict results to one usage source.

enum
["workflow","wand","sim-chat","mcp_copilot","mothership_block","knowledge-base","voice-input","enrichment","voice-output","api-tool"]
workspaceIdstring

Narrow the ledger to one workspace. An OAuth token or personal API key reports only its user's events; a workspace API key reports every member's events in its bound workspace. The response scope identifies which view was returned. A workspace key asking for another workspace receives the same 404 Workspace not found as an unknown id.

minLength
1
maxLength
128
periodstring

Relative window, all history, or a custom date range. startDate and endDate are accepted only with custom; every other value computes its own window.

default
30d
enum
["1d","7d","30d","all","custom"]
startDatestring

Include events at or after this UTC ISO 8601 timestamp, for example 2026-08-06T00:00:00Z. Required with period=custom. Date-only values, UTC offsets instead of Z, and year 0000 are rejected.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
endDatestring

Include events at or before this UTC ISO 8601 timestamp, for example 2026-08-06T00:00:00Z. Allowed only with period=custom; omission defaults to now. Date-only values, UTC offsets instead of Z, and year 0000 are rejected.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
limitinteger

Maximum usage events per page. Must be a whole number from 1 to 100. Defaults to 50.

default
50
minimum
1
maximum
100
cursorstring

Opaque cursor from the previous page. Send it back with the same sort and filters; only limit may change. Change anything else and pagination must restart without a cursor.

minLength
1

Responses

200

A page of usage events.

object

A cursor-paginated page of credit-consuming usage events.

3 fields
dataarrayRequired

Items in the current page.

Schema details
Array itemobject

One credit-consuming usage event in the billing ledger.

7 fields
idstringRequired

Unique usage-event identifier.

createdAtstringRequired

ISO 8601 timestamp when the usage event was recorded.

format
date-time
sourcestringRequired

Product surface that consumed credits. The legacy mothership_block value identifies the Agent block; sim-chat identifies Sim Chat.

enum
["workflow","wand","sim-chat","mcp_copilot","mothership_block","knowledge-base","voice-input","enrichment","voice-output","api-tool"]
workspaceIdvalueRequired

Workspace attributed to the event, or null for account-level usage.

Schema details

Any of

Option 1string
Option 2null
workflowvalueRequired

Workflow attributed to the event, when applicable.

Schema details

Any of

Option 1object
2 fields
idstringRequired

Workflow identifier.

namevalueRequired

Workflow display name, when available.

Schema details

Any of

Option 1string
Option 2null

Additional properties are not allowed.

Option 2null
runIdvalueRequired

Workflow run attributed to the event, when applicable.

Schema details

Any of

Option 1string
Option 2null
creditCostnumberRequired

Credits apportioned to the event so page rows sum to the rounded page total; may be zero for a sub-credit event.

Additional properties are not allowed.

nextCursorvalueRequired

Opaque cursor for the next page. Send it back as cursor; null means there are no more pages. Do not construct a cursor yourself.

Schema details

Any of

Option 1string
Option 2null
scopestringRequired

Whose usage this page reports. user contains only the OAuth or personal-key user's events, optionally narrowed by workspaceId; it omits other members. workspace contains every member's events for the workspace API key's bound workspace.

enum
["user","workspace"]

Additional properties are not allowed.

Response example 1

json
{
  "data": [
    {
      "id": "log_1",
      "createdAt": "2026-07-29T18:04:11.000Z",
      "source": "sim-chat",
      "workspaceId": "ws_1",
      "workflow": null,
      "runId": null,
      "creditCost": 12
    }
  ],
  "nextCursor": null,
  "scope": "workspace"
}

Response headers

X-RateLimit-Limitinteger

Maximum requests allowed in the current window.

minimum
0
maximum
9007199254740991
X-RateLimit-Remaininginteger

Requests remaining in the current window.

minimum
0
maximum
9007199254740991
X-RateLimit-Resetstring

ISO 8601 timestamp when the current rate-limit window resets.

format
date-time
pattern
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Was this helpful?
Suggest an edit