billing.costs.linesThe usage lines behind a bar, a group or a resource
One line per (resource, usage type, unit price): quantity, unit, rate, amount, first and last metered. Pass `bucket` (the ISO start of a bar) with its `granularity` to see one bar.
Request syntax
POST /billing/api/cost-explorer/lines
{
"start": "string",
"end": "string",
"filters": "array of json",
"bucket": "string",
"granularity": "enum",
"limit": "number"
}Request body
startRequiredstring
First day of the window, YYYY-MM-DD, UTC, inclusive
Constraints: /^\d{4}-\d{2}-\d{2}$/
endRequiredstring
Last day of the window, YYYY-MM-DD, UTC, inclusive
Constraints: /^\d{4}-\d{2}-\d{2}$/
filtersOptionalarray of json
Narrow to rows matching every filter, at most 20, as in cost-explorer/query; default none
Default:
[]bucketOptionalstring
Only the bar starting at this ISO 8601 instant (a `series` point’s start), one granularity wide; default the whole window
Constraints: datetime
granularityOptionalenum
How wide `bucket` is: hour, day (default) or month; ignored without bucket
One of:
hour,day,monthDefault:
"day"limitOptionalnumber
At most this many lines, 1–2000 (default 200), largest amount first; `truncated` says when more exist
Constraints: integer, 1-2000
Default:
200
Response
200 with { from, to, total, capSaving, notCharged, lines, truncated }: total covers every matching line (not only those returned); each line has resourceLabel, resourceType, resourceId, service, usageType, skuCode, region, zone, unit, unitPrice, quantity, amount, capSaving, notCharged, monthlyCap, records, firstAt, lastAt, tags, projects, creator. 403 when filtering by provider without iam:UpdateOrganization.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow billing:GetCostAndUsage on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud billing costs lines --start example --end examplecurl -X POST "https://console.platform.deutschecloud.app/billing/api/cost-explorer/lines" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"start":"example","end":"example"}'Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_billing_costs_lines.