Skip to content
中文

List costs

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

  • bucket_widthstringrequired

    query: Bucket width: 1h (aligned to the hour) or 1d (aligned to the UTC day)

    values 1h1d
  • time_zonestringoptional
    default "UTC"

    query: IANA time zone name (for example Asia/Shanghai) whose local hours or days form the buckets. Defaults to UTC. Offsets such as +08:00 are rejected. Only zones whose UTC offset is a whole number of hours across the whole window are supported; zones such as Asia/Kolkata (+05:30) or Asia/Kathmandu (+05:45) are rejected with 400 VALIDATION_ERROR, because Billing buckets in UTC hours and a local hour of those zones straddles two of them. With bucket_width=1d the window widens to whole local days, each bucket carries its real UTC starting_at and ending_at, and a day that crosses a daylight-saving change lasts 23 or 25 hours; the whole window is then answered in one page (has_more is false and page is not accepted). starting_at and ending_at stay UTC instants.

  • group_byarrayoptional

    query: Columns to group by (repeatable): ServiceName, ServiceCategory, ResourceId, ConsumedUnit; usage always splits ConsumedUnit out server-side

  • 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/costs?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z&bucket_width=1d&group_by=ServiceName" \
  -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']}/costs?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z&bucket_width=1d&group_by=ServiceName",
    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}/costs?starting_at=2026-09-26T00:00:00Z&ending_at=2026-09-27T00:00:00Z&bucket_width=1d&group_by=ServiceName`, {
  headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, await resp.json());

Response 200

{
  "object": "page",
  "data": [
    {
      "object": "bucket",
      "starting_at": "2026-10-15T00:00:00.000Z",
      "ending_at": "2026-10-16T00:00:00.000Z",
      "estimated": false,
      "results": [
        {
          "ServiceName": "router",
          "BilledCost": "0.000044",
          "BillingCurrency": "USD",
          "x_EventCount": "1"
        }
      ]
    }
  ],
  "has_more": false,
  "next_page": null
}

Response

HTTP 200

Cost page

application/json

Name Type Description
object string Object type; always page.
data array<object> Cost buckets in time order, one per hour or day of the requested window.
data[].object string Object type; always bucket.
data[].starting_at string Start of the bucket, UTC, inclusive.
data[].ending_at string End of the bucket, UTC, exclusive.
data[].estimated boolean Always false; kept for the AWS GetCostAndUsage shape.
data[].results array<object> Aggregates of the bucket, one entry per group requested with group_by.
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 “bucket”
data[].starting_at / data[].ending_atBucket start and end (UTC, aligned to the hour or the day)
data[].estimatedAlways false: a charge is final when it is recorded; kept to match the AWS GetCostAndUsage shape
data[].results[].ServiceNameServing service name (present only when group_by requests ServiceName)
data[].results[].ServiceCategoryFOCUS service category (present only when requested)
data[].results[].ResourceId / data[].results[].ResourceNameResource id and display name; ResourceName rides ResourceId and falls back to the id when unresolvable
data[].results[].BilledCostThe group’s cost in the bucket, a decimal string in BillingCurrency
data[].results[].BillingCurrencyThe currency charged, CNY or USD; a group charged in both currencies in one bucket is two rows
has_more / next_pageWhether more pages follow; the next page’s opaque cursor (null when done)

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