# PayAI Infrastructure Cost Diff Estimator

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

Estimates the monthly cost delta of an infrastructure change by comparing a baseline and proposed config (or Terraform plan), returning before/after totals, per-resource line items, FinOps findings, and a budget verdict.

## Facts

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

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 payai-infrastructure-cost-diff-estimator-0c65c256 -d '<json body>'
```

Example prompt: Before I apply this Terraform plan, estimate the monthly cost delta — here are the resource changes adding two m5.xlarge EC2 instances and removing one t3.medium — and tell me if it passes my $500/month budget threshold.

## When to prefer this

Choose this endpoint when you need a pre-flight cost impact analysis of an infrastructure change before applying it, especially in CI/CD pipelines where automated budget gating (pass/caution/block) is needed. Prefer this over generic cloud pricing calculators when you have a Terraform plan diff or explicit before/after resource configs and need FinOps-aware per-resource line items rather than manual price lookups. Best suited for AWS and Azure common resources.

## Known failure modes

- Unsupported resource types (non-AWS/Azure or niche services) may be omitted from estimates
- Incomplete or malformed Terraform plan JSON may cause parsing errors
- Missing baseline config when no Terraform plan is provided results in incomplete delta
- Reserved instance or savings plan discounts not accounted for, leading to overstated costs
- Rate limit or payment failure (x402) if USDC balance is insufficient

## 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 a structured cost comparison including: total monthly cost before the change, total monthly cost after, the net monthly delta (positive or negative), per-resource line items categorized as added, removed, or modified, FinOps findings highlighting potential waste or misconfigurations, and a budget verdict of pass, caution, or block. This is a cost estimate, not an actual bill.

## 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/payai-infrastructure-cost-diff-estimator-0c65c256/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
