# 402utils YAML↔JSON Converter

> 402utils YAML↔JSON Converter is a paid API for AI agents from 402utils.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Converts between YAML and JSON bidirectionally: parses YAML documents into JSON or renders JSON values as clean block-style YAML

## Facts

- Endpoint: POST https://402utils.com/v1/yaml?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/402utils-yaml-json-converter-0fcd175c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tsvcvOdmoZbGaque_R-eV

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 402utils-yaml-json-converter-0fcd175c -d '<json body>'
```

Example prompt: Convert this docker-compose YAML to JSON for me: 'version: "3" services: web: image: nginx ports: ["80:80"]' — parse it to JSON.

## When to prefer this

Use this endpoint when you need a hardened, safe YAML↔JSON conversion that explicitly rejects dangerous tags and alias bombs — ideal for processing untrusted config files like docker-compose, Kubernetes manifests, CI pipeline files, or Helm charts. Prefer this over custom parsing code when security (no code execution from tags) and error detail (line/column on failure) matter.

## Known failure modes

- YAML parse error with line/column info returned when input is malformed YAML
- Input exceeds 2 MB UTF-8 limit — request rejected
- Dangerous YAML tags (e.g. !!js/function) rejected by safe core schema
- Alias bomb / deeply nested anchor expansion rejected
- Multiple YAML documents in a single call rejected
- Invalid to enum value returns validation error

## How this service works

Convert between YAML and JSON in one call. to:"json" parses a YAML document (config files, docker-compose, Kubernetes manifests, CI pipelines) into a plain JSON value; to:"yaml" renders any JSON value as clean block-style YAML. Hardened: safe core schema (tags like !!js/function never execute), alias bombs rejected, one document per call, parse errors return line/column. YAML input up to 2 MB UTF-8.

## Output

A JSON value (when to=json) representing the parsed YAML document, or a YAML-formatted string (when to=yaml) rendering the input JSON in clean block style. On parse error, returns the error with line and column number indicating where parsing failed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "enum": [
    "json",
    "yaml"
   ],
   "type": "string",
   "description": "Target format: \"json\" parses YAML text, \"yaml\" emits YAML text."
  },
  "input": {
   "description": "The value to convert. With to:\"json\": a single YAML document as a string, max 2 MB UTF-8. With to:\"yaml\": any JSON value; a string is first parsed as JSON text."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "services": {
    "web": {
     "image": "nginx:1.29",
     "ports": [
      "80:80"
     ]
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-yaml-json-converter-0fcd175c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
