# Agent402 UK JSON Format & Validate

> Agent402 UK JSON Format & Validate is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status down (last checked 2026-09-15).

Validates and pretty-prints a JSON string, returning parse errors or a formatted version with configurable indentation

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/json/format
- Price: $0.001/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-json-format-validate-ea964107
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IsXwEZY3lEMqgUhusy4gZ

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 agent402-uk-json-format-validate-ea964107 -d '<json body>'
```

Example prompt: Can you validate and pretty-print this JSON string for me with 2-space indentation: '{"name":"Alice","age":30,"active":true}'? I want to make sure it parses correctly before I use it as a config.

## When to prefer this

Use this endpoint when an agent needs a fast, deterministic, side-effect-free JSON validator with pretty-print output — particularly before writing configs, constructing tool arguments, or storing blobs. Prefer this over LLM-based JSON repair when you need a reliable parse error message to act on, or when you need consistent indentation (0–8 spaces). Not suited for JSON Schema validation against a schema definition (use the sibling JSON Schema validator endpoint for that).

## Known failure modes

- Malformed JSON input returns valid=false with a descriptive parse error message rather than a formatted string
- Indent value outside 0–8 range may be rejected or clamped
- Empty string input likely returns a parse error
- Non-string JSON field (e.g. passing a raw object instead of a string) may cause a schema validation error

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns an object with a 'valid' boolean, the detected JSON 'type', a 'formatted' string (the pretty-printed JSON if valid), and any parse error message if the input is malformed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "json": {
   "type": "string",
   "description": "JSON string"
  },
  "indent": {
   "type": "number",
   "description": "Indent spaces 0-8"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-json-format-validate-ea964107/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
