Azure DevTest Labs Costs API

The Costs API from Azure DevTest Labs — 1 operation(s) for costs.

GitHub OpenAPI
Business capability
IT Financial Management BC-600.80

Operations 2

GET /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name} Costs get #
PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name} Costs create or update #

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/azure-test-labs:azure-test-labs-costs-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. See our Privacy Policy and Terms.

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

OpenAPI Specification

azure-test-labs-costs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: DevTestLabsClient Costs API
  version: '2018-09-15'
  description: The DevTest Labs Client.
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
servers:
- url: https://management.azure.com
security:
- azure_auth:
  - user_impersonation
tags:
- name: Costs
paths:
  ? /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/costs/{name}
  : get:
      operationId: Costs_Get
      tags:
      - Costs
      description: Get cost.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: labName
        in: path
        description: The name of the lab.
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the cost.
        required: true
        schema:
          type: string
      - name: $expand
        in: query
        description: 'Specify the $expand query. Example: ''properties($expand=labCostDetails)'''
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Azure operation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabCost'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Costs get
      x-summary-source: derived
    put:
      operationId: Costs_CreateOrUpdate
      tags:
      - Costs
      description: Create or replace an existing cost.
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ResourceGroupNameParameter'
      - name: labName
        in: path
        description: The name of the lab.
        required: true
        schema:
          type: string
      - name: name
        in: path
        description: The name of the cost.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Resource 'LabCost' update operation succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabCost'
        '201':
          description: Resource 'LabCost' create operation succeeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabCost'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LabCost'
        description: A cost item.
        required: true
      summary: Costs create or update
      x-summary-source: derived
components:
  parameters:
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      description: The ID of the target subscription.
      required: true
      schema:
        type: string
        minLength: 1
    ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      schema:
        type: string
        minLength: 1
    ResourceGroupNameParameter:
      name: resourceGroupName
      in: path
      description: The name of the resource group. The name is case insensitive.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
        maxLength: 90
        minLength: 1
  schemas:
    Resource:
      type: object
      title: Resource
      description: Common fields that are returned in the response for all Azure Resource Manager resources
      properties:
        id:
          type: string
          description: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
          readOnly: true
        name:
          type: string
          description: The name of the resource
          readOnly: true
        type:
          type: string
          description: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
          readOnly: true
        systemData:
          $ref: '#/components/schemas/systemData'
          type: object
          description: Azure Resource Manager metadata containing createdBy and modifiedBy information.
          readOnly: true
      x-ms-azure-resource: true
    ReportingCycleType:
      type: string
      description: Reporting cycle type.
      enum:
      - CalendarMonth
      - Custom
      x-ms-enum:
        name: ReportingCycleType
        modelAsString: true
        values:
        - name: CalendarMonth
          value: CalendarMonth
        - name: Custom
          value: Custom
    LabCostDetailsProperties:
      type: object
      description: The properties of a lab cost item.
      properties:
        date:
          type: string
          format: date-time
          description: The date of the cost item.
        cost:
          type: number
          format: double
          description: The cost component of the cost item.
        costType:
          $ref: '#/components/schemas/CostType'
          description: The type of the cost.
    CostThresholdProperties:
      type: object
      description: Properties of a cost threshold item.
      properties:
        thresholdId:
          type: string
          description: The ID of the cost threshold item.
        percentageThreshold:
          $ref: '#/components/schemas/PercentageCostThresholdProperties'
          description: The value of the percentage cost threshold.
        displayOnChart:
          $ref: '#/components/schemas/CostThresholdStatus'
          description: Indicates whether this threshold will be displayed on cost charts.
        sendNotificationWhenExceeded:
          $ref: '#/components/schemas/CostThresholdStatus'
          description: Indicates whether notifications will be sent when this threshold is exceeded.
        notificationSent:
          type: string
          description: Indicates the datetime when notifications were last sent for this threshold.
    ProxyResource:
      type: object
      title: Proxy Resource
      description: The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location
      allOf:
      - $ref: '#/components/schemas/Resource'
    LabCost:
      type: object
      description: A cost item.
      properties:
        properties:
          $ref: '#/components/schemas/LabCostProperties'
          description: The properties of the resource.
          x-ms-client-flatten: true
        tags:
          type: object
          description: Resource tags.
          additionalProperties:
            type: string
        location:
          type: string
          description: The geo-location where the resource lives
          x-ms-mutability:
          - read
          - create
      required:
      - properties
      allOf:
      - $ref: '#/components/schemas/ProxyResource'
    ErrorResponse:
      type: object
      title: Error response
      description: Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: The error object.
    PercentageCostThresholdProperties:
      type: object
      description: Properties of a percentage cost threshold.
      properties:
        thresholdValue:
          type: number
          format: double
          description: The cost threshold value.
    LabResourceCostProperties:
      type: object
      description: The properties of a resource cost item.
      properties:
        resourcename:
          type: string
          description: The name of the resource.
        resourceUId:
          type: string
          description: The unique identifier of the resource.
        resourceCost:
          type: number
          format: double
          description: The cost component of the resource cost item.
        resourceType:
          type: string
          description: The logical resource type (ex. virtualmachine, storageaccount)
        resourceOwner:
          type: string
          description: The owner of the resource (ex. janedoe@microsoft.com)
        resourcePricingTier:
          type: string
          description: The category of the resource (ex. Premium_LRS, Standard_DS1)
        resourceStatus:
          type: string
          description: The status of the resource (ex. Active)
        resourceId:
          type: string
          description: The ID of the resource
        externalResourceId:
          type: string
          description: The ID of the external resource
    TargetCostStatus:
      type: string
      description: Target cost status
      enum:
      - Enabled
      - Disabled
      x-ms-enum:
        name: TargetCostStatus
        modelAsString: true
        values:
        - name: Enabled
          value: Enabled
        - name: Disabled
          value: Disabled
    LabCostProperties:
      type: object
      description: Properties of a cost item.
      properties:
        targetCost:
          $ref: '#/components/schemas/TargetCostProperties'
          description: The target cost properties
        labCostSummary:
          $ref: '#/components/schemas/LabCostSummaryProperties'
          description: The lab cost summary component of the cost data.
          readOnly: true
        labCostDetails:
          type: array
          description: The lab cost details component of the cost data.
          items:
            $ref: '#/components/schemas/LabCostDetailsProperties'
          readOnly: true
          x-ms-identifiers: []
        resourceCosts:
          type: array
          description: The resource cost component of the cost data.
          items:
            $ref: '#/components/schemas/LabResourceCostProperties'
          readOnly: true
          x-ms-identifiers: []
        currencyCode:
          type: string
          description: The currency code of the cost.
        startDateTime:
          type: string
          format: date-time
          description: The start time of the cost data.
        endDateTime:
          type: string
          format: date-time
          description: The end time of the cost data.
        createdDate:
          type: string
          format: date-time
          description: The creation date of the cost.
        provisioningState:
          type: string
          description: The provisioning status of the resource.
          readOnly: true
        uniqueIdentifier:
          type: string
          description: The unique immutable identifier of a resource (Guid).
          readOnly: true
    LabCostSummaryProperties:
      type: object
      description: The properties of the cost summary.
      properties:
        estimatedLabCost:
          type: number
          format: double
          description: The cost component of the cost item.
    CostThresholdStatus:
      type: string
      description: Indicates whether this threshold will be displayed on cost charts.
      enum:
      - Enabled
      - Disabled
      x-ms-enum:
        name: CostThresholdStatus
        modelAsString: true
        values:
        - name: Enabled
          value: Enabled
        - name: Disabled
          value: Disabled
    CostType:
      type: string
      description: The type of the cost.
      enum:
      - Unavailable
      - Reported
      - Projected
      x-ms-enum:
        name: CostType
        modelAsString: true
        values:
        - name: Unavailable
          value: Unavailable
        - name: Reported
          value: Reported
        - name: Projected
          value: Projected
    TargetCostProperties:
      type: object
      description: Properties of a cost target.
      properties:
        status:
          $ref: '#/components/schemas/TargetCostStatus'
          description: Target cost status
        target:
          type: integer
          format: int32
          description: Lab target cost
        costThresholds:
          type: array
          description: Cost thresholds.
          items:
            $ref: '#/components/schemas/CostThresholdProperties'
          x-ms-identifiers: []
        cycleStartDateTime:
          type: string
          format: date-time
          description: Reporting cycle start date.
        cycleEndDateTime:
          type: string
          format: date-time
          description: Reporting cycle end date.
        cycleType:
          $ref: '#/components/schemas/ReportingCycleType'
          description: Reporting cycle type.
  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: Azure DevTest Labs
  source: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/DTL.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)