# TradepilotUSA JSON Validate & Format

> TradepilotUSA JSON Validate & Format is a paid API for AI agents from www.tradepilotusa.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-02).

Validates whether a JSON string is well-formed and returns a pretty-printed, formatted version along with its root type

## Facts

- Endpoint: POST https://www.tradepilotusa.com/api/agent-commerce/v1/services/json_validate_format/execute?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tradepilotusa-json-validate-format-5fbe3f77
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UKDUxm_gtAYRc-HItU2cE

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 tradepilotusa-json-validate-format-5fbe3f77 -d '<json body>'
```

Example prompt: Can you check if this JSON is valid and format it nicely for me: '{"name":"Example","active":true,"count":5}'?

## When to prefer this

Choose this endpoint when you need a fast, deterministic, server-side JSON validation and formatting step — especially useful when you cannot trust client-side parsing, need an audit trail of provenance, or want to normalize JSON before storing or displaying it. Its deterministic local execution (no model, no network) makes it reliable and predictable compared to LLM-based JSON repair tools.

## Known failure modes

- Input JSON string exceeds 48,000 character limit — request rejected
- Malformed input: 'valid' returns false with no formatted output
- Missing or empty 'json' field in request body — validation error
- Payment failure via x402 protocol — 402 response returned before execution

## How this service works

Validate JSON and return two-space formatting. Rejects duplicate object keys, excessive nesting and numbers that cannot be represented without changing their decimal value. No JSON Schema evaluation or remote reference fetching.

## Output

Returns a JSON object with a 'result' field containing: a boolean 'valid' indicating whether the input is well-formed JSON, a 'formatted' string with the pretty-printed JSON (indented), and a 'root_type' string indicating the top-level type (e.g. 'object', 'array'). Also includes a 'utility' identifier, a 'provenance' block confirming deterministic local execution with no model or network calls, and a 'request_id'.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "json": {
   "type": "string",
   "maxLength": 48000
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "valid": true,
   "formatted": "{\n  \"name\": \"Example\",\n  \"active\": true\n}",
   "root_type": "object"
  },
  "utility": "json_validate_format",
  "provenance": {
   "execution": "deterministic_local",
   "model_used": false,
   "network_request_performed": false
  },
  "request_id": "example_json_validate_format"
 }
}
```

## More

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