Microsoft Azure Usage Aggregates API

The UsageAggregates API from Microsoft Azure, for usageaggregates.

GitHub OpenAPI

Operations 1

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 /subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates Get aggregated subscription usage for a date range · Microsoft Azure Get Subscriptions Subscriptionid Providers Microsoft Commerce… #
Ask an LLM
“How much Azure did my subscription consume between two dates?”
“Can I get usage broken down hourly instead of daily?”
Tell an agent
Get usage aggregates for subscription {subscription} from {start} to {end}.
Pull hourly usage for {subscription} between {start} and {end} with granularity {granularity}.

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-usageaggregates-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-usageaggregates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Microsoft Azure UsageManagementClient Usage Aggregates API
  version: 2015-06-01-preview
servers:
- url: https://management.azure.com
tags:
- name: UsageAggregates
paths:
  /subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates:
    get:
      tags:
      - UsageAggregates
      operationId: microsoftAzureUsageaggregatesList
      description: Query aggregated Azure subscription consumption data for a date range.
      externalDocs:
        url: https://docs.microsoft.com/rest/api/commerce/usageaggregates
      x-ms-examples:
        GetUsageAggregatesList:
          $ref: ./examples/GetUsageAggregatesList.json
      parameters:
      - name: reportedStartTime
        in: query
        required: true
        description: The start of the time range to retrieve data for.
        schema:
          type: string
          format: date-time
      - name: reportedEndTime
        in: query
        required: true
        description: The end of the time range to retrieve data for.
        schema:
          type: string
          format: date-time
      - name: showDetails
        in: query
        required: false
        description: '`True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime).'
        schema:
          type: boolean
      - name: aggregationGranularity
        in: query
        required: false
        description: '`Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity.'
        x-ms-enum:
          name: AggregationGranularity
          modelAsString: false
        schema:
          type: string
          enum:
          - Daily
          - Hourly
          default: Daily
      - name: continuationToken
        in: query
        required: false
        description: 'Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in. '
        schema:
          type: string
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      responses:
        '200':
          description: Normal response for a successful query. The response body will contain the data that matches the filters specified in the query parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageAggregationListResult'
            text/json:
              schema:
                $ref: '#/components/schemas/UsageAggregationListResult'
        '202':
          description: Response indicating that a request has been accepted for processing. However, the processing has not been completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObjectResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ErrorObjectResponse'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorObjectResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ErrorObjectResponse'
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Microsoft Azure Get Subscriptions Subscriptionid Providers Microsoft Commerce…
components:
  parameters:
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      required: true
      description: It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
      schema:
        type: string
    ApiVersionParameter:
      name: api-version
      in: query
      required: true
      description: Client Api Version.
      schema:
        type: string
  schemas:
    UsageAggregation:
      properties:
        id:
          type: string
          description: Unique Id for the usage aggregate.
        name:
          type: string
          description: Name of the usage aggregate.
        type:
          type: string
          description: Type of the resource being returned.
        properties:
          $ref: '#/components/schemas/UsageSample'
          x-ms-client-flatten: true
          description: Usage data.
      description: Describes the usageAggregation.
    UsageAggregationListResult:
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/UsageAggregation'
          description: Gets or sets details for the requested aggregation.
        nextLink:
          type: string
          description: Gets or sets the link to the next set of results.
      description: The Get UsageAggregates operation response.
    ErrorResponse:
      description: Describes the format of Error response.
      type: object
      properties:
        code:
          description: Error code
          type: string
        message:
          description: Error message indicating why the operation failed.
          type: string
    UsageSample:
      properties:
        subscriptionId:
          type: string
          format: uuid
          description: The subscription identifier for the Azure user.
        meterId:
          type: string
          description: Unique ID for the resource that was consumed (aka ResourceID).
        usageStartTime:
          type: string
          format: date-time
          description: UTC start time for the usage bucket to which this usage aggregate belongs.
        usageEndTime:
          type: string
          format: date-time
          description: UTC end time for the usage bucket to which this usage aggregate belongs.
        quantity:
          type: number
          format: float
          description: The amount of the resource consumption that occurred in this time frame.
        unit:
          type: string
          description: The unit in which the usage for this resource is being counted, e.g. Hours, GB.
        meterName:
          type: string
          description: Friendly name of the resource being consumed.
        meterCategory:
          type: string
          description: Category of the consumed resource.
        meterSubCategory:
          type: string
          description: Sub-category of the consumed resource.
        meterRegion:
          type: string
          description: Region of the meterId used for billing purposes
        infoFields:
          $ref: '#/components/schemas/InfoField'
          description: Key-value pairs of instance details (legacy format).
        instanceData:
          type: string
          description: Key-value pairs of instance details represented as a string.
      description: Describes a sample of the usageAggregation.
    InfoField:
      description: Key-value pairs of instance details in the legacy format.
    ErrorObjectResponse:
      description: Describes the format of Error response with a wrapper object
      type: object
      properties:
        error:
          description: Wrapper object for error information
          $ref: '#/components/schemas/ErrorResponse'
x-provenance:
  method: harvested
  publisher: Microsoft Azure
  source: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/commerce/resource-manager/Microsoft.Commerce/preview/2015-06-01-preview/commerce.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)