Skip to content

Get Cumulative Billing Item Consumption



GET /api/v1/billing/project/summary

Overview

Reads the cumulative consumption summary of billing items in the Billing Center of the current workspace.

Prerequisites and Usage Steps

Use the API Key of the target workspace. You can only read data from the Billing Center site that corresponds to the workspace the key belongs to; you cannot switch sites with extra workspaceUUID/brandKey/site parameters. This endpoint does not charge fees, top up, settle, or modify plans. Billing Center data may have generation or settlement delays, so an empty result does not mean no consumption occurred; verify against the actual billing period and the Billing Center. Amounts, currencies, precision, and statistical scope follow the Billing Center of that workspace. Studio does not perform conversion or add currency fields, and the illustrative values must not be treated as prices.

Either the billing.billingRead or the billing.workspaceUpgrade permission is required. This entry point has no date, pagination, or billing item filter parameters; the statistical period is determined by the Billing Center summary API and must not be treated as a summary for a specified date range or a fixed monthly summary. The billing item names in content are upstream dynamic keys, and the example shows only two items; do not hardcode the complete item set or use names to determine whether a plan is activated. A non-empty dictionary also contains the workspace declaration, and this metadata key must be excluded when totaling amounts.

Request Headers

Parameter Name Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or fill it in: obtain an OpenAPI Key with this operation permission from the API Key management of the target workspace.

Request Example

curl --get 'https://openapi.guance.com/api/v1/billing/project/summary' \
  -H 'DF-API-KEY: <DF-API-KEY>'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content object The cumulative summary from the Billing Center is returned as-is; when content is not returned, the SDK falls back to {}, which is not a fixed billing item list.
content.<Billing Item Name> JSON Upstream dynamic items and amounts; the example uses number. The upstream determines the key names and values, and Studio does not fix the complete set of categories, the period, or the unit.
content.declaration object or null The workspace common declaration attached to a non-empty content; it can be null or an empty object when not configured. This field is not added to an empty content object.
{
  "code": 200,
  "content": {
    "Cumulative Consumption": 17211.88,
    "Session Replay": 806.8,
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Response

For authentication, rate limiting, and common request errors, see Common Error Definitions.

The Billing Center SDK first maps ft.CloudCareApiError and overrides it with the upstream HTTP/business code. Because this SDK does not set a passthrough flag, any final code greater than or equal to 500 is globally wrapped as HTTP 500, ft.InternalServerError, and generic text, so you cannot assume that 503 or the original 5xx message is preserved externally. When the final code is less than 500, CloudCareApiError and the actual message are preserved. Connection exceptions default to 400. Only the verified Studio mappings are listed here; the various business errors and proxy errors of the Billing Center are not exhaustively enumerated.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
404 ft.ObjectNotExists No workspace record corresponding to the current key is found The specified object does not exist Verify the target workspace and the validity status of the key.
406 ft.InvalidBossNode The Billing Center brand/node bound to the workspace is not configured or is unavailable Invalid Boss node Contact the administrator to check the workspace's Billing Center binding and site configuration; do not work around it by changing dates.
400 ft.CloudCareApiError The Billing Center request fails to connect (defaults to 400), or an upstream HTTP/business error whose mapped code is less than 500 Internal API call failed Keep the HTTP status, message, and traceId, and check the availability of the Billing Center and the specific error; the final 4xx may vary, and a code greater than or equal to 500 is globally wrapped as ft.InternalServerError.
500 ft.InternalServerError The Billing Center returns an unexpected type or a missing field, invalid JSON, or other storage and formatting errors Internal error Keep the traceId and contact the administrator to check the upstream response, then read and retry later.

Feedback

Is this page helpful?