Agent Utilities
← API contracts

contracts.openapi-diff · v1.0.0

OpenAPI Diff
for your agent.

Detect selected direct breaking changes between OpenAPI 3.0 documents.

$0.0008 / call800 micro-dollar credits
131,072 bytes max input65,536 bytes max output
Works on supplied inputNo external network fetch

Example input

{
  "before": {
    "openapi": "3.0.3",
    "info": {
      "title": "Demo",
      "version": "1"
    },
    "paths": {
      "/hello": {
        "get": {
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      }
    }
  },
  "after": {
    "openapi": "3.0.3",
    "info": {
      "title": "Demo",
      "version": "1"
    },
    "paths": {}
  }
}

Example output

{
  "changes": [
    {
      "path": "GET /hello",
      "kind": "operation-removed"
    }
  ],
  "breakingChangesDetected": true,
  "scope": "Direct operation removals, new required parameters/body and parameter primitive type changes only; references and response/schema compatibility are not compared."
}

Generated from the actual handler using this example input; this is a preview, not a paid API call. Paid responses wrap the result with a receipt and recovery expiry.

Call it from your agent

Add credits in the workspace and keep your API key in private environment storage. Use the same request ID and exact body to recover a lost response within ten minutes.

// Node.js 22+. Read the key from your private environment.
const requestId = Date.now() + '_' + crypto.randomUUID();
const response = await fetch('https://agent-utilities.agent-utilities.workers.dev/v1/tools/contracts.openapi-diff', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ' + process.env.AGENT_UTILITIES_API_KEY,
    'Idempotency-Key': requestId
  },
  body: JSON.stringify({
  "before": {
    "openapi": "3.0.3",
    "info": {
      "title": "Demo",
      "version": "1"
    },
    "paths": {
      "/hello": {
        "get": {
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      }
    }
  },
  "after": {
    "openapi": "3.0.3",
    "info": {
      "title": "Demo",
      "version": "1"
    },
    "paths": {}
  }
})
});
const data = await response.json();
if (!response.ok) throw new Error(data.error?.message ?? 'Request failed');
console.log(data);
// On response loss, retry this SAME requestId, tool and body.
// Do not rerun the line that generates requestId for a retry.
Input JSON Schema
{
  "type": "object",
  "properties": {
    "before": {
      "type": "object"
    },
    "after": {
      "type": "object"
    }
  },
  "required": [
    "before",
    "after"
  ],
  "additionalProperties": false
}
Output JSON Schema
{
  "type": "object",
  "properties": {
    "changes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "kind"
        ],
        "additionalProperties": false
      }
    },
    "breakingChangesDetected": {
      "type": "boolean"
    },
    "scope": {
      "type": "string"
    }
  },
  "required": [
    "changes",
    "breakingChangesDetected",
    "scope"
  ],
  "additionalProperties": false
}

Before you integrate

Prices are experimental. The service currently allows 1,000 new calls per day across all accounts. Failed operations return reserved credits. Successful results are encrypted for ten-minute retry recovery. Review data handling and service limits.

Related tools

contracts $0.0005 / call

OpenAPI Lint

Validate OpenAPI 3.0 JSON structure and internal references.

contracts.openapi-lint

contracts $0.0003 / call

JSON Schema Validate

Validate data using a bounded JSON Schema 2020-12 subset.

contracts.jsonschema-validate