opencost is a free, open source monitoring & observability project written in Go and released under Apache-2.0. It has 6,749 GitHub stars, 882 forks and 306 open issues, and was last pushed 32 hours ago. On this registry it ranks #69 of 191 tracked projects in Monitoring & Observability, with 5 head-to-head comparisons available.

What is opencost?

OpenCost is an Apache-2.0 licensed, Go-based cost monitoring tool that gives platform, FinOps, and engineering teams visibility into current and historical Kubernetes resource allocation and multi-cloud spend, built for anyone running Kubernetes clusters who needs to know what those clusters and their cloud services actually cost.

What it is

OpenCost is an open source cost monitoring project for Kubernetes workloads and cloud costs, distributed under the Apache-2.0 licence and tagged among its topics as cncf, kubernetes, finops, and prometheus. The repository combines a specification in the /spec/ directory with a Go implementation of those detailed requirements, and the web interface ships separately in the opencost/opencost-ui repository. The project was originally developed and open sourced by Kubecost, and it reports both current and historical Kubernetes spend and cloud spend alongside resource allocation.

The problem it solves is cost transparency in Kubernetes environments that serve multiple applications, teams, or departments, where consumption is shared across a cluster and is hard to attribute to a workload. OpenCost replaces manual reconciliation of cluster resource usage against provider billing data: it pulls dynamic on-demand Kubernetes asset pricing from the AWS, Azure, and GCP billing APIs, monitors all cloud services across those providers, and supports on-premises clusters through custom CSV pricing. Allocation covers CPU, GPU, memory, and persistent volumes, and coverage extends to carbon costs for cloud resources and to external costs such as Datadog through OpenCost Plugins. It lives in the Kubernetes and Prometheus ecosystem, where it is installed and managed exclusively through its Helm chart.

Key capabilities

  • Real-time cost allocation broken down by Kubernetes cluster, node, namespace, controller kind, controller, service, or pod.
  • Multi-cloud cost monitoring for all cloud services on AWS, Azure, and GCP, with dynamic on-demand Kubernetes asset pricing driven by those providers' billing APIs.
  • On-premises Kubernetes support using custom CSV pricing, alongside allocation for in-cluster resources such as CPU, GPU, memory, and persistent volumes.
  • Pricing data exported to Prometheus through the /metrics endpoint, with documented handling for sharded, high-availability Prometheus.
  • AI inference cost tracking for vLLM-based deployments such as llm-d: cost per million input and output tokens, KV cache-corrected pricing, shared infrastructure attribution, REST APIs, and Prometheus metrics.
  • Carbon cost reporting for cloud resources and ingestion of external costs such as Datadog through OpenCost Plugins.
  • An MCP (Model Context Protocol) server on port 8081 that is disabled by default and must be explicitly enabled, plus access paths through Cost APIs, the kubectl cost CLI, and the user interface.

Who uses it and how

  • Platform engineering and FinOps teams running Kubernetes clusters shared by several applications, teams, or departments that need allocation split by namespace, controller, or service.
  • Organizations whose spend spans AWS, Azure, and GCP and that need one view of all cloud services next to their cluster allocation.
  • On-premises operators with no cloud billing API, who supply rates through custom CSV pricing.
  • Teams running vLLM-based inference on llm-d or compatible stacks, tracking cost per million tokens and attributing shared inference infrastructure.
  • Prometheus-heavy environments, including sharded high-availability setups pointed at a global query endpoint such as Thanos Query, Cortex, or Mimir.

Getting started

OpenCost is installed and managed through the official Helm chart only, and the standalone Kubernetes manifest files have been removed. On any Kubernetes 1.20+ cluster, run helm repo add opencost https://opencost.github.io/opencost-helm-chart, then helm repo update, then helm install opencost opencost/opencost.

How it compares

The provided facts list no set of paid products that OpenCost replaces, so the comparison stays with what is named. Kubecost is the originator rather than a peer: OpenCost was originally developed and open sourced by Kubecost, and Datadog appears only as an external cost source ingested through OpenCost Plugins, not as a competing tool. On the axes the facts support, OpenCost is a free and open source distribution under Apache-2.0 that carries an OpenSSF Best Practices badge for project 6219.

When to use it — and when not to

A self-hoster must operate a Kubernetes 1.20+ cluster with Helm and must have Prometheus available for the /metrics export, and sharded HA Prometheus setups need PROMETHEUS_SERVER_ENDPOINT pointed at a global query endpoint or exports may be incomplete or intermittent; no database, object storage, or SMTP dependency is named in the facts. Teams without Kubernetes, or those wanting a fully managed hosted service rather than a chart they run themselves, should look elsewhere. The project shows 306 open issues, the MCP server is opt-in and disabled by default, and the supplied README excerpt is truncated mid-sentence, so some feature detail in it is unverified.

project readme (upstream, from github) — read inline

License OpenSSF Best Practices Gurubase

OpenCost — your favorite open source cost monitoring tool for Kubernetes and cloud spend

OpenCost give teams visibility into current and historical Kubernetes and cloud spend and resource allocation. These models provide cost transparency in Kubernetes environments that support multiple applications, teams, departments, etc. It also provides visibility into the cloud costs across multiple providers.

OpenCost was originally developed and open sourced by Kubecost. This project combines a specification as well as a Golang implementation of these detailed requirements. The web UI is available in the opencost/opencost-ui repository.

OpenCost UI Walkthrough OpenCost UI Walkthrough

To see the full functionality of OpenCost you can view OpenCost features. Here is a summary of features enabled:

  • Real-time cost allocation by Kubernetes cluster, node, namespace, controller kind, controller, service, or pod
  • Multi-cloud cost monitoring for all cloud services on AWS, Azure, GCP
  • Dynamic on-demand k8s asset pricing enabled by integrations with AWS, Azure, and GCP billing APIs
  • Supports on-prem k8s clusters with custom CSV pricing
  • Allocation for in-cluster K8s resources like CPU, GPU, memory, and persistent volumes
  • Easily export pricing data to Prometheus with /metrics endpoint (learn more)
  • Carbon costs for cloud resources
  • MCP support
  • AI inference cost tracking for vLLM-based deployments (llm-d and compatible): cost per million tokens (input/output), KV cache-corrected pricing, shared infrastructure attribution, REST APIs and Prometheus metrics
  • Support for external costs like Datadog through OpenCost Plugins
  • Free and open source distribution (Apache2 license)

Getting Started

OpenCost is now installed and managed via the official Helm chart only.

Quick install on any Kubernetes 1.20+ cluster:

helm repo add opencost https://opencost.github.io/opencost-helm-chart
helm repo update
helm install opencost opencost/opencost

Note: The standalone Kubernetes manifest files have been removed. Please use Helm for all installations and upgrades. See the Helm installation docs for details and configuration.

Note for sharded Prometheus users: If you run Prometheus in a sharded (HA) setup, set PROMETHEUS_SERVER_ENDPOINT to a global query endpoint (e.g., Thanos Query, Cortex, or Mimir). Pointing to a single Prometheus pod may result in incomplete or intermittent export results. See the Prometheus integration docs for details.

Usage

MCP Server

The OpenCost MCP (Model Context Protocol) server provides AI agents with access to cost allocation and asset data through a standardized interface. The MCP server is disabled by default (opt-in) in all OpenCost deployments, runs on port 8081, and is built into the Helm chart for easy production deployment. Users have full control to enable it or configure custom ports and settings.

Features

  • Opt-in by Default: MCP server is disabled by default to minimize the attack surface and must be explicitly enabled
  • Full User Control: Easy to enable or configure port and settings
  • Allocation Queries: Retrieve cost allocation data with filtering and aggregation
  • Asset Queries: Access detailed asset information including nodes, disks, load balancers, and more
  • Cloud Cost Queries: Query cloud cost data with provider, service, and region filtering
  • HTTP Transport: Uses HTTP for reliable communication with MCP clients
  • Simple Configuration: Easy to enable using standard environment variables
  • Helm Integration: Built into the official Helm chart for production deployments

Quick Start

Using Tilt (Development)
# Clone and start OpenCost with MCP server
# You may also need to clone opencost-ui and opencost-helm-charts repositories
# Make sure the cloned repositories are in the same parent tree as opencost

git clone https://github.com/opencost/opencost.git
cd opencost
tilt up
Default Configurations

The UI and Prometheus both run on port 9090. You may need to port-forward to a non-default port to access both them at the same time.

Tilt configuration notes (cloud costs):

OpenCost's Tilt values (tilt-values.yaml) include extra environment variables to enable Cloud Cost ingestion in dev:

# tilt-values.yaml (excerpt)
opencost:
  exporter:
    extraEnv:
      CLOUD_COST_ENABLED: "true"
      CLOUD_COST_CONFIG_PATH: "/var/cloud-integration/cloud-integration.json"
  • Set CLOUD_COST_ENABLED to "true" to turn on cloud cost ingestion.
  • Point CLOUD_COST_CONFIG_PATH to the mounted cloud integration file used by Tilt (e.g., /var/cloud-integration/cloud-integration.json).
  • Adjust other values in tilt-values.yaml as needed during development.
Using Helm (Production)
# Add the OpenCost Helm repository
helm repo add opencost https://opencost.github.io/opencost-helm-chart
helm repo update

# Deploy OpenCost with MCP server enabled (opt-in)
helm install opencost opencost/opencost --set opencost.mcp.enabled=true

# Access MCP server via port forwarding (example)
kubectl port-forward svc/opencost 8081:8081

The MCP server is disabled by default in the Helm chart. For custom configuration:

# Deploy with MCP server enabled
helm install opencost opencost/opencost \
  --set opencost.mcp.enabled=true

# Deploy with custom MCP port
helm install opencost opencost/opencost \
  --set opencost.mcp.port=9091

# Deploy with debug logging
helm install opencost opencost/opencost \
  --set opencost.mcp.extraEnv.MCP_LOG_LEVEL=debug
Configuration Summary
Configuration Command Description
Default helm install opencost opencost/opencost MCP disabled by default
Enable --set opencost.mcp.enabled=true Enable MCP server on port 8081
Custom Port --set opencost.mcp.port=9091 Use different port
Debug Mode --set opencost.mcp.extraEnv.MCP_LOG_LEVEL=debug Enable debug logging

MCP Client Configuration

Configure your MCP client (e.g., Cursor) to connect to the OpenCost MCP server:

Default configuration (port 8081):

{
  "mcpServers": {
    "opencost": {
      "type": "http",
      "url": "http://localhost:8081"
    }
  }
}

Custom port configuration:

{
  "mcpServers": {
    "opencost": {
      "type": "http",
      "url": "http://localhost:9091"
    }
  }
}

For Kubernetes deployments:

{
  "mcpServers": {
    "opencost": {
      "type": "http",
      "url": "http://opencost.opencost.svc.cluster.local:8081"
    }
  }
}

For external access (with LoadBalancer/Ingress):

{
  "mcpServers": {
    "opencost": {
      "type": "http",
      "url": "http://your-opencost-domain.com:8081"
    }
  }
}

Available MCP Tools

The MCP server provides these tools for AI agents:

get_allocation_costs

Retrieve cost allocation data with filtering and aggregation.

Parameters:

  • window (required): Time window (e.g., "7d", "1h", "30m")
  • aggregate (optional): Aggregation properties (e.g., "namespace", "pod", "node")
  • step (optional): Resolution step size
  • accumulate (optional): Whether to accumulate over time
  • share_idle (optional): Whether to share idle costs
  • include_idle (optional): Whether to include idle resources
get_asset_costs

Retrieve asset cost data including nodes, disks, load balancers, and more.

Parameters:

  • window (required): Time window (e.g., "7d", "1h", "30m")
get_cloud_costs

Retrieve cloud cost data with provider, service, and region filtering.

Parameters:

  • window (required): Time window (e.g., "7d", "1h", "30m")
  • aggregate (optional): Aggregation properties (e.g., "provider", "service", "region")
  • accumulate

readme truncated — read the full docs on github

Frequently asked questions

Is opencost free to use?

opencost is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does opencost do?

Cost monitoring for Kubernetes workloads and cloud costs

What is opencost written in?

opencost is primarily written in Go. Its source is publicly available at https://github.com/opencost/opencost, and it has 6,749 GitHub stars.