Azure Cost Management Generate Cost Details Report API

Poll the asynchronous cost details report operation and retrieve the download link for the generated file.

Operations 1

GET /{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId} #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure-cost-management-generatecostdetailsreport-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-cost-management-generatecostdetailsreport-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: CostManagementClient Generate Cost Details Report API
  version: '2026-06-01'
  description: CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions.
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
  x-api-evangelist-common-types: Azure Resource Manager common-types v5 components referenced by this contract were inlined
    from https://github.com/Azure/azure-rest-api-specs/tree/main/specification/common-types/resource-management/v5 and prefixed
    Arm, so the document resolves standalone. Microsoft's published document $refs them by relative path across repository
    directories.
servers:
- url: https://management.azure.com
security:
- azure_auth:
  - user_impersonation
tags:
- name: GenerateCostDetailsReport
paths:
  /{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}:
    get:
      operationId: GenerateCostDetailsReport_GetOperationResults
      tags:
      - GenerateCostDetailsReport
      description: Get the result of the specified operation. This link is provided in the CostDetails creation request response
        Location header.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - name: scope
        in: path
        description: The ARM Resource ID for subscription, billing account, or other billing scopes.Currently Resource Group
          and Management Group are not supported. For details, see https://aka.ms/costmgmt/scopes.
        required: true
        x-ms-skip-url-encoding: true
        schema:
          type: string
      - name: operationId
        in: path
        description: The target operation Id.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostDetailsOperationResults'
        '202':
          description: Resource operation accepted.
          headers:
            Retry-After:
              description: The Retry-After header can indicate how long the client should wait before polling the operation
                status.
              schema:
                type: integer
                format: int32
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-ms-examples:
        Get details of the operation result:
          $ref: ../examples/CostDetailsOperationResultsBySubscriptionScope.json
      x-ms-long-running-operation: true
components:
  schemas:
    BlobInfo:
      type: object
      description: The blob information generated by this operation.
      properties:
        blobLink:
          type: string
          description: Link to the blob to download file.
        byteCount:
          type: integer
          format: int64
          description: Bytes in the blob.
    CostDetailsDataFormat:
      type: string
      description: The data format of the report
      enum:
      - Csv
      x-ms-enum:
        name: CostDetailsDataFormat
        modelAsString: true
        values:
        - name: CsvCostDetailsDataFormat
          value: Csv
          description: Csv data format.
    CostDetailsMetricType:
      type: string
      description: The type of the detailed report. By default ActualCost is provided
      enum:
      - ActualCost
      - AmortizedCost
      x-ms-enum:
        name: CostDetailsMetricType
        modelAsString: true
        values:
        - name: ActualCostCostDetailsMetricType
          value: ActualCost
          description: Actual cost data.
        - name: AmortizedCostCostDetailsMetricType
          value: AmortizedCost
          description: Amortized cost data.
    CostDetailsOperationResults:
      type: object
      description: The result of the long running operation for cost details Api.
      properties:
        id:
          type: string
          description: The id of the long running operation.
        name:
          type: string
          description: The name of the long running operation.
        type:
          type: string
          description: The type of the long running operation.
        status:
          $ref: '#/components/schemas/CostDetailsStatusType'
          description: The status of the cost details operation
        manifest:
          $ref: '#/components/schemas/ReportManifest'
          description: The manifest of the report generated by the operation.
          x-ms-client-flatten: true
        validTill:
          type: string
          format: date-time
          description: The time at which report URL becomes invalid/expires in UTC e.g. 2020-12-08T05:55:59.4394737Z.
        error:
          $ref: '#/components/schemas/ErrorDetails'
          description: The details of the error.
    CostDetailsStatusType:
      type: string
      description: The status of the cost details operation
      enum:
      - Completed
      - NoDataFound
      - Failed
      x-ms-enum:
        name: CostDetailsStatusType
        modelAsString: true
        values:
        - name: CompletedCostDetailsStatusType
          value: Completed
          description: Operation is Completed.
        - name: NoDataFoundCostDetailsStatusType
          value: NoDataFound
          description: Operation is Completed and no cost data found.
        - name: FailedCostDetailsStatusType
          value: Failed
          description: Operation Failed.
    CostDetailsTimePeriod:
      type: object
      description: The start and end date for pulling data for the cost detailed report. API only allows data to be pulled
        for 1 month or less and no older than 13 months.
      properties:
        start:
          type: string
          description: The start date to pull data from. example format 2020-03-15
        end:
          type: string
          description: The end date to pull data to. example format 2020-03-15
      required:
      - start
      - end
    ErrorDetails:
      type: object
      description: The details of the error.
      properties:
        code:
          type: string
          description: Error code.
          readOnly: true
        message:
          type: string
          description: Error message indicating why the operation failed.
          readOnly: true
    ErrorResponse:
      type: object
      description: 'Error response indicates that the service is not able to process the incoming request. The reason is provided
        in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting
        for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable
        - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.'
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetails'
          description: The details of the error.
    GenerateCostDetailsReportRequestDefinition:
      type: object
      description: The definition of a cost detailed report.
      properties:
        metric:
          $ref: '#/components/schemas/CostDetailsMetricType'
          description: The type of the detailed report. By default ActualCost is provided
        timePeriod:
          $ref: '#/components/schemas/CostDetailsTimePeriod'
          description: The specific date range of cost details requested for the report. This parameter cannot be used alongside
            either the invoiceId or billingPeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not
            provided in the request body the API will return the current month's cost. API only allows data to be pulled for
            1 month or less and no older than 13 months. If no timePeriod or billingPeriod or invoiceId is provided the API
            defaults to the open month time period
        billingPeriod:
          type: string
          description: This parameter can be used only by Enterprise Agreement customers. Use the YearMonth(e.g. 202008) format.
            This parameter cannot be used alongside either the invoiceId or timePeriod parameters. If a timePeriod, invoiceId
            or billingPeriod parameter is not provided in the request body the API will return the current month's cost.
        invoiceId:
          type: string
          description: This parameter can only be used by Microsoft Customer Agreement customers. Additionally, it can only
            be used at the Billing Profile or Customer scope. This parameter cannot be used alongside either the billingPeriod
            or timePeriod parameters. If a timePeriod, invoiceId or billingPeriod parameter is not provided in the request
            body the API will return the current month's cost.
    ReportManifest:
      type: object
      description: The manifest of the report generated by the operation.
      properties:
        manifestVersion:
          type: string
          description: The Manifest version.
        dataFormat:
          $ref: '#/components/schemas/CostDetailsDataFormat'
          description: The data format of the report
        byteCount:
          type: integer
          format: int64
          description: The total number of bytes in all blobs.
        blobCount:
          type: integer
          format: int32
          description: The total number of blobs.
        compressData:
          type: boolean
          description: Is the data in compressed format.
        requestContext:
          $ref: '#/components/schemas/RequestContext'
          description: The context of the Cost Details request.
          x-ms-client-flatten: true
        blobs:
          type: array
          description: List of blob information generated by this operation.
          items:
            $ref: '#/components/schemas/BlobInfo'
          x-ms-identifiers:
          - blobLink
    RequestContext:
      type: object
      description: The context of the Cost Details request.
      properties:
        requestScope:
          type: string
          description: The request scope of the request.
        requestBody:
          $ref: '#/components/schemas/GenerateCostDetailsReportRequestDefinition'
          description: The request payload body provided in Cost Details call
  securitySchemes:
    azure_auth:
      type: oauth2
      flows:
        implicit:
          scopes:
            user_impersonation: impersonate your user account
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
      description: Azure Active Directory OAuth2 Flow.
  parameters:
    ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      schema:
        type: string
        minLength: 1