Amazon Billing And Cost Management Cost Categories API

Organize costs with custom categories

GitHub OpenAPI
Business capability
IT Financial Management BC-600.80

Operations 3

POST /#GetCostCategories Get Cost Categories #
POST /#CreateCostCategoryDefinition Create Cost Category Definition #
POST /#ListCostCategoryDefinitions List Cost Category Definitions #

Documentation

Specifications

Schemas & Data

Other Resources

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/amazon-billing-and-cost-management:amazon-billing-and-cost-management-cost-categories-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

amazon-billing-and-cost-management-cost-categories-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: AWS Cost Explorer Service Cost Categories API
  version: '2017-10-25'
  description: Generated from AWS's published Smithy model for AWS Cost Explorer Service. 3 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://ce.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /#GetCostCategories:
    post:
      operationId: GetCostCategories
      summary: Get Cost Categories
      description: Retrieves an array of cost category names and values incurred cost. If some cost category names and values
        are not associated with any cost, they will not be returned by this API.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/GetCostCategoriesResponse'
        '400':
          description: BillExpirationException; BillingViewHealthStatusException; DataUnavailableException; InvalidNextTokenException;
            LimitExceededException; RequestChangedException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/BillExpirationException'
        '404':
          description: ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AWSInsightsIndexService.GetCostCategories
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/GetCostCategoriesRequest'
      tags:
      - Cost Categories
  /#CreateCostCategoryDefinition:
    post:
      operationId: CreateCostCategoryDefinition
      summary: Create Cost Category Definition
      description: Creates a new cost category with the requested name and rules.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/CreateCostCategoryDefinitionResponse'
        '400':
          description: LimitExceededException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/LimitExceededException'
        '402':
          description: ServiceQuotaExceededException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ServiceQuotaExceededException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AWSInsightsIndexService.CreateCostCategoryDefinition
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/CreateCostCategoryDefinitionRequest'
      tags:
      - Cost Categories
  /#ListCostCategoryDefinitions:
    post:
      operationId: ListCostCategoryDefinitions
      summary: List Cost Category Definitions
      description: Returns the name, Amazon Resource Name (ARN), NumberOfRules and effective dates of all cost categories
        defined in the account. You have the option to use EffectiveOn and SupportedResourceTypes to return a list of cost
        categories that were active on a specific date. If there is no EffectiveOn specified, you’ll see cost categories that
        are effective on the current date. If cost category is still effective, EffectiveEnd is omitted in the response. ListCostCategoryDefinitions
        supports pagination. The request can have a MaxResults range up to 100.
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/ListCostCategoryDefinitionsResponse'
        '400':
          description: LimitExceededException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/LimitExceededException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - AWSInsightsIndexService.ListCostCategoryDefinitions
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/ListCostCategoryDefinitionsRequest'
      tags:
      - Cost Categories
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: ce
  schemas:
    BillExpirationException:
      type: object
      properties:
        Message:
          type: string
    CostCategoryInheritedValueDimension:
      type: object
      properties:
        DimensionName:
          type: string
          enum:
          - LINKED_ACCOUNT_NAME
          - TAG
          description: The name of the dimension that's used to group costs. If you specify LINKED_ACCOUNT_NAME, the cost
            category value is based on account name. If you specify TAG, the cost category value is based on the value of
            the specified tag key.
        DimensionKey:
          type: string
          description: The key to extract cost category values.
    CostCategoryProcessingStatus:
      type: object
      properties:
        Component:
          type: string
          enum:
          - COST_EXPLORER
          description: The Cost Management product name of the applied status.
        Status:
          type: string
          enum:
          - PROCESSING
          - APPLIED
          description: The process status for a specific cost category.
    CostCategoryReference:
      type: object
      properties:
        CostCategoryArn:
          type: string
          description: The unique identifier for your cost category.
        Name:
          type: string
        EffectiveStart:
          type: string
          description: The cost category's effective start date.
        EffectiveEnd:
          type: string
          description: The cost category's effective end date.
        NumberOfRules:
          type: integer
          description: The number of rules that are associated with a specific cost category.
        ProcessingStatus:
          type: array
          items:
            $ref: '#/components/schemas/CostCategoryProcessingStatus'
          description: The list of processing statuses for Cost Management products for a specific cost category.
        Values:
          type: array
          items:
            type: string
          description: A list of unique cost category values in a specific cost category.
        DefaultValue:
          type: string
        SupportedResourceTypes:
          type: array
          items:
            type: string
          description: The resource types supported by a specific cost category.
    CostCategoryRule:
      type: object
      properties:
        Value:
          type: string
        Rule:
          $ref: '#/components/schemas/Expression'
        InheritedValue:
          $ref: '#/components/schemas/CostCategoryInheritedValueDimension'
        Type:
          type: string
          enum:
          - REGULAR
          - INHERITED_VALUE
          description: You can define the CostCategoryRule rule type as either REGULAR or INHERITED_VALUE. The INHERITED_VALUE
            rule type adds the flexibility to define a rule that dynamically inherits the cost category value. This value
            is from the dimension value that's defined by CostCategoryInheritedValueDimension. For example, suppose that you
            want to costs to be dynamically grouped based on the value of a specific tag key. First, choose an inherited value
            rule type, and then choose the tag dimension and specify the tag key to use.
    CostCategorySplitChargeRule:
      type: object
      properties:
        Source:
          type: string
          description: The cost category value that you want to split. That value can't be used as a source or a target in
            other split charge rules. To indicate uncategorized costs, you can use an empty string as the source.
        Targets:
          type: array
          items:
            type: string
          description: The cost category values that you want to split costs across. These values can't be used as a source
            in other split charge rules.
        Method:
          type: string
          enum:
          - FIXED
          - PROPORTIONAL
          - EVEN
          description: The method that's used to define how to split your source costs across your targets. Proportional -
            Allocates charges across your targets based on the proportional weighted cost of each target. Fixed - Allocates
            charges across your targets based on your defined allocation percentage. >Even - Allocates costs evenly across
            all targets.
        Parameters:
          type: array
          items:
            $ref: '#/components/schemas/CostCategorySplitChargeRuleParameter'
          description: The parameters for a split charge method. This is only required for the FIXED method.
      required:
      - Source
      - Targets
      - Method
    CostCategorySplitChargeRuleParameter:
      type: object
      properties:
        Type:
          type: string
          enum:
          - ALLOCATION_PERCENTAGES
          description: The parameter type.
        Values:
          type: array
          items:
            type: string
          description: The parameter values.
      required:
      - Type
      - Values
    CostCategoryValues:
      type: object
      properties:
        Key:
          type: string
        Values:
          type: array
          items:
            type: string
          description: The specific value of the cost category.
        MatchOptions:
          type: array
          items:
            type: string
            enum:
            - EQUALS
            - ABSENT
            - STARTS_WITH
            - ENDS_WITH
            - CONTAINS
            - CASE_SENSITIVE
            - CASE_INSENSITIVE
            - GREATER_THAN_OR_EQUAL
          description: The match options that you can use to filter your results. MatchOptions is only applicable for actions
            related to cost category. The default values for MatchOptions is EQUALS and CASE_SENSITIVE.
    CreateCostCategoryDefinitionRequest:
      type: object
      properties:
        Name:
          type: string
        EffectiveStart:
          type: string
          description: The cost category's effective start date. It can only be a billing start date (first day of the month).
            If the date isn't provided, it's the first day of the current month. Dates can't be before the previous twelve
            months, or in the future.
        RuleVersion:
          type: string
          enum:
          - CostCategoryExpression.v1
        Rules:
          type: array
          items:
            $ref: '#/components/schemas/CostCategoryRule'
          description: The cost category rules used to categorize costs. For more information, see CostCategoryRule.
        DefaultValue:
          type: string
        SplitChargeRules:
          type: array
          items:
            $ref: '#/components/schemas/CostCategorySplitChargeRule'
          description: The split charge rules used to allocate your charges between your cost category values.
        ResourceTags:
          type: array
          items:
            $ref: '#/components/schemas/ResourceTag'
          description: 'An optional list of tags to associate with the specified CostCategory . You can use resource tags
            to control access to your cost category using IAM policies. Each tag consists of a key and a value, and each key
            must be unique for the resource. The following restrictions apply to resource tags: Although the maximum number
            of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved
            for Amazon Web Services use The maximum length of a key is 128 characters The maximum length of a value is 256
            characters Keys and values can only contain alphanumeric'
      required:
      - Name
      - RuleVersion
      - Rules
    CreateCostCategoryDefinitionResponse:
      type: object
      properties:
        CostCategoryArn:
          type: string
          description: The unique identifier for your newly created cost category.
        EffectiveStart:
          type: string
          description: The cost category's effective start date. It can only be a billing start date (first day of the month).
    DateInterval:
      type: object
      properties:
        Start:
          type: string
          description: The beginning of the time period. The start date is inclusive. For example, if start is 2017-01-01,
            Amazon Web Services retrieves cost and usage data starting at 2017-01-01 up to the end date. The start date must
            be equal to or no later than the current date to avoid a validation error.
        End:
          type: string
          description: The end of the time period. The end date is exclusive. For example, if end is 2017-05-01, Amazon Web
            Services retrieves cost and usage data from the start date up to, but not including, 2017-05-01.
      required:
      - Start
      - End
    DimensionValues:
      type: object
      properties:
        Key:
          type: string
          enum:
          - AZ
          - INSTANCE_TYPE
          - LINKED_ACCOUNT
          - PAYER_ACCOUNT
          - LINKED_ACCOUNT_NAME
          - OPERATION
          - PURCHASE_TYPE
          - REGION
          - SERVICE
          - SERVICE_CODE
          - USAGE_TYPE
          - USAGE_TYPE_GROUP
          - RECORD_TYPE
          - OPERATING_SYSTEM
          - TENANCY
          - SCOPE
          - PLATFORM
          - SUBSCRIPTION_ID
          - LEGAL_ENTITY_NAME
          - DEPLOYMENT_OPTION
          - DATABASE_ENGINE
          - CACHE_ENGINE
          - INSTANCE_TYPE_FAMILY
          - BILLING_ENTITY
          - RESERVATION_ID
          - RESOURCE_ID
          - RIGHTSIZING_TYPE
          - SAVINGS_PLANS_TYPE
          - SAVINGS_PLAN_ARN
          - PAYMENT_OPTION
          - AGREEMENT_END_DATE_TIME_AFTER
          - AGREEMENT_END_DATE_TIME_BEFORE
          - INVOICING_ENTITY
          - ANOMALY_TOTAL_IMPACT_ABSOLUTE
          - ANOMALY_TOTAL_IMPACT_PERCENTAGE
          - PRODUCT_ATTRIBUTE
          description: The names of the metadata types that you can use to filter and group your results. For example, AZ
            returns a list of Availability Zones. Not all dimensions are supported in each API. Refer to the documentation
            for each specific API to see what is supported. LINKED_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule.
            ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions. Use
            PRODUCT_ATTRIBUTE only as the Dimension in GetDimensionValues. To filter or group by product attributes, use the
            ProductAttributes field of Expression or t
        Values:
          type: array
          items:
            type: string
          description: The metadata values that you can use to filter and group your results. You can use GetDimensionValues
            to find specific values.
        MatchOptions:
          type: array
          items:
            type: string
            enum:
            - EQUALS
            - ABSENT
            - STARTS_WITH
            - ENDS_WITH
            - CONTAINS
            - CASE_SENSITIVE
            - CASE_INSENSITIVE
            - GREATER_THAN_OR_EQUAL
          description: The match options that you can use to filter your results. MatchOptions is only applicable for actions
            related to cost category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what
            is supported. The default values for MatchOptions are EQUALS and CASE_SENSITIVE.
    Expression:
      type: object
      properties:
        Or:
          type: array
          items:
            $ref: '#/components/schemas/Expression'
          description: Return results that match either Dimension object.
        And:
          type: array
          items:
            $ref: '#/components/schemas/Expression'
          description: Return results that match both Dimension objects.
        Not:
          $ref: '#/components/schemas/Expression'
        Dimensions:
          $ref: '#/components/schemas/DimensionValues'
        Tags:
          $ref: '#/components/schemas/TagValues'
        CostCategories:
          $ref: '#/components/schemas/CostCategoryValues'
        ProductAttributes:
          $ref: '#/components/schemas/ProductAttributeValues'
    GetCostCategoriesRequest:
      type: object
      properties:
        SearchString:
          type: string
          description: The value that you want to search the filter values for. If you don't specify a CostCategoryName, SearchString
            is used to filter cost category names that match the SearchString pattern. If you specify a CostCategoryName,
            SearchString is used to filter cost category values that match the SearchString pattern.
        TimePeriod:
          $ref: '#/components/schemas/DateInterval'
        CostCategoryName:
          type: string
        Filter:
          $ref: '#/components/schemas/Expression'
        SortBy:
          type: array
          items:
            $ref: '#/components/schemas/SortDefinition'
          description: 'The value that you sort the data by. The key represents the cost and usage metrics. The following
            values are supported: BlendedCost UnblendedCost AmortizedCost NetAmortizedCost NetUnblendedCost UsageQuantity
            NormalizedUsageAmount The supported key values for the SortOrder value are ASCENDING and DESCENDING. When you
            use the SortBy value, the NextPageToken and SearchString key values aren''t supported.'
        BillingViewArn:
          type: string
          description: The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to
            specify which particular billing view you want to interact with or retrieve information from when making API calls
            related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling
            the ListBillingViews API.
        MaxResults:
          type: integer
          description: This field is only used when the SortBy value is provided in the request. The maximum number of objects
            that are returned for this request. If MaxResults isn't specified with the SortBy value, the request returns 1000
            results as the default value for this parameter. For GetCostCategories, MaxResults has an upper quota of 1000.
        NextPageToken:
          type: string
          description: If the number of objects that are still available for retrieval exceeds the quota, Amazon Web Services
            returns a NextPageToken value in the response. To retrieve the next batch of objects, provide the NextPageToken
            from the previous call in your next request.
      required:
      - TimePeriod
    GetCostCategoriesResponse:
      type: object
      properties:
        NextPageToken:
          type: string
          description: If the number of objects that are still available for retrieval exceeds the quota, Amazon Web Services
            returns a NextPageToken value in the response. To retrieve the next batch of objects, provide the marker from
            the prior call in your next request.
        CostCategoryNames:
          type: array
          items:
            type: string
          description: The names of the cost categories.
        CostCategoryValues:
          type: array
          items:
            type: string
          description: The cost category values. If the CostCategoryName key isn't specified in the request, the CostCategoryValues
            fields aren't returned.
        ReturnSize:
          type: integer
          description: The number of objects that are returned.
        TotalSize:
          type: integer
          description: The total number of objects.
      required:
      - ReturnSize
      - TotalSize
    LimitExceededException:
      type: object
      properties:
        Message:
          type: string
    ListCostCategoryDefinitionsRequest:
      type: object
      properties:
        EffectiveOn:
          type: string
          description: The date when the cost category was effective.
        NextToken:
          type: string
          description: The token to retrieve the next set of results. Amazon Web Services provides the token when the response
            from a previous call has more results than the maximum page size.
        MaxResults:
          type: integer
          description: The number of entries a paginated response contains.
        SupportedResourceTypes:
          type: array
          items:
            type: string
          description: Filter cost category definitions that are supported by given resource types based on the latest version.
            If the filter is present, the result only includes Cost Categories that supports input resource type. If the filter
            isn't provided, no filtering is applied. The valid values are billing:rispgroupsharing, billing:billingview, and
            billing:creditsharing.
    ListCostCategoryDefinitionsResponse:
      type: object
      properties:
        CostCategoryReferences:
          type: array
          items:
            $ref: '#/components/schemas/CostCategoryReference'
          description: A reference to a cost category that contains enough information to identify the Cost Category.
        NextToken:
          type: string
          description: The token to retrieve the next set of results. Amazon Web Services provides the token when the response
            from a previous call has more results than the maximum page size.
    ProductAttributeValues:
      type: object
      properties:
        Key:
          type: string
          description: 'The name of the product attribute, such as model. The keys that are available depend on the service.
            For the keys of each supported service, see ProductAttributeValues . Keys are case-sensitive. A key that doesn''t
            exist doesn''t return an error: EQUALS matches no costs, and ABSENT matches all costs of supported services.'
        Values:
          type: array
          items:
            type: string
          description: The specific values of the product attribute, such as Claude Sonnet 5 for the model key. Values are
            matched exactly, including case. To list the values of a key, use GetDimensionValues with Dimension set to PRODUCT_ATTRIBUTE
            and DimensionKey set to the key. To match costs that have no value for the key, set MatchOptions to ABSENT and
            omit Values. Otherwise, Values is required.
        MatchOptions:
          type: array
          items:
            type: string
            enum:
            - EQUALS
            - ABSENT
            - STARTS_WITH
            - ENDS_WITH
            - CONTAINS
            - CASE_SENSITIVE
            - CASE_INSENSITIVE
            - GREATER_THAN_OR_EQUAL
          description: 'The match options that you can use to filter your results. Valid values: EQUALS - Matches the values
            that you specify. ABSENT - Matches costs that have no value for the key. Omit Values. CASE_SENSITIVE - Use only
            with EQUALS. Values are always matched case-sensitively. Default values are EQUALS and CASE_SENSITIVE.'
      required:
      - Key
    ResourceNotFoundException:
      type: object
      properties:
        Message:
          type: string
        ResourceName:
          type: string
    ResourceTag:
      type: object
      properties:
        Key:
          type: string
          description: The key that's associated with the tag.
        Value:
          type: string
          description: The value that's associated with the tag.
      required:
      - Key
      - Value
    ServiceQuotaExceededException:
      type: object
      properties:
        Message:
          type: string
    SortDefinition:
      type: object
      properties:
        Key:
          type: string
          description: The key that's used to sort the data.
        SortOrder:
          type: string
          enum:
          - ASCENDING
          - DESCENDING
          description: The order that's used to sort the data.
      required:
      - Key
    TagValues:
      type: object
      properties:
        Key:
          type: string
          description: The key for the tag.
        Values:
          type: array
          items:
            type: string
          description: The specific value of the tag.
        MatchOptions:
          type: array
          items:
            type: string
            enum:
            - EQUALS
            - ABSENT
            - STARTS_WITH
            - ENDS_WITH
            - CONTAINS
            - CASE_SENSITIVE
            - CASE_INSENSITIVE
            - GREATER_THAN_OR_EQUAL
          description: The match options that you can use to filter your results. MatchOptions is only applicable for actions
            related to cost category. The default values for MatchOptions are EQUALS and CASE_SENSITIVE.
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/cost-explorer/service/2017-10-25/cost-explorer-2017-10-25.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)