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 — FreeQuick 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
| Field | Type | Required | Description |
|---|---|---|---|
| base | string | Yes | URL or inline spec (base version) |
| head | string | Yes | URL or inline spec (new version) |
| format | string | No | "json" (default) or "markdown" |
Authentication
Bearer token via Authorization header. Get your key at app.coderifts.com/api/signup.
Rate Limits
| Plan | Requests / Month | Price |
|---|---|---|
| Free | 50 | $0 |
| Pro | 1,000 | $49/mo |
| Enterprise | Unlimited | Contact 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.