> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/cost-management-agent-apis/commitment-orchestrator.md).

# Commitment Orchestrator

Set up Commitment Orchestrator and read savings, coverage, and utilization data for reserved instances and savings plans with the Harness Commitment Orchestrator API.

The Commitment Orchestrator API manages Harness Commitment Orchestrator, which buys and adjusts reserved instances and savings plans in your cloud accounts. Use it to configure Commitment Orchestrator, approve its actions, and read the savings it produces.

## Request basics

* **API key token**: Send it in the `x-api-key` header on every request. Go to [Manage API keys](https://developer.harness.io/harness-platform/use-harness-platform/automation/api/add-and-manage-api-keys) to create a key and token.
* **Account ID**: Most endpoints take it as the `account_id` path parameter. Others take `accountIdentifier` and a `routingId` query parameter.
* **Base URL**: Send requests to `https://app.harness.io/gateway/lw/co/api`, followed by the endpoint path.

## Example request

List the cloud accounts Commitment Orchestrator is set up for:

```bash
curl "https://app.harness.io/gateway/lw/co/api/accounts/ACCOUNT_ID/v1/setup/list?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.

* **Setup**: Which cloud accounts and commitment types Commitment Orchestrator manages, and the coverage it aims for. List setups with `GET /accounts/{account_id}/v1/setup/list`. Go to [Commitment Orchestrator](https://developer.harness.io/cloud-cost-management/cost-optimization/commitment-orchestrator) to configure what it manages.
* **Approvals**: Actions Commitment Orchestrator proposes and waits for a person to approve. List pending actions with `POST /accounts/{account_id}/v2/approvals/list`, and approve or reject one with `POST /accounts/{account_id}/v1/approvals/update`. Go to [Commitment Orchestrator overview](https://developer.harness.io/cloud-cost-management/cost-optimization/commitment-orchestrator/overview) to understand the approval flow.
* **Events**: The log of purchases, exchanges, and renewals it has made. List the log with `POST /accounts/{account_id}/v1/events/logs`.
* **Inventory**: The reserved instances and savings plans in your accounts. List reserved instances with `POST /accounts/{account_id}/v2/inventory/ri/list`, and get an overview of savings plans with `POST /accounts/{account_id}/v2/inventory/sp/overview`.
* **Savings, coverage, and utilization**: How much the commitments save, how much spend they cover, and how much of each one is used. Get a savings overview with `POST /accounts/{account_id}/v2/savings/overview`, and utilization with `GET /accounts/{account_id}/v1/detail/commitment_utilisation`.
