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

  1. 01

    Run it

    Node.js 20 or later. No install, no account, nothing sent anywhere.

  2. 02

    Read the verdict

    block, review or safe, then each change with the reason and a fix.

  3. 03

    Use the exit code

    0 below --fail-on, 1 at or above it, 2 if the check couldn't run. An error is never "safe".

terminaloutput for the repo's example (examples/request.json)
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

OptionWhat 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.
--jsonPrint the full result as JSON, the same shape as the hosted API.
--fail-on block|reviewExit 1 when the verdict reaches this level. Default: block.
breakra mcpStart the MCP server (stdio).
breakra --versionPrint 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

VerdictWhenSuggested bump
blockA breaking change: one that breaks every caller of it, such as a removed operation.major
reviewChanges 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)
safeOnly 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.

.github/workflows/api-contract.ymlpermissions: pull-requests: write, for the comment
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

verdict
block · review · safe, with suggested_version_bump and the overall compatibility
summary
Counts per class: breaking, potentially breaking, unknown, compatible, documentation only (non_contract)
changes[]
Each change: rule, compatibility, operation, location, reason, recommended_action and the evidence (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

More: Benchmark · Security · Changelog · Report a wrong finding.