Quick verdict
Choose C3X if you want open-source, self-hostable, fully offline cost estimation without API keys or SaaS lock-in. Choose Infracost if you need enterprise support, OPA/Rego policy integration, or your team is already deep on the Infracost Cloud product.
Feature comparison
| Feature | C3X | Infracost |
|---|---|---|
| License | Apache 2.0 | Apache 2.0 (CLI), proprietary (Cloud) |
| Public pricing API | Free, no API key | Free, requires API key |
| Self-hosted pricing API | Yes (single Docker) | Yes (cloud-pricing-api) |
| Terraform support | Yes | Yes |
| CloudFormation support | Yes (free) | Yes (paid tier) |
| Terragrunt support | Yes | Yes |
| Fully offline mode | Yes | Partial (requires sync) |
| Cost recommendations | Yes (free) | Yes (paid Cloud tier) |
| CI integration | GitHub Actions, GitLab, Bitbucket | Same |
| Atlantis/Spacelift | Yes | Yes |
| OPA/Rego policy | Roadmap | Yes (mature) |
| Enterprise support | Community + commercial partners | Yes (Infracost Cloud) |
| Annual cost (medium team) | $0 | $1,000+/month (Cloud) |
Where Infracost wins
Infracost has been in the market since 2019 and has built up a substantial ecosystem. Areas where it's still the right pick:
- OPA/Rego policy integration: Infracost Cloud's policy engine is mature; rules can block PRs based on complex conditions. C3X has basic budget gating; deeper policy is on the roadmap.
- Dedicated enterprise support: Infracost Cloud includes SLAs, response time guarantees, and dedicated engineers. C3X support is via community and commercial partners.
- Cloud dashboard: Infracost Cloud's dashboard aggregates costs across PRs, repos, and orgs. Useful for FinOps teams that want a central view across many projects.
Where C3X wins
C3X was built differently from the start, optimizing for the most-asked-for things in the original Infracost open-source issues:
- No API key for public endpoint: The pricing API at pricing.c3x.dev is free to use without authentication. Useful for proofs of concept and small teams.
- Free CloudFormation: CloudFormation support is gated behind Infracost's paid tier. In C3X, it's free.
- Free cost recommendations: Recommendations (right-sizing, gp2-to-gp3, etc.) are part of Infracost Cloud (paid). C3X includes them in the OSS CLI.
- Fully offline mode: A single docker-compose spins up the pricing API with no external dependencies after data load. Required for air-gapped environments (GovCloud, IL5/IL6, financial sector).
- No vendor lock-in: Apache 2.0 throughout. The pricing API, CLI, and recommendations are all open. If C3X disappeared tomorrow, your team could continue running from a fork.
Migration: command translation
For most workflows, migration is mechanical. The CLI command structure is similar:
| Infracost | C3X |
|---|---|
| infracost breakdown --path . | c3x estimate --path . |
| infracost diff --path . | c3x estimate --diff |
| infracost configure get api_key | (no key required) |
| infracost generate config | c3x init |
| infracost run --config-file=infracost.yml | c3x estimate --config c3x.yml |
Migration: GitHub Actions
The Infracost GitHub Action and C3X GitHub Action have similar structures. Replacing the action is typically 5-10 lines of YAML:
# Before (Infracost):
- uses: infracost/actions/setup@v3
with:
api-key: ${{ secrets.INFRACOST_API_KEY }}
- run: infracost breakdown --path . --format json --out-file infracost.json
- uses: infracost/actions/comment@v3
with:
path: infracost.json
# After (C3X):
- uses: c3xdev/c3x-action@v1
- run: c3x estimate --diff --format=github-comment > c3x.md
- uses: actions/github-script@v7
with:
script: |
const fs = require('fs')
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: fs.readFileSync('c3x.md', 'utf8')
})Pricing data source
Both tools pull from the same upstream sources but expose different public APIs:
- AWS: Bulk pricing API (offers.api.aws/v1.0)
- Azure: Retail Prices API (prices.azure.com)
- GCP: Cloud Billing Catalog API
C3X's pricing API (pricing.c3x.dev) is free to query without authentication. Infracost's cloud-pricing-api is also self-hostable but the SaaS endpoint requires an API key. For details on running the pricing API yourself, see self-hosting the pricing API on a €4 VPS.
When to keep Infracost
- You've already paid for Infracost Cloud and use OPA/Rego policies that don't have C3X equivalents.
- Your enterprise contract requires named-engineer SLAs with the tool vendor.
- You use Infracost-specific integrations (Atlantis with Infracost policy callbacks, etc.) that haven't been ported.
When to switch to C3X
- You're hitting Infracost's paid feature gates (CloudFormation, recommendations).
- You need fully offline mode for regulated environments.
- Your organization prefers open-source-only infrastructure.
- You want to avoid SaaS lock-in for cost-related tooling.
- Budget is a concern and the free tier doesn't cover your usage.
FAQ
Is C3X really a drop-in replacement for Infracost?
For the most common workflows (Terraform breakdown, diff in PRs, CI integration), yes. The command structure is similar: c3x estimate replaces infracost breakdown, c3x estimate --diff replaces infracost diff. CloudFormation is supported in C3X without paid tier. Some advanced Infracost features (Cloud-managed pricing, advanced policy via OPA/Rego) don't have direct C3X equivalents yet.
What does Infracost do better than C3X?
Infracost has a longer track record (since 2019), a larger community, more mature OPA/Rego policy integration via their Cloud product, and dedicated enterprise support contracts. If you need any of those, Infracost is the right pick.
Why is C3X free when Infracost is paid?
C3X is fully open-source (Apache 2.0) with a self-hostable pricing API. The maintainers fund development via partnerships and consulting, not SaaS subscriptions. Infracost's commercial model funds full-time staff, dedicated enterprise support, and the Cloud product.
Can I migrate from Infracost to C3X gradually?
Yes. Both tools can run side-by-side in CI initially. Compare outputs for accuracy, then switch the gating job from Infracost to C3X once confident. Most teams complete the migration in one sprint.
Does C3X support Infracost's usage file format?
C3X uses c3x-usage.yml with a similar structure to Infracost's usage file. Conversion is mechanical — most usage files are equivalent semantically. Detailed mapping is in the docs.