billing.costs.exportCSV of every (period, resource, usage type) row
Columns: period_start, service, service_name, usage_type, usage_type_name, resource_type, resource_id, resource_name, region, zone, projects, created_by, tags, quantity, unit, amount_eur (8 places, unrounded — sums reproduce the explorer exactly), runs_on. format=excel-de writes the same columns for a German Excel: semicolons, decimal commas, names in words, dates as DD.MM.YYYY, euros to the cent, UTF-8 with a BOM, CRLF.
Request syntax
POST /billing/api/cost-explorer/export
{
"start": "string",
"end": "string",
"granularity": "enum",
"groupBy": "object",
"filters": "array of json",
"maxGroups": "number"
}Query parameters
formatOptionalenum
machine (default: commas, decimal points, column ids, 8 decimal places) or excel-de (semicolons, decimal commas, column names in words, euros to the cent, DD.MM.YYYY, UTF-8 with a BOM)
One of:
machine,excel-de
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; not before start, and the window is at most 400 days
Constraints: /^\d{4}-\d{2}-\d{2}$/
granularityOptionalenum
Width of each bar: hour (windows of at most 14 days), day (default) or month
One of:
hour,day,monthDefault:
"day"groupByOptionalobject
What the bars are stacked by: {dimension, tagKey}; default {dimension: service}
Constraints: JSON
Default:
{"dimension":"service"}filtersOptionalarray of json
Narrow to rows matching every filter, at most 20: {dimension, values, tagKey, exclude}; default none
Default:
[]maxGroupsOptionalnumber
Groups drawn on their own, 1–50 (default 8); the rest are summed into "Other"
Constraints: integer, 1-50
Default:
8
Response
200 with the CSV file (text/csv, UTF-8) as an attachment named costs-<start>-<end>.csv (costs-<start>-<end>-excel.csv for excel-de), one row per period of the chosen granularity. 403 when grouping or filtering by provider without iam:UpdateOrganization.
The response is the raw content with its own content type, not 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 export --start example --end examplecurl -X POST "https://console.platform.deutschecloud.app/billing/api/cost-explorer/export" \
-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_export.