# Infrastructure Cost Diff Estimator (Terraform/Config)

> Infrastructure Cost Diff Estimator (Terraform/Config) is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Estimates the monthly cost delta of an infrastructure change by comparing before/after configurations for AWS and Azure resources, returning per-resource line items, FinOps findings, and a budget verdict.

## Facts

- Endpoint: POST https://api.agentstools.dev/cost/diff
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/infrastructure-cost-diff-estimator-terraform-config-5f6f8a4b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KWZ-bdPgdc6B6qfxCKmJU

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability infrastructure-cost-diff-estimator-terraform-config-5f6f8a4b -d '<json body>'
```

Example prompt: Before I run terraform apply, can you estimate the monthly cost impact of this plan? I'm adding two m5.xlarge EC2 instances and a new RDS db.t3.medium on AWS — tell me the before/after totals, the monthly delta, and whether it passes or should be blocked.

## When to prefer this

Use this endpoint when you need a cost impact assessment of an infrastructure change before applying it, especially in CI/CD pipelines or FinOps workflows. It is purpose-built for Terraform plan diffs on AWS and Azure, provides structured per-resource line items and a budget verdict, and is cheaper and faster than spinning up a full cost management platform. Prefer it over generic pricing APIs when you need a delta comparison rather than an absolute price lookup.

## Known failure modes

- Unsupported resource types (non-AWS/Azure or uncommon services) may return null or estimated line items
- Malformed or incomplete Terraform plan JSON results in a 400 validation error
- Missing baseline config when required causes a computation error
- Cost estimates may be inaccurate for reserved instance pricing or spot instances
- Network or timeout errors return a 5xx response

## How this service works

Estimate the monthly cost DELTA of an infrastructure change before you apply it: pass a Terraform plan (its resource changes) or a baseline and a proposed config and get total before, total after, the monthly delta, per-resource added / removed / modified line items, FinOps findings and a budget verdict (pass, caution, block). AWS and Azure common resources. Cost estimate, not a bill.

## Output

Returns total monthly cost before the change, total monthly cost after the change, the net monthly delta, a per-resource breakdown of added/removed/modified line items, FinOps findings (e.g. over-provisioning warnings), and a budget verdict of pass, caution, or block.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "usage": {
   "type": "object",
   "description": "Optional usage hints for usage-based items"
  },
  "format": {
   "enum": [
    "auto",
    "terraform",
    "terraform-plan",
    "cloudformation",
    "docker-compose"
   ],
   "type": "string",
   "description": "Config format for baseline/proposed, or auto"
  },
  "region": {
   "type": "string",
   "description": "Cloud region for pricing (default us-east-1)"
  },
  "baseline": {
   "type": "string",
   "description": "Baseline config text (use with proposed instead of plan_json)"
  },
  "proposed": {
   "type": "string",
   "description": "Proposed config text (use with baseline)"
  },
  "plan_json": {
   "type": "string",
   "description": "A terraform plan JSON with resource_changes (before/after) — the one-file diff input"
  },
  "budget_monthly": {
   "type": "number",
   "description": "Optional monthly USD budget for the verdict"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/infrastructure-cost-diff-estimator-terraform-config-5f6f8a4b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
