Authorization

CloudZero uses key-based authorization to secure API access. To authenticate your requests, include your API key in the Authorization header:

curl -X GET https://api.cloudzero.com/v2/insights \
  -H "Authorization: AbCd1234EfGh5678AbCd1234EfGh5678AbCd12"
ℹ️

This is not a bearer token, so there is no Bearer prefix in the Authorization header.

Manage API keys

An organization can have multiple API keys. To view and manage all API keys for your organization, navigate to Settings > API Keys.

Only users with the necessary permissions can manage keys. Each key can be assigned one or more API scopes, which grant access to specific endpoints in the CloudZero API.

The API Keys page displays a list of keys with the following information:

  • Name
  • Description
  • Created By: Email of the user who created the key
  • Updated By: Email of the user who last modified the key
  • Last Modified: Last update timestamp
  • Last Accessed: Last usage timestamp, or "Not In Use" if the key has never been used
  • Scopes: Number of granted API scopes
  • Status: Enabled or Disabled

If your organization had an API key before multiple keys were supported, it is listed as Legacy API Key.

ℹ️

For keys that use fixed scopes, CloudZero does not automatically grant access to new API endpoints. When new endpoints are released, you must edit each key to manually add the necessary scopes. Keys that use managed scopes stay current on their own.

Create an API key

  1. Navigate to Settings > API Keys.

  2. Select Create API Key.

  3. Enter a name for the key (minimum 3 characters, must be unique).

  4. Enter a description (optional).

  5. Under Scopes, choose how the key is scoped. See Fixed and managed scopes for which to pick.

    • Managed scopes: select one or more use cases, such as Send AI Telemetry. CloudZero keeps the key's scopes current as new endpoints ship.
    • Fixed scopes: select each scope individually. You must select at least one. Scopes are grouped into categories under six blocks, such as Read cost data and Configure. Use the search bar or expand categories to find specific scopes. For information about each scope, refer to API key scopes.
  6. Select Create API Key.

  7. Copy the API key displayed. It will not be shown again.

  1. Select Done.

New keys are Enabled by default.

Edit an API key

  1. On the API Keys page, locate the key you want to modify.
  2. Click the key name, or select the three-dot icon in the Actions column and select Edit.
  3. Modify the Name, Description, or Scopes as needed. For information about each scope, refer to API key scopes.
  4. Select Save Changes.

On a key that uses fixed scopes, a save that removes a scope or adds a replacement opens a Save scope changes dialog. It lists the replacements, the other scopes you added, and the scopes you removed. Select Save changes to confirm, or Cancel to keep editing.

Update out-of-date scopes

A key can hold a scope that is no longer Current (see Scope states). On the API Keys page, such a key shows a badge next to its name, such as 1 out of date. The count includes both Retired and Removed scopes.

To update the key:

  1. Click the key name to open the Update API Key panel.
  2. Above the scope list, a notice lists each out-of-date scope with a Retired or Removed badge. When a scope has a replacement, the notice names it.
  3. Add the replacement:
    • For a Retired scope, select Use replacement where the notice offers it. The button checks the replacement and unchecks the Retired scope.
    • For a Removed scope, check the replacement in the scope list, then uncheck the Removed scope in the notice.
  4. Select Save Changes, then confirm in the Save scope changes dialog.

Nothing changes on the key until you save. If you close the panel without saving, the key keeps every scope it had, and its Retired scopes keep working.

When a scope has no replacement, the notice says "No replacement exists." To drop the scope, uncheck it. Unchecking a Retired scope removes access the key still has. Unchecking a Removed scope changes nothing the key can reach today.

Enable or disable an API key

  1. On the API Keys page, locate the key you want to modify.
  2. Select the three-dot icon in the Actions column.
  3. Select Enable or Disable.

The Status column updates to reflect the change.

Delete an API key

⚠️

Deleting an API key immediately revokes access for any services using it. This action cannot be undone.

  1. On the API Keys page, locate the key you want to delete.
  2. Select the three-dot icon in the Actions column.
  3. Select Delete.
  4. Type the exact name of the API key to confirm deletion.
  5. Select Delete.

Fixed and managed scopes

Every API key is scoped one of two ways. A key uses either fixed scopes or managed scopes, never both.

Managed scopes grant a use case rather than a list of endpoints. You select Send AI Telemetry or Send Billing Data, and CloudZero maintains the underlying scopes for you. When a new endpoint ships within that use case, keys already referencing it gain access without any edit. This is the better choice for send-only integrations, where the alternative is discovering later that a key was silently missing an endpoint added after it was issued.

Managed scopes are offered only for use cases that exclusively accept data. These endpoints return nothing about your organization beyond whether a submission was accepted, so widening one cannot expose data a key could not already send.

Use caseWhat it grants
Send AI TelemetryIngest AI inference telemetry from any source.
Send Billing DataSend billing data to an already-established connection.

Fixed scopes grant exactly the scopes you select and nothing more. New endpoints are never added automatically, so a key keeps the same permissions until you edit it. Choose fixed scopes when a key reads organization data, when you need permissions narrower than a whole use case, or when an audit requires the grant to be an explicit, unchanging list.

API key scopes

The scopes below apply to keys that use fixed scopes. CloudZero organizes them into categories, grouped into six blocks named for what a key with those scopes can do. Each scope grants access to specific API endpoints. When creating or editing an API key, select the scopes that match how the key will be used.

AI

Ask questions, send AI telemetry

AI Hub (MCP)

Access the CloudZero AI Hub over MCP for AI assistants and agents.

ScopeWhat it grantsDocs
AI Hub (MCP) Access
ai-hub:mcp
Use every AI Hub tool your organization has enabled across all of your data, including tools that write, such as sending telemetry and updating your organization context.Guide

This one scope covers every AI Hub tool your organization has enabled, with access to all of your organization's data. Role-based data access filters and permission set restrictions do not apply to API keys. Tools can read (for example, cost data, dimensions, telemetry, optimization recommendations, realized savings, resource metadata, and CostFormation definitions) and write (for example, managing organization context and logging Insights). To apply each person's data access and permissions, have them sign in individually instead (browser sign-in or an MCP OAuth client).

Send AI Telemetry

Ingest AI inference telemetry from any source.

ScopeWhat it grantsDocs
AI Telemetry (all sources)
ai-telemetry-ingest:ingest-ai-telemetry
Send AI inference telemetry from any supported source, such as LiteLLM, Claude Code, or OpenTelemetry, without reading anything about your organization back.

AI Device Control Plane

Enroll AI telemetry devices and report their liveness.

ScopeWhat it grantsDocs
Enroll Devices
ai-control-plane:enroll-device
Register a device that sends AI telemetry and get a 7-day device token, which adds the device to your organization's device list.
Send Device Heartbeats
ai-control-plane:heartbeat-device
Check in a registered device with its version and components, which extends its token and keeps its status current.
Ping Devices
ai-control-plane:ping-device
Report that a device is reachable without a device token, which can add a placeholder device to your organization's device list.

Send data in

Send usage, telemetry and billing data in

Telemetry & Usage Streams

Create and manage unit-cost telemetry streams and record engineering events.

ScopeWhat it grantsDocs
Send Engineering Events
events_v1:create_event
Record engineering events, such as deploys, on your organization's cost timeline.Reference
Send Allocation Telemetry (Legacy)
unit-cost_v1:create_telemetry_stream
Send unit-cost allocation records through the older upload path, which adds to existing values and creates the stream if it does not exist yet.
Delete Telemetry Streams
unit-cost_v1:delete_telemetry_stream
Delete a unit-cost telemetry stream and all of its records, unless a custom dimension uses it.Reference
Manage Telemetry Records
unit-cost_v1:manage_telemetry_records
Send, replace, or delete unit-cost telemetry records, including overwriting or removing records you sent before.Allocation telemetry, Unit cost metric telemetry
Read Telemetry
unit-cost_v1:read_telemetry
Read the records sent to a unit-cost telemetry stream, without any cost amounts.Telemetry stream records, Metrics records

Kubernetes Agent

Send-only permissions for the CloudZero Kubernetes agent to upload container metrics.

ℹ️

The agent also requires the List Insights permission (listed under Insights & Anomalies) to validate its API key at startup. This is an authentication liveness check only — it is not used to read cost data — and is the only read the agent needs.

ScopeWhat it grantsDocs
Abandon Metric Uploads
container-metrics_v1:abandon
Mark agent uploads that never arrived as abandoned, without changing any data CloudZero already received.Guide
Send Cluster Status
container-metrics_v1:get-status
Send the Kubernetes agent's cluster health and configuration to CloudZero for the Clusters page, without reading anything back.Guide
Legacy Metric Upload
container-metrics_v1:legacy
Send container metrics through the older direct upload path that the agent install guide still requires, without returning any data.Guide
Upload Container Metrics
container-metrics_v1:upload
Get upload links for the Kubernetes agent to send pod CPU and memory metrics, without returning any cost data.Guide

Send Billing Data

Send billing data to an already-established connection.

ScopeWhat it grantsDocs
Send AnyCost Billing Data
connections:create_billing_anycost_billing_drop
Send AnyCost billing data for one month, which by default replaces everything previously sent for that month.Reference
Validate AnyCost Billing Data
connections:create_billing_anycost_validate_billing_drop
Check AnyCost billing data for errors without storing or sending it.Reference

Read cost data

Read cost data and manage saved Views

Cost & Usage Data

Read cost, usage, dimension, and resource-tag data via the API.

ScopeWhat it grantsDocs
Read Cost Data
billing:read_costs
Read your organization's cost over time, grouped and filtered by any dimension, across all of your cost regardless of any user's data access.Reference
Read Dimensions
billing:read_dimensions
List the dimensions your cost can be grouped by, without their values or any cost.Reference
Read Resource Tags
billing:read_resource_tags
List the tags on your resources, without any cost data.

Views

Create, read, update, and delete saved Views.

ScopeWhat it grantsDocs
Create Views
views:create_view
Create a View for your whole organization, which can turn on anomaly detection and set who receives its anomaly and budget alerts.Reference
Delete Views
views:delete_view
Permanently delete a View for your whole organization, leaving any budgets built on it in place.Reference
Read a View
views:read_view
Read one View's filters, groupings, and alert recipients, without any cost data.Reference
List Views
views:read_views
List your organization's Views with their filters, groupings, and alert recipients, without any cost data.Reference
Update Views
views:update_view
Change a View's filters, groupings, or alert recipients for everyone who uses it.Reference

Act on cost

Create and change budgets, insights, recommendations, monitors

Insights & Anomalies

Create, read, update, and comment on cost anomalies / insights.

ScopeWhat it grantsDocs
Create Insights
insights:create_insight
Create a manual insight, such as a cost note or task, which appears in your organization's daily insights email.Reference
Comment on Insights
insights:create_insight_comment
Comment on an insight as the organization's API key rather than as a person.Reference
Delete Insights
insights:delete_insight
Delete any insight and its comments for your whole organization, including anomalies CloudZero detected.Reference
Read an Insight
insights:read_insight
Read one insight, including anomalies CloudZero detected and their cost impact.Reference
Read Insight Comments
insights:read_insight_comments
Read the comments on an insight.Reference
List Insights
insights:read_insights
List your organization's insights, including anomalies CloudZero detected and their cost impact.Reference
Update Insights
insights:update_insight
Change the status or effort of any insight, including anomalies CloudZero detected, and the title, description, and cost impact of manual ones.Reference
Update Insight Comments
insights:update_insight_comment
Edit comments that API keys posted on insights, but not comments written by people.Reference

Budgets

Create, read, update, and delete budgets.

ScopeWhat it grantsDocs
Create Budgets
budgets:create_budget
Create a monthly budget on a View, with spend thresholds that alert the View's recipients.Reference
Delete Budgets
budgets:delete_budget
Delete a budget and stop its alerts, with no way to restore it through the API.Reference
Read a Budget
budgets:read_budget
Read one budget's limits, View, and alert thresholds, and optionally its actual spend against plan.Reference
List Budgets
budgets:read_budgets
List your organization's budgets, and optionally their actual spend against plan.Reference
Update Budgets
budgets:update_budget
Change a budget's monthly limits, View, or alert thresholds, which changes who is alerted and when.Reference

Optimization & Savings

Read and manage savings recommendations and their comments.

ScopeWhat it grantsDocs
Check Optimization Access
optimize:check
Check that the optimization API is reachable, without returning any recommendations or cost data.
Comment on Recommendations
optimize:create_comments
Comment on one or more savings recommendations at once, as an API caller rather than as a person.Reference
Delete Recommendation Comments
optimize:delete_comment
Delete any comment on a savings recommendation, including comments written by people.Reference
Read Optimization Dimensions
optimize:get_available_dimensions
List the dimensions you can filter savings recommendations by, without their values or any cost data.
Read a Recommendation
optimize:get_recommendation
Read one savings recommendation with its cost impact and estimated savings.Reference
Read a Recommendation Type
optimize:get_recommendation_type
Read one type of savings recommendation and whether it is turned on for your organization.
List Recommendation Comments
optimize:list_comments
Read the comments on a savings recommendation.Reference
List Recommendation Types
optimize:list_recommendation_types
List the types of savings recommendation CloudZero can generate and whether each is turned on for your organization.Reference
List Recommendations
optimize:list_recommendations
List your organization's savings recommendations with their cost impact and estimated savings.Reference
Update Recommendation Comments
optimize:update_comment
Edit any comment on a savings recommendation, including comments written by people.Reference
Update Recommendation Types
optimize:update_recommendation_type
Turn a type of savings recommendation on or off for your whole organization, which marks its existing recommendations as disabled when turned off.Reference
Update Recommendations
optimize:update_recommendations
Change the status or effort of savings recommendations, or link them to a work item, for your whole organization.Reference

Monitors & Incidents

Read and manage cost monitors and the incidents they raise.

ScopeWhat it grantsDocs
Create Monitors
monitors:create_monitor
Create a cost monitor that CloudZero evaluates for your whole organization, raising incidents when its spend is anomalous.Reference
Read an Incident
monitors:get_incident
Read one incident, including its cost impact, affected resources, and analysis summary.Reference
Read a Monitor
monitors:get_monitor
Read one cost monitor's configuration and notification recipients, and how many of its incidents are open.Reference
List Incidents
monitors:list_incidents
List the incidents your monitors raised, with their cost impact and status.Reference
List Monitors
monitors:list_monitors
List your organization's cost monitors, including their filters, thresholds, and notification recipients.Reference
Update Incidents
monitors:update_incident
Update an incident, such as acknowledging or resolving it, which is recorded in its activity log and synced to any linked ticket.Reference
Update Monitors
monitors:update_monitor
Change any monitor's name, filters, or threshold, or pause it, including monitors created in CloudZero, which changes what is evaluated for your whole organization.Reference
Update Monitor Notifications
monitors:update_notifications
Set who is notified when a monitor raises an incident: email addresses and Slack channels, on any monitor, including monitors created in CloudZero.Reference

Configure

Change how cost is allocated and where data comes from

Cost Allocation (CostFormation)

Manage CostFormation definitions, namespaces, and publish jobs for cost allocation.

ScopeWhat it grantsDocs
Cancel Publish Jobs
costformation:cancel_publish_job
Cancel a publish job that has not started yet.Reference
Create Definitions
costformation:create_definition_async
Queue a new CostFormation definition that changes cost allocation for everyone in your organization once its background publish job completes.Reference
Create Definition Versions
costformation:create_definition_version
Upload a new CostFormation definition version, which publishes right away and changes cost allocation for everyone in your organization unless you only validate it.Reference
Create Namespaces
costformation:create_namespace
Create a namespace for CostFormation definitions and choose which roles can view and edit it.Reference
Create Namespaced Definitions
costformation:create_namespaced_definition_async
Queue a new CostFormation definition for one namespace that changes that namespace's dimensions once its background publish job completes.Reference
Delete Namespaces
costformation:delete_namespace
Delete a namespace along with every definition and definition version inside it.Reference
List Publish Jobs
costformation:list_publish_jobs
List CostFormation publish jobs and their status.Reference
List Namespaces
costformation:read_all_namespaces
List your namespaces and the roles that can view and edit each one.Reference
Read a Definition Version
costformation:read_definition_version
Download one saved version of a CostFormation definition.Reference
List Definition Versions
costformation:read_definition_versions
List the saved versions of a CostFormation definition and who updated each one.Reference
Read a Namespace
costformation:read_namespace
Read one namespace and the roles that can view and edit it.Reference
Read a Publish Job
costformation:read_publish_job
Check the status of one CostFormation publish job.Reference
Update Namespaces
costformation:update_namespace
Change which roles can view and edit a namespace.Reference

Manage Billing Connections

Create, read, update, and delete billing connections, and read what AnyCost connections have received.

ScopeWhat it grantsDocs
Create Billing Connections
connections:create_billing
Create a custom billing connection that ingests cost objects from an S3 bucket, but not native AWS, Azure, or Google Cloud connections.Reference
Delete Billing Connections
connections:delete_billing
Delete a custom billing connection, which removes its billing data from CloudZero after the next ingest.Reference
Read a Billing Connection
connections:read_billing
Read one billing connection's settings and ingest health, including S3 bucket and IAM role details but no cost data.Reference
List AnyCost Billing Drops
connections:read_billing_anycost_billing_drops
List the current AnyCost billing drop for each month with its row count, without any cost data.Reference
Read Monthly AnyCost Billing Data
connections:read_billing_anycost_billing_drops_month
Read the billing rows an AnyCost connection received for one month, including their costs.Reference
List Billing Connections
connections:read_billings
List your billing connections with their settings and ingest health, including S3 bucket and IAM role details but no cost data.Reference
Update Billing Connections
connections:update_billing
Pause or resume any billing connection, and change the name, S3 location, and ingest months of custom ones.Reference

Kubernetes Clusters

Read Kubernetes clusters and the cost of their workloads, and hide or show clusters. Not required by the Kubernetes agent to send data.

ScopeWhat it grantsDocs
List Clusters
container:get-clusters
List your Kubernetes clusters with their agent status and workloads, including the cost of each workload.
Update Clusters
container:update-cluster
Hide or show a Kubernetes cluster, without changing its data collection or cost allocation.

Administer

Change who can do any of the above

Roles & Access Control

Manage CloudZero roles and read permission sets via the API.

ScopeWhat it grantsDocs
Create Roles
access-control:create_role
Create a role with any permission sets, including permissions the key that creates it does not have.Reference
Delete Roles
access-control:delete_role
Delete a role and remove every user from it, so they lose any access the role gave them.Reference
Read Permission Sets
access-control:read_permission_sets
List the permission sets you can add to a role and what each one allows.Reference
Read a Role
access-control:read_role
Read one role's name, description, permission sets, and data access.Reference
List Roles
access-control:read_roles
List the roles in your organization.Reference
Update Roles
access-control:update_role
Change a role's name, permission sets, or data access for every user in it, including adding permissions the key making the change does not have.Reference

Scope states

Every scope has a state: Current, Retired, or Removed. The state decides whether the scope can be granted, and whether it still works for a key that already holds it.

StateNew grantsKeys that already hold it
CurrentOffered in the scope picker.Authorizes calls.
RetiredHidden from the scope picker. It can't be granted to a key again.Still authorizes calls.
RemovedCan't be granted.No longer authorizes any call.

A Retired or Removed scope can name a replacement scope, which is always Current. Every scope listed on this page is Current. To move a key off a Retired or Removed scope, see Update out-of-date scopes.

ℹ️

If you need help, contact your account manager.