# OpenAPI Payload Validator

> OpenAPI Payload Validator is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Validates a JSON payload against the request or response schema for a specific operation in an OpenAPI 3.x or Swagger 2.x specification

## Facts

- Endpoint: POST https://agent402.tools/api/openapi-validate-payload
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openapi-payload-validator-1f9200d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_V-zu04JYEubFGYAyJbENn

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability openapi-payload-validator-1f9200d2 -d '<json body>'
```

Example prompt: Can you validate this JSON payload against the request schema for the 'createUser' operation in my OpenAPI spec? Here's the spec and the payload I want to check — let me know if it's valid or what errors it has.

## When to prefer this

Use this endpoint when you need to programmatically validate a JSON payload against a specific OpenAPI 3.x or Swagger 2.x operation schema — either request body or response body — without running the actual API. Ideal for pre-flight request validation, CI/CD pipeline checks, contract testing, or debugging schema mismatches. Prefer this over generic JSON Schema validators when the schema is embedded in an OpenAPI spec and you want to leverage the spec's full operation context including operationId lookup.

## Known failure modes

- Invalid or unparseable OpenAPI/Swagger spec document — returns error indicating spec is malformed
- operationId not found in spec — returns error that the operation could not be located
- Neither operationId nor method+path provided — returns error that operation cannot be identified
- Invalid value for 'part' field (not 'request' or 'response') — returns validation or parse error
- No matching schema found for the given status code in response validation — may default or error
- Malformed payload JSON — returns parse error
- Spec references external $refs that cannot be resolved — may return incomplete validation or error

## How this service works

Validate a JSON payload against the request or response schema for one operation in an OpenAPI 3.x or Swagger 2.x spec. Locate the operation by operationId or method+path; choose `part: "request"` or `part: "response"` (status defaults to the first 2xx). Deterministic subset of JSON Schema: type, required, enum, properties, items, additionalProperties:false, oneOf/anyOf/allOf, $ref-detection (not dereferenced).

## Output

A validation result indicating whether the provided JSON payload conforms to the request or response schema for the specified API operation, including any schema validation errors or constraint violations found.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "part": {
   "description": "Schema to validate against: \"request\" or \"response\""
  },
  "path": {
   "description": "Path template (use with `method` if no operationId)"
  },
  "spec": {
   "description": "OpenAPI/Swagger document (object or JSON string)"
  },
  "method": {
   "description": "HTTP method (use with `path` if no operationId)"
  },
  "status": {
   "description": "Response status when part=\"response\" (defaults to first 2xx)"
  },
  "payload": {
   "description": "JSON value to validate"
  },
  "operationId": {
   "description": "operationId to validate against (preferred)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": false,
  "errors": [
   {
    "path": "",
    "rule": "required",
    "message": "missing required field: email"
   },
   {
    "path": ".age",
    "rule": "type",
    "message": "expected integer, got string"
   },
   {
    "path": ".extra",
    "rule": "additionalProperties",
    "message": "unexpected property: extra"
   }
  ],
  "schemaPresent": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openapi-payload-validator-1f9200d2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
