Skip to content
中文

Export charges

GET/organization/v1/charges● 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)

Returns

200

Errors follow the problem+json format — see error codes

Request

curl
curl "https://api.deepraxis.com/organization/v1/charges?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z" \
  -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 认证);响应是 JSONL,一行一条 FOCUS 记录
resp = requests.get(
    f"{opts['base_url']}/charges?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.headers["Content-Type"])
for line in resp.text.splitlines():
    print(line)
TypeScript
const opts = {
  baseURL: "https://api.deepraxis.com/organization/v1",
  apiKey: "$PRAXIS_API_KEY",
};

// /organization 是我们自己的组织用量形状,直接发 HTTP 请求(Bearer 认证);响应是 JSONL,一行一条 FOCUS 记录
const resp = await fetch(`${opts.baseURL}/charges?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z`, {
  headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, resp.headers.get("Content-Type"));
const text = await resp.text();
for (const line of text.split("\n").filter(Boolean)) console.log(line);

Response 200

{
  "ChargePeriodStart": "2026-10-15T03:13:02.720Z",
  "ChargePeriodEnd": "2026-10-15T03:13:02.720Z",
  "BilledCost": "0.000044",
  "BillingCurrency": "USD",
  "ServiceName": "router",
  "ServiceCategory": "AI and Machine Learning",
  "ResourceId": "deepseek-v4-flash",
  "ResourceName": "deepseek-v4-flash",
  "ConsumedQuantity": "1",
  "ConsumedUnit": "request",
  "ChargeCategory": "Usage",
  "ChargeClass": null,
  "ChargeDescription": "router.llm usage",
  "x_RequestId": "402f591a737acd50ba1e3178848a1d57",
  "x_EventId": "use_1f67393b05b74558b7f8"
}

Response

HTTP 200

FOCUS 1.3 JSONL stream

application/x-ndjson

Name Type Description
ChargePeriodStart string Start of the charge period (the event time), UTC.
ChargePeriodEnd string End of the charge period (the event time), UTC.
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.
BillingCurrency string Currency of BilledCost; always USD.
ServiceName string Name of the platform service that produced the usage (the source service of the usage event).
ServiceCategory string Category of the service; a service without a registered category reports its own name.
ResourceId string Id of the resource that the usage belongs to.
ResourceName string Display name of the resource; falls back to ResourceId when no name is known.
ConsumedQuantity string Quantity consumed, an exact decimal string in ConsumedUnit.
ConsumedUnit string Unit of ConsumedQuantity as reported by the metering line; quantities of different units are never added together.
ChargeCategory string Kind of charge.
ChargeClass string | null Correction for an event that corrects an earlier charge (its BilledCost is negative); null for ordinary usage.
ChargeDescription string Text such as <service>/<offering> usage that says what was charged.
x_RequestId string | null Always null in the export; look up the request id of an event with getOrganizationEvent.
x_EventId string Id of the usage event this record comes from; pass it to getOrganizationEvent.

Response fields

FieldDescription
ChargePeriodStart / ChargePeriodEndCharge period start and end (UTC)
BilledCost / BillingCurrencyThe event’s cost (decimal string) and the currency charged (CNY or USD)
ServiceName / ServiceCategory / ResourceId / ResourceNameFOCUS service and resource columns
ConsumedQuantity / ConsumedUnitConsumed quantity and unit
ChargeCategoryUsage or Adjustment
ChargeClass“Correction” for corrections, null otherwise
ChargeDescriptionA human-readable description of the meter
x_RequestId / x_EventIdThe X-Request-Id of the call behind this record; the matching usage event id

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