# agent402.tools OpenAPI Diff

> agent402.tools OpenAPI Diff is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Compares two OpenAPI 3.x or Swagger 2.x documents and returns a structured diff of added, removed, and changed endpoints with a breaking-change flag.

## Facts

- Endpoint: POST https://agent402.tools/api/openapi-diff
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-openapi-diff-991d01a7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_If41xhL2SEuI13-dcpAvg

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 agent402-tools-openapi-diff-991d01a7 -d '<json body>'
```

Example prompt: Can you compare these two OpenAPI specs and tell me what changed — specifically whether any endpoints were removed or required parameters were dropped? Here's the old spec and the new spec.

## When to prefer this

Use this endpoint when you need a programmatic, structured breakdown of API changes between two versions — especially when you need a reliable breaking-change signal. Prefer this over manual diffing or generic text comparison when the inputs are valid OpenAPI/Swagger documents and you need machine-readable output distinguishing added, removed, and changed endpoints.

## Known failure modes

- Invalid JSON or non-OpenAPI document provided — parse error returned
- Missing 'before' or 'after' field — validation error
- Malformed Swagger 2.x or OpenAPI 3.x structure — schema validation failure
- Payment not attached or insufficient — 402 Payment Required
- Network timeout on large spec documents

## How this service works

Compare two OpenAPI 3.x or Swagger 2.x documents and return a structured diff: added / removed / changed endpoints, with a conservative "is any change breaking?" flag. Breaking = an endpoint or required-2xx status was removed, a required parameter was added, an optional param became required, a param type changed, or a JSON body field became required. Pure CPU - deterministic, no network, no $ref dereferencing (resolve refs upstream if needed).

## Output

A structured JSON diff listing added endpoints, removed endpoints, and changed endpoints between the two API specs, plus a boolean 'is breaking?' flag set to true if any endpoint or required 2xx status was removed or a required parameter was dropped.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "after": {
   "description": "OpenAPI/Swagger document (object or JSON string) for the new version"
  },
  "before": {
   "description": "OpenAPI/Swagger document (object or JSON string) for the previous version"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "added": [
   "POST /admin"
  ],
  "changed": [],
  "removed": [
   "GET /legacy"
  ],
  "summary": {
   "added": 1,
   "changed": 0,
   "removed": 1
  },
  "breaking": true,
  "breakingCount": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-openapi-diff-991d01a7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
