# JSON Validate/Format

> JSON Validate/Format is a paid API for AI agents from conclavex402p04.pythonanywhere.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-14).

Validates, pretty-prints (0–8 spaces), or minifies a JSON payload in a single call.

## Facts

- Endpoint: POST https://conclavex402p04.pythonanywhere.com/u/json?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-validate-format-223f8431
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ucw1T8rrhdbEsZe5S3Bfu

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 json-validate-format-223f8431 -d '<json body>'
```

Example prompt: Can you check if this JSON is valid and pretty-print it with 2-space indentation: {"name":"Alice","age":30,"active":true}?

## When to prefer this

Choose this endpoint when you need a quick, paid-per-call JSON validation or formatting step in an automated pipeline — especially in x402-enabled agent workflows where you want a lightweight, stateless check without spinning up a local parser. Useful for verifying third-party payloads, normalizing JSON before storage, or compacting JSON for transmission.

## Known failure modes

- Invalid or malformed JSON input returns valid=false with no formatted output
- Unsupported indentation level outside 0–8 range may return an error
- Empty or missing body field causes a 400-level error
- Non-JSON body type in the wrapper envelope causes schema validation failure

## How this service works

Validate, pretty-print (0-8 spaces), or minify JSON — json formatter/validator.

## Output

Returns a JSON object with a `valid` boolean indicating whether the input is valid JSON, and a `formatted` string containing the pretty-printed or minified result depending on the requested operation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object"
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "valid": true,
  "formatted": "{\n  \"a\": 1\n}"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-validate-format-223f8431/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from conclavex402p04.pythonanywhere.com](https://www.zero.xyz/host/conclavex402p04.pythonanywhere.com/llms.txt)
