Cloud Cost Management
Manage perspectives, budgets, cost categories, anomalies, recommendations, and governance rules with the Harness Cloud Cost Management API.
The Cloud Cost Management (CCM) API reports and controls your cloud and AI spend. Use it to group costs, set budgets, act on anomalies and recommendations, and enforce cost governance rules.
Request basics
API key token: Send it in the
x-api-keyheader on every request. Go to Manage API keys to create a key and token.Account ID: Almost every endpoint takes
accountIdentifier, as a query parameter or in the path. Most resources sit at account level, so organization and project IDs are rarely needed.Base URL: Send requests to
https://app.harness.io/gateway/ccm/api, followed by the endpoint path.
Example request
List the budgets in your account:
curl "https://app.harness.io/gateway/ccm/api/budgets?accountIdentifier=ACCOUNT_ID" \
-H "x-api-key: $HARNESS_API_KEY"Replace ACCOUNT_ID with your own values, and set HARNESS_API_KEY to your API key token.
Find an endpoint
Endpoint paths are relative to the base URL.
Perspectives: Saved views that group costs by cloud account, service, label, or cost category. Folders and reports are part of this group. List perspectives with
GET /perspective/getAllPerspectivesand read one withGET /perspective. Go to Perspectives to create a perspective.Budgets and budget groups: Spending limits on a perspective, with alerts when actual or forecast spend crosses a threshold. List budgets with
GET /budgetsand create one withPOST /budgets. Go to Budgets to create a budget.Cost categories: Rules that map costs to business units, teams, or products. List cost categories with
GET /business-mapping. Go to Cost Categories to define cost categories.Anomalies: Unexpected spikes in spend, with comments and an ignore list for known spikes. List anomalies with
POST /anomaly. Go to Anomalies to detect anomalies.Recommendations: Suggested savings, such as rightsizing workloads and node pools, with Jira and ServiceNow tracking. List recommendations with
POST /recommendation/overview/list, then read one, for example withGET /recommendation/details/ec2-instance. Go to Recommendations to act on recommendations.Asset governance: Rules, rule sets, and enforcements that find and fix wasteful cloud resources on a schedule. List rules with
POST /governance/rule/listand enforcements withGET /governance/enforcement/list. Go to Asset Governance to set up asset governance.Unit metrics: Cost per business unit, such as cost per customer or per transaction. Read your unit metrics with
GET /unit-metric. Go to Unit Cost Metrics to set up unit cost metrics.
Last updated
Was this helpful?