# JSON to Zod Schema Converter

> JSON to Zod Schema Converter is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054001/call, status unknown (last checked 2026-10-12).

Converts a JSON object or JSON string into a Zod TypeScript validation schema, with automatic detection of emails, URLs, UUIDs, and dates for refined validators.

## Facts

- Endpoint: GET https://api.strale.io/x402/json-to-zod?utm_source=zero.xyz
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-d46a99c0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0k2F--axegQgEg1rX4z_g

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 api-strale-io-d46a99c0
```

Example prompt: Convert this JSON to a Zod schema named UserSchema: {"user":{"id":"550e8400-e29b-41d4-a716-446655440000","email":"test@example.com","createdAt":"2024-01-15T10:30:00Z","website":"https://example.com"}} — make sure it detects the UUID, email, date, and URL automatically.

## When to prefer this

Use this endpoint when you need to quickly scaffold Zod validation schemas from example JSON data, especially when the JSON contains emails, URLs, UUIDs, or dates that benefit from automatic refinement detection. Ideal for TypeScript/Node.js projects that use Zod for runtime validation and want to avoid writing boilerplate schema code by hand.

## Known failure modes

- Missing required 'json' query parameter returns an error
- Invalid or malformed JSON input causes a parsing failure
- Payment not provided results in a 402 Payment Required response with accepted payment details
- Extremely large or deeply nested JSON may be truncated or cause timeout

## How this service works

Convert JSON to Zod validation schemas. Auto-detects emails, URLs, UUIDs, dates for refined validators. Algorithmic.

## Output

Returns a Zod schema as a TypeScript string with refined validators automatically applied for detected email addresses, URLs, UUIDs, and ISO date strings, plus the root schema name.

## Example request

```json
{
 "json": "{\"user\":{\"id\":\"550e8400-e29b-41d4-a716-446655440000\",\"email\":\"test@example.com\",\"createdAt\":\"2024-01-15T10:30:00Z\",\"website\":\"https://example.com\"}}",
 "root_name": "UserSchema"
}
```

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "json"
     ],
     "properties": {
      "json": {
       "description": "JSON string or object"
      },
      "root_name": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-d46a99c0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
