Skip to main content

🚀 Beta: All Pro and Team features are free. Install on GitHub →

REST API

CodeRifts REST API — Integrate Anywhere

Diff OpenAPI specs programmatically from any CI/CD pipeline, pre-commit hook, or custom application. One endpoint, JSON in, JSON out.

Get Your API Key — Free

Quick Start

curl -X POST https://app.coderifts.com/api/diff \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "base": "https://petstore.swagger.io/v2/swagger.json",
    "head": "https://your-api.com/openapi.yaml"
  }'

Specs can be URLs or inline JSON/YAML. See the full API reference for all options.

API Reference

POST /api/diff

Compare two OpenAPI specifications and return a detailed analysis report.

Request Body

FieldTypeRequiredDescription
basestringYesURL or inline spec (base version)
headstringYesURL or inline spec (new version)
formatstringNo"json" (default) or "markdown"

Authentication

Bearer token via Authorization header. Get your key at app.coderifts.com/api/signup.

Rate Limits

PlanRequests / MonthPrice
Free50$0
Pro1,000$49/mo
EnterpriseUnlimitedContact us

See full pricing details.

CI/CD Integration Examples

Use the API in any pipeline. Here are examples for popular CI systems.

GitHub Actions

- name: Check API breaking changes
  run: |
    RESULT=$(curl -s -X POST https://app.coderifts.com/api/diff \
      -H "Authorization: Bearer ${{ secrets.CODERIFTS_API_KEY }}" \
      -H "Content-Type: application/json" \
      -d '{"base": "main:api/openapi.yaml", "head": "api/openapi.yaml"}')
    echo "$RESULT" | jq .summary

GitLab CI

api-contract-check:
  stage: test
  script:
    - |
      curl -sf -X POST https://app.coderifts.com/api/diff \
        -H "Authorization: Bearer $CODERIFTS_API_KEY" \
        -H "Content-Type: application/json" \
        -d "{\"base\": \"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME:api/openapi.yaml\",
             \"head\": \"api/openapi.yaml\"}"

Get your API key — free.

50 requests/month on the free plan. No credit card required.

Prefer a GitHub-native experience? Install the GitHub App instead.