Microsoft Azure Aggregated Cost API

The AggregatedCost API from Microsoft Azure, for aggregatedcost.

GitHub OpenAPI
Business capability
IT Financial Management BC-600.80

Operations 2

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost Get current aggregated cost for a management group · Microsoft Azure Get Providers Microsoft Management Managementgroups… #
Ask an LLM
“What is the total Azure spend of a management group this billing period?”
“Does the aggregated cost include child management groups?”
Tell an agent
Get the current-period aggregated cost for management group {mg}.
Show aggregated cost for management group {mg} filtered by {filter}.
GET /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedcost Get aggregated cost for a management group by billing period · Microsoft Azure Get Providers Microsoft Management Managementgroups… #
Ask an LLM
“What did a management group cost in a specific past billing period?”
“Can I compare a management group's spend across billing periods?”
Tell an agent
Get aggregated cost for management group {mg} in billing period {period}.
Show management group {mg} total spend for billing period {period}.

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:microsoft-azure-aggregatedcost-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

microsoft-azure-aggregatedcost-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 2019-04-01-preview
  title: Microsoft Azure ConsumptionManagementClient Aggregated Cost…
  description: Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions.
servers:
- url: https://management.azure.com
security:
- azure_auth:
  - user_impersonation
tags:
- name: AggregatedCost
paths:
  /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost:
    get:
      tags:
      - AggregatedCost
      operationId: microsoftAzureAggregatedcostGetbymanagementgroup
      description: Provides the aggregate cost of a management group and all child management groups by current billing period.
      externalDocs:
        url: https://docs.microsoft.com/en-us/rest/api/consumption/
      x-ms-examples:
        AggregatedCostByManagementGroup:
          $ref: ./examples/AggregatedCostByManagementGroup.json
        AggregatedCostByManagementGroupFilterByDate:
          $ref: ./examples/AggregatedCostByManagementGroupFilterByDate.json
      parameters:
      - $ref: '#/components/parameters/managementGroupIdParameter'
      - $ref: '#/components/parameters/apiVersionParameter'
      - name: $filter
        description: May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:).
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: OK. The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagementGroupAggregatedCostResult'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Microsoft Azure Get Providers Microsoft Management Managementgroups…
  ? /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedcost
  : get:
      tags:
      - AggregatedCost
      operationId: microsoftAzureAggregatedcostGetforbillingperiodbymanagementgroup
      description: Provides the aggregate cost of a management group and all child management groups by specified billing period
      externalDocs:
        url: https://docs.microsoft.com/en-us/rest/api/consumption/
      x-ms-examples:
        AggregatedCostListForBillingPeriodByManagementGroup:
          $ref: ./examples/AggregatedCostForBillingPeriodByManagementGroup.json
      parameters:
      - $ref: '#/components/parameters/managementGroupIdParameter'
      - $ref: '#/components/parameters/billingPeriodNameParameter'
      - $ref: '#/components/parameters/apiVersionParameter'
      responses:
        '200':
          description: OK. The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagementGroupAggregatedCostResult'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Microsoft Azure Get Providers Microsoft Management Managementgroups…
components:
  schemas:
    Resource:
      description: The Resource model definition.
      properties:
        id:
          readOnly: true
          type: string
          description: Resource Id.
        name:
          readOnly: true
          type: string
          description: Resource name.
        type:
          readOnly: true
          type: string
          description: Resource type.
        tags:
          readOnly: true
          type: object
          additionalProperties:
            type: string
          description: Resource tags.
      x-ms-azure-resource: true
    ErrorResponse:
      description: Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
      type: object
      properties:
        error:
          description: The details of the error.
          $ref: '#/components/schemas/ErrorDetails'
    ErrorDetails:
      description: The details of the error.
      properties:
        code:
          description: Error code.
          type: string
          readOnly: true
        message:
          description: Error message indicating why the operation failed.
          type: string
          readOnly: true
    ManagementGroupAggregatedCostResult:
      description: A management group aggregated cost resource.
      type: object
      allOf:
      - $ref: '#/components/schemas/Resource'
      properties:
        properties:
          x-ms-client-flatten: true
          $ref: '#/components/schemas/ManagementGroupAggregatedCostProperties'
          title: Management Group Aggregated Cost properties
    ManagementGroupAggregatedCostProperties:
      description: The properties of the Management Group Aggregated Cost.
      type: object
      properties:
        billingPeriodId:
          description: The id of the billing period resource that the aggregated cost belongs to.
          type: string
          readOnly: true
        usageStart:
          description: The start of the date time range covered by aggregated cost.
          type: string
          format: date-time
          readOnly: true
        usageEnd:
          description: The end of the date time range covered by the aggregated cost.
          type: string
          format: date-time
          readOnly: true
        azureCharges:
          description: Azure Charges.
          type: number
          format: decimal
          readOnly: true
        marketplaceCharges:
          description: Marketplace Charges.
          type: number
          format: decimal
          readOnly: true
        chargesBilledSeparately:
          description: Charges Billed Separately.
          type: number
          format: decimal
          readOnly: true
        currency:
          description: The ISO currency in which the meter is charged, for example, USD.
          type: string
          readOnly: true
        children:
          description: Children of a management group
          type: array
          items:
            $ref: '#/components/schemas/ManagementGroupAggregatedCostResult'
        includedSubscriptions:
          description: List of subscription Guids included in the calculation of aggregated cost
          type: array
          items:
            type: string
        excludedSubscriptions:
          description: List of subscription Guids excluded from the calculation of aggregated cost
          type: array
          items:
            type: string
  parameters:
    managementGroupIdParameter:
      name: managementGroupId
      in: path
      description: Azure Management Group ID.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
    apiVersionParameter:
      name: api-version
      in: query
      required: true
      description: Version of the API to be used with the client request. The current version is 2019-04-01-preview.
      schema:
        type: string
    billingPeriodNameParameter:
      name: billingPeriodName
      in: path
      description: Billing Period Name.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
  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.
x-provenance:
  method: harvested
  publisher: Microsoft Azure
  source: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/consumption/resource-manager/Microsoft.Consumption/stable/2019-01-01/consumption.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)