Get cost details for a pay-as-you-go subscription

If your subscription is through Microsoft Online Service Program (MOSP) pay-as-you-go, or Visual Studio, we suggest using Exports or the Exports API to access detailed cost data, previously referred to as usage details. The Cost Details API report isn't supported for your subscription type yet.

If you need to download small datasets and you don't want to use Azure Storage, you can also use the Consumption Usage Details API. To use the API, read the following instructions.


The API is deprecated for all customers except those with pay-as-you-go and Visual Studio subscriptions. If you're an EA or MCA customer don't use this API.

The exact date for discontinuing the API is undetermined. Before the Consumption Usage Details API is deprecated, the Cost Details API will get updates to support both pay-as-you-go and Visual Studio subscriptions.

Example Consumption Usage Details API requests

The following example requests are used by Microsoft customers to address common scenarios.

Get usage details for a scope during a specific date range

The data that gets returned by the request corresponds to the date when the data got received by the billing system. It might include costs from multiple invoices. The call to use varies by your subscription type.

For pay-as-you-go subscriptions, use the following call.


Get amortized cost details

If you need actual costs to show purchases as they're accrued, change the metric to ActualCost in the following request. To use amortized and actual costs, you must use version 2019-04-01-preview or later.