OpenAPI Validation
Validate an OpenAPI 3.x specification: required fields, endpoint definitions and schema references.
Pay by wallet (x402)
openapi-validate Example
Example answer
{
"valid": true,
"errors": [],
"warnings": [
{
"path": "/servers",
"message": "No 'servers' defined — consumers won't know the base URL"
}
],
"error_count": 0,
"schema_count": 0,
"warning_count": 1,
"endpoint_count": 0,
"version_detected": "3.0.0"
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
spec | any | Yes | OpenAPI spec as JSON string or object |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
valid | boolean | Always (present in every successful answer) |
errors | array | Always (present in every successful answer) |
warnings | array | Always (present in every successful answer) |
error_count | integer | Always (present in every successful answer) |
schema_count | integer | Always (present in every successful answer) |
warning_count | integer | Always (present in every successful answer) |
endpoint_count | integer | Always (present in every successful answer) |
version_detected | string | Always (present in every successful answer) |
How to call it
The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.
# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
-H "Authorization: Bearer $STRALE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"capability_slug": "openapi-validate",
"inputs": {
"spec": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"Test API\",\"version\":\"1.0\"},\"paths\":{}}"
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "openapi-validate",
"inputs": {
"spec": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"Test API\",\"version\":\"1.0\"},\"paths\":{}}"
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "openapi-validate",
inputs: {
"spec": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"Test API\",\"version\":\"1.0\"},\"paths\":{}}"
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="openapi-validate",
inputs={
"spec": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"Test API\",\"version\":\"1.0\"},\"paths\":{}}",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/openapi-validate?spec=%7B%22openapi%22%3A%223.0.0%22%2C%22info%22%3A%7B%22title%22%3A%22Test+API%22%2C%22version%22%3A%221.0%22%7D%2C%22paths%22%3A%7B%7D%7D' Limitations
Custom OpenAPI extensions are not checked
Validates against OpenAPI 3.0/3.1 specification — custom extensions and vendor-specific annotations are not checked
What to do instead: For vendor extensions (x- prefixed), add your own validation rules in a post-processing step
Bundled checks that include it
- API Quality Check €0.50
Related tools
- Agent Trace Analysis €0.20
- API Docs Generator €0.20
- API Mock Responses €0.05
- Changelog Generator €0.03
- Code Converter €0.05
- Commit Message Generator €0.05