From d758cab86cbdae26c7a16ed07270d3e007f3fb52 Mon Sep 17 00:00:00 2001 From: villyes Date: Wed, 27 May 2026 16:38:55 +0200 Subject: [PATCH 1/5] feat(bill): add finops api info MTA-7172 --- .../billing/api-cli/retrieve-finops-data.mdx | 69 +++++++++++++++++++ pages/billing/menu.ts | 4 ++ 2 files changed, 73 insertions(+) create mode 100644 pages/billing/api-cli/retrieve-finops-data.mdx diff --git a/pages/billing/api-cli/retrieve-finops-data.mdx b/pages/billing/api-cli/retrieve-finops-data.mdx new file mode 100644 index 0000000000..7cd6b04725 --- /dev/null +++ b/pages/billing/api-cli/retrieve-finops-data.mdx @@ -0,0 +1,69 @@ +--- +title: Retrieving your FinOps data via the Scaleway API +description: Retrieve your FinOps data in the form of "Charges" via the Scaleway API. +tags: finops charges billing consumption report api export +dates: + validation: 2026-05-29 + posted: 2026-05-29 +--- +import Requirements from '@macros/iam/requirements.mdx' + + +## Difference between FinOps API data and Consumption API data + +The Consumption API allows you to get the data used in your invoice, whereas the FinOps API enables you to ??? {/* Need a definition here. */} + +The FinOps API might show slight differences with the consumption/billing data if you try to reconcile both. This is due to the fact that FinOps data is calculated differently from consumption data. The differences in how the data is rounded and aggregated might result in small cost discrepancies when comparing both data sources. + +## Availability of `resource_name` + +The `resource_name` is only available if the related product had the transfer of this information enabled when creating the resource. +{/* Who enables this and where? */} + +## Pagination + +The API uses pagination to split a large set of results into smaller, manageable pages that can be retrieved one at a time. + +- The response includes a `next_page_token` whenever additional items are available. +- To retrieve the next page, pass that token in the subsequent request. + +## Clamping: retrieving partial charges for a selected period + +Clamping automatically cuts a charge that spans a longer period (e.g. the whole month) into the exact slice that falls inside the time window you asked for. + +When you set `"clampToTimeRange": true`, the API returns a partial charge that represents only the portion of the resource’s usage that overlaps with your requested dates. + +When you set `"clampToTimeRange": false`, the API only returns charges whose entire start‑ and end‑dates are inside the requested window. When a charge starts before the window (or ends after it), the result is empty. + +Follow the procedure below to download your FinOps data using the Scaleway [Billing API](https://www.scaleway.com/en/developers/api/billing/finops) and `curl`. + + + +- A Scaleway account and logged into the [console](https://console.scaleway.com/organization) +- Created an [API key](/iam/how-to/create-api-keys/) with sufficient [IAM permissions](/iam/reference-content/permission-sets/) to perform the actions described on this page +- [Installed `curl`](https://curl.se/download.html) +- Configured your environment variables + +## Export your environment variables + + +This is an optional step that aims at simplifying your usage of the API. + + +Open a terminal and run the following command to export your API secret key and Organization ID. Remember to replace the placeholders with your own corresponding values. + +```bash +export SCW_SECRET_KEY="" +export SCW_ORGANIZATION_ID="" +``` + +## Retrieve charges for a specific resource between two dates + +Run the following command to obtain detailed charges for a specific resource between two dates. Remember to replace the resource identifier and date placeholders with your own corresponding values. + +```bash +curl -X GET \ + -H "X-Auth-Token: $SCW_SECRET_KEY" \ + -H "Content-Type: application/json" \ + "https://api.scaleway.com/billing/v2beta1/charges?organization_id=$SCW_ORGANIZATION_ID&resourceIds=YourResourceId&startDateAfter=2026-05-26T00:00:00.000000000Z&endDateBefore=2026-05-30T00:00:00.000000000Z" +``` diff --git a/pages/billing/menu.ts b/pages/billing/menu.ts index be644fec17..aadd712d84 100644 --- a/pages/billing/menu.ts +++ b/pages/billing/menu.ts @@ -68,6 +68,10 @@ export const billingMenu = { label: 'Retrieve monthly consumption', slug: 'retrieve-monthly-consumption', }, + { + label: 'Retrieve FinOps data', + slug: 'retrieve-finops-data', + }, ], label: 'API/CLI', slug: 'api-cli', From c43a5c9800fe279b0dbd6fb1fc280bcc0289dabf Mon Sep 17 00:00:00 2001 From: villyes Date: Thu, 28 May 2026 14:04:49 +0200 Subject: [PATCH 2/5] feat(bill): add finops api info MTA-7172 --- pages/billing/api-cli/retrieve-finops-data.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pages/billing/api-cli/retrieve-finops-data.mdx b/pages/billing/api-cli/retrieve-finops-data.mdx index 7cd6b04725..24098c10a8 100644 --- a/pages/billing/api-cli/retrieve-finops-data.mdx +++ b/pages/billing/api-cli/retrieve-finops-data.mdx @@ -11,14 +11,13 @@ import Requirements from '@macros/iam/requirements.mdx' ## Difference between FinOps API data and Consumption API data -The Consumption API allows you to get the data used in your invoice, whereas the FinOps API enables you to ??? {/* Need a definition here. */} +The Consumption API allows you to get the data used in your invoice, whereas the FinOps API enables you to programmatically access raw billing data generated by the usage of Scaleway resources. The FinOps API might show slight differences with the consumption/billing data if you try to reconcile both. This is due to the fact that FinOps data is calculated differently from consumption data. The differences in how the data is rounded and aggregated might result in small cost discrepancies when comparing both data sources. ## Availability of `resource_name` -The `resource_name` is only available if the related product had the transfer of this information enabled when creating the resource. -{/* Who enables this and where? */} +The `resource_name` is only available if the related product had the transfer of this information enabled in the backend when creating the resource. ## Pagination From cdd3b86710306f7e957bfa0487bf408acd4f5b98 Mon Sep 17 00:00:00 2001 From: villyes Date: Thu, 28 May 2026 14:08:31 +0200 Subject: [PATCH 3/5] feat(bill): add finops api info MTA-7172 --- pages/billing/api-cli/retrieve-finops-data.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/billing/api-cli/retrieve-finops-data.mdx b/pages/billing/api-cli/retrieve-finops-data.mdx index 24098c10a8..9b66f334cd 100644 --- a/pages/billing/api-cli/retrieve-finops-data.mdx +++ b/pages/billing/api-cli/retrieve-finops-data.mdx @@ -11,7 +11,7 @@ import Requirements from '@macros/iam/requirements.mdx' ## Difference between FinOps API data and Consumption API data -The Consumption API allows you to get the data used in your invoice, whereas the FinOps API enables you to programmatically access raw billing data generated by the usage of Scaleway resources. +The Consumption API allows you to get the data used in your invoice, whereas the FinOps API enables you to retrieve raw consumption data generated by the usage of Scaleway resources. The FinOps API might show slight differences with the consumption/billing data if you try to reconcile both. This is due to the fact that FinOps data is calculated differently from consumption data. The differences in how the data is rounded and aggregated might result in small cost discrepancies when comparing both data sources. From 42a9fcd4b14ec4bd03780c783214e33c8ce36997 Mon Sep 17 00:00:00 2001 From: villyes Date: Thu, 28 May 2026 14:10:16 +0200 Subject: [PATCH 4/5] feat(bill): add finops api info MTA-7172 --- pages/billing/api-cli/retrieve-finops-data.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/billing/api-cli/retrieve-finops-data.mdx b/pages/billing/api-cli/retrieve-finops-data.mdx index 9b66f334cd..24aae535ea 100644 --- a/pages/billing/api-cli/retrieve-finops-data.mdx +++ b/pages/billing/api-cli/retrieve-finops-data.mdx @@ -34,7 +34,7 @@ When you set `"clampToTimeRange": true`, the API returns a partial charge that r When you set `"clampToTimeRange": false`, the API only returns charges whose entire start‑ and end‑dates are inside the requested window. When a charge starts before the window (or ends after it), the result is empty. -Follow the procedure below to download your FinOps data using the Scaleway [Billing API](https://www.scaleway.com/en/developers/api/billing/finops) and `curl`. +Follow the procedure below to download your FinOps data using the Scaleway [Billing - FinOps API](https://www.scaleway.com/en/developers/api/billing/finops) and `curl`. From 288903a2a856389ccb3f8ff8f30121e7e4306673 Mon Sep 17 00:00:00 2001 From: villyes Date: Thu, 28 May 2026 14:40:24 +0200 Subject: [PATCH 5/5] feat(bill): add finops api info MTA-7172 --- pages/billing/api-cli/retrieve-finops-data.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/billing/api-cli/retrieve-finops-data.mdx b/pages/billing/api-cli/retrieve-finops-data.mdx index 24aae535ea..147a8646d1 100644 --- a/pages/billing/api-cli/retrieve-finops-data.mdx +++ b/pages/billing/api-cli/retrieve-finops-data.mdx @@ -38,7 +38,7 @@ Follow the procedure below to download your FinOps data using the Scaleway [Bill -- A Scaleway account and logged into the [console](https://console.scaleway.com/organization) +- A Scaleway account logged into the [console](https://console.scaleway.com/organization) - Created an [API key](/iam/how-to/create-api-keys/) with sufficient [IAM permissions](/iam/reference-content/permission-sets/) to perform the actions described on this page - [Installed `curl`](https://curl.se/download.html) - Configured your environment variables