# JSON ↔ YAML Converter (x402-deployer)

> JSON ↔ YAML Converter (x402-deployer) is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-16).

Auto-detects and converts between JSON and YAML formats with configurable pretty-print and indentation, requiring no external API calls.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/json-yaml
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-6b173c0f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KTsemAtSTiy8mASjZoJzV

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 x402-deployer-x402-deployer-workers-dev-6b173c0f -d '<json body>'
```

Example prompt: Convert this JSON config to YAML with 2-space indentation: {"name":"my-app","replicas":3,"image":"nginx:latest"}

## When to prefer this

Use this endpoint when you need a fast, deterministic, no-dependency JSON↔YAML conversion with no external API calls — ideal for config file translation, Helm values prep, Kubernetes manifest conversion, or GitHub Actions YAML workflows where round-trip fidelity and zero latency matter.

## Known failure modes

- Invalid JSON or YAML input returns a parse error
- Unrecognized target format returns a bad request error
- Empty body returns an error indicating no input was provided
- Malformed indentation parameter may fall back to default

## How this service works

JSON to YAML and YAML to JSON converter / format transcoder / config-file translator / Helm values prepper / Kubernetes manifest converter / GitHub Actions workflow YAML helper / round-trip parser. Auto-detects input format from the first non-whitespace byte ('{'/'[' = JSON, otherwise YAML), parses, and re-serialises in the requested target format. Pretty-print and indent are configurable. Pure parse — no upstream API call, deterministic output.

## Output

The serialized output in the requested target format (JSON or YAML), pretty-printed and indented as configured, with no side effects or external calls.

## Example request

```json
{
 "input": "{\"name\":\"test-app\",\"version\":\"1.0.0\",\"replicas\":2}",
 "indentation": 2,
 "prettyPrint": true,
 "targetFormat": "yaml"
}
```

## 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": {
     "required": [
      "input"
     ],
     "properties": {
      "to": {
       "enum": [
        "json",
        "yaml",
        "auto"
       ],
       "type": "string",
       "description": "Target format. 'auto' converts to the opposite of the detected input. Default 'auto'."
      },
      "input": {
       "type": "string",
       "description": "JSON or YAML source text. Format is auto-detected when 'to' is 'auto' or omitted."
      },
      "indent": {
       "type": "number",
       "description": "Indent width in spaces (1-8). Default 2."
      },
      "pretty": {
       "type": "boolean",
       "description": "Pretty-print JSON output (2-space indent by default). Ignored when target is YAML. Default true."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "output": {
       "type": "string"
      },
      "parsed": {
       "type": "object",
       "properties": {
        "age": {
         "type": "integer"
        },
        "name": {
         "type": "string"
        }
       }
      },
      "target": {
       "type": "string"
      },
      "output_chars": {
       "type": "integer"
      },
      "detected_format": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-6b173c0f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
