Docs
Check an API change in 60 seconds.
Breakra compares two versions of an OpenAPI 3.0 or 3.1 contract and tells you whether the change can break the callers that depend on it. It runs on your machine, in CI, inside your coding agent or as a hosted API. The result is the same everywhere.
Quickstart
- 01
Run it
Node.js 20 or later. No install, no account, nothing sent anywhere.
- 02
Read the verdict
block,revieworsafe, then each change with the reason and a fix. - 03
Use the exit code
0below--fail-on,1at or above it,2if the check couldn't run. An error is never "safe".
npx -y breakra check old.yaml new.yaml
verdict: block (compatibility: breaking, suggested version bump: major)
changes: 15 total, 1 breaking, 10 potentially breaking, 0 unknown, 2 compatible, 2 docs-only
- [breaking] Operation DELETE /orders/{id} was removed. Callers of it will receive errors.
→ Find and replace all calls to DELETE /orders/{id}.
- [potentially_breaking] A new required query parameter `customer_id` was added to GET /orders. …
Compare against your base branch: git show main:openapi.yaml > old.yaml. Pin a version in scripts and CI: npx -y breakra@0.4.1.
CLI options
| Option | What it does |
|---|---|
--use "METHOD /path" | An operation your code calls; repeat it. The result adds an impact verdict for those operations only, plus document-wide changes such as authentication. Path parameter names don't need to match. It filters contract changes by your list; Breakra doesn't read your code. |
--json | Print the full result as JSON, the same shape as the hosted API. |
--fail-on block|review | Exit 1 when the verdict reaches this level. Default: block. |
breakra mcp | Start the MCP server (stdio). |
breakra --version | Print the package, engine and rule set versions. |
# only the endpoints you call
npx -y breakra check old.yaml new.yaml --use "GET /orders/{id}" --use "POST /orders"
# fail on anything that may break callers, for scripts
npx -y breakra check old.yaml new.yaml --fail-on review --json > result.json
Verdicts
| Verdict | When | Suggested bump |
|---|---|---|
| block | A breaking change: one that breaks every caller of it, such as a removed operation. | major |
| review | Changes that can break callers depending on how they use the API (a new required parameter, a removed or no-longer-guaranteed response field, a narrowed enum), or changes the rules can't classify (unknown). | major (conservative) |
| safe | Only compatible or documentation changes, or none. | minor, patch or none |
Every rule is listed in RULES.md. The same inputs always give the same result and analysis_id.
GitHub Action
Checks the contract on every pull request against the base branch, fails the check at review (or block), and keeps one comment with each change and its fix. It runs the free CLI on the runner; nothing is sent to Breakra.
on:
pull_request:
paths: [openapi.yaml]
jobs:
breakra:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: danbuildss/breakra-action@v1.5.0
with:
spec: openapi.yaml
fail-on: review # default; or block
All inputs and outputs: breakra-action README · full workflow: Integrations.
Coding agents (MCP)
The MCP server gives your agent one tool, check_openapi_change, with the same result as the CLI. No key, no wallet.
# Claude Code
claude mcp add --scope user breakra -- npx -y breakra mcp
# any MCP client (e.g. Cursor: ~/.cursor/mcp.json)
{ "mcpServers": { "breakra": { "command": "npx", "args": ["-y", "breakra", "mcp"] } } }
Or give your agent the guide: breakra.dev/skill.md (when to call, how to read results, how to pay safely for hosted checks).
Hosted API (x402)
POST https://breakra.dev/api/analyze with {"before": …, "after": …} (each an OpenAPI document as a JSON object, or JSON/YAML text) and an optional uses list. $0.02 USDC on Base via x402, charged only on a 200; Breakra's own errors are never charged. No account or API key.
Request, response and errors: API reference · openapi.json · skill.md · Pricing.
The result
verdictblock·review·safe, withsuggested_version_bumpand the overallcompatibilitysummary- Counts per class: breaking, potentially breaking, unknown, compatible, documentation only (
non_contract) changes[]- Each change:
rule,compatibility,operation,location,reason,recommended_actionand theevidence(before/after values) impact- With
--use: the verdict and change ids for the operations you listed limitations- What couldn't be checked, such as external
$refs (never fetched) analysis_id- A hash of the engine and rule set versions and both contracts: rerun anywhere and compare
Limits
- OpenAPI 3.0.0–3.0.4 and 3.1.0–3.1.2, as JSON or YAML. Not supported: Swagger 2.0, OpenAPI 3.2, URL inputs.
- Local tools (CLI, MCP, Action): up to 25 MB per file, 20,000 operations and 5,000,000 nodes once
$refs are expanded. GitHub's full REST description checks in about 8 s. - Hosted API: 1 MB request body, nesting depth 64, 5,000 operations, 75,000 nodes after expanding
$refs. - Contracts whose shared schemas expand far beyond that (Stripe's) are refused, with a hint to compare only the paths you use. So is a very large
oneOf/anyOf(over 64 options locally, 24 hosted) whose options are both replaced and added. - External
$refs are never fetched; they're listed inlimitations. InlineoneOf/anyOfvariants are compared by position, so reordering them can be over-reported. - Breakra checks contract compatibility. It isn't a security scanner, and it doesn't read your code.
More: Benchmark · Security · Changelog · Report a wrong finding.