Skip to content
中文

List usage events

GET/organization/v1/events● Supported

Official reference ↗

Request parameters

  • starting_atstringrequired

    query: Window start (inclusive), UTC ISO 8601, e.g. 2026-09-26T00:00:00Z

  • ending_atstringrequired

    query: Window end (exclusive), UTC ISO 8601; at most 93 days after starting_at (the charges export has no such cap)

  • limitintegeroptional

    query: Page size, 1–100, defaults to 25

  • pagestringoptional

    query: The opaque cursor from the previous page's next_page — pass it back unchanged

Returns

200 page

Errors follow the problem+json format — see error codes

Request

curl
curl "https://api.deepraxis.com/organization/v1/events?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z&limit=2" \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
import requests

opts = dict(
    base_url="https://api.deepraxis.com/organization/v1",
    api_key="$PRAXIS_API_KEY",
)

# /organization 是我们自己的组织用量形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.get(
    f"{opts['base_url']}/events?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z&limit=2",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())
TypeScript
const opts = {
  baseURL: "https://api.deepraxis.com/organization/v1",
  apiKey: "$PRAXIS_API_KEY",
};

// /organization 是我们自己的组织用量形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/events?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z&limit=2`, {
  headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, await resp.json());

Response 200

{
  "object": "page",
  "data": [
    {
      "object": "usage.event",
      "id": "use_1f67393b05b74558b7f8",
      "occurred_at": "2026-10-15T03:13:02.720Z",
      "ServiceName": "router",
      "ServiceCategory": "AI and Machine Learning",
      "ResourceId": "deepseek-v4-flash",
      "ResourceName": "deepseek-v4-flash",
      "BilledCost": "0.000044",
      "BillingCurrency": "USD",
      "ChargeClass": null,
      "request_id": "402f591a737acd50ba1e3178848a1d57",
      "settlement": {
        "status": "settled",
        "shortfall": null,
        "zero_reason": null
      },
      "lines": [
        {
          "meter": "router.llm",
          "display_name": "router.llm",
          "ConsumedQuantity": "1",
          "ConsumedUnit": "request"
        }
      ]
    }
  ],
  "has_more": false,
  "next_page": null
}

Response

HTTP 200

Event page

application/json

Name Type Description
object string Object type; always page.
data array<object> Usage events, newest first.
data[].object string Object type; always usage.event.
data[].id string Id of the usage event; pass it to getOrganizationEvent.
data[].occurred_at string Time at which the usage happened, UTC.
data[].ServiceName string Name of the platform service that produced the usage (the source service of the usage event).
data[].ServiceCategory string Category of the service; a service without a registered category reports its own name.
data[].ResourceId string Id of the resource that the usage belongs to.
data[].ResourceName string Display name of the resource; falls back to ResourceId when no name is known.
data[].BilledCost string Amount billed: US dollars for USD (otherwise BillingCurrency), decimal string, 6 decimals (for example 0.001700); unsettled usage counts as 0.000000 until it settles.
data[].BillingCurrency string Currency of BilledCost; always USD.
data[].ChargeClass string | null Correction for an event that corrects an earlier charge (its BilledCost is negative); null for ordinary usage.
data[].request_id string | null X-Request-Id of the API call that produced the usage; null for usage that does not come from a request.
data[].session_id string | null The session the usage belongs to (sesn_…, public form); null for a call no session made.
data[].agent_id string | null The agent that made the call (agent_…); null when the caller is not a session's agent.
data[].api_key_id string | null The API key the call was made with (key_…); null for session, run and binding callers.
data[].run_id string | null The automation run the usage belongs to (run_…); null when no automation run made the call.
data[].settlement object How the usage was charged: settlement state, any shortfall, and why nothing was charged.
data[].lines array<object> Metering lines mapped from the billing measurements; the priced split (ListUnitPrice, PricingUnit, BilledCost) rides only GET /events/{id}.
has_more boolean Whether more results exist beyond this page; request again with page set to next_page to read them.
next_page string | null Opaque cursor for the next page; null on the last page. Pass it unchanged as page.

Response fields

FieldDescription
objectalways “page”
data[].objectalways “usage.event”
data[].idThe event id — use it for the single-event lookup and reconciliation
data[].occurred_atWhen the usage happened (UTC)
data[].ServiceName / ServiceCategory / ResourceId / ResourceNameFOCUS service and resource columns
data[].BilledCost / BillingCurrencyThe event’s cost (decimal string) and the currency charged (CNY or USD)
data[].ChargeClass“Correction” for correction events (negative cost), null otherwise
data[].request_idThe X-Request-Id of the API call that produced this usage — look it up in your call logs
data[].settlement.statussettled (charged) / no_charge (recorded, nothing charged) / rejected (billing refused the charge)
data[].settlement.shortfall / data[].settlement.zero_reasonCurrently always null; reserved for later settlement detail
has_more / next_pageNewest first, one cursor page at a time; pages never duplicate or skip an event

For the transactions behind one event see Get a usage event.