# JSON/YAML Format Converter

> JSON/YAML Format Converter is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Converts input data between JSON and YAML formats, returning the converted payload and format metadata

## Facts

- Endpoint: POST https://payai.agentstools.dev/convert
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-yaml-format-converter-c1e19894
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fX3sWs_XE5bd-EungldsT

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 json-yaml-format-converter-c1e19894 -d '<json body>'
```

Example prompt: Convert this JSON object to YAML for me: {"name": "Alice", "age": 30, "roles": ["admin", "user"]}

## When to prefer this

Use this endpoint when an agent needs a quick, reliable, stateless JSON↔YAML conversion without setting up a local parser — especially in workflows where config files, infrastructure-as-code, or API payloads need to be reformatted on the fly.

## Known failure modes

- Invalid or malformed JSON input causes parse error
- Invalid or malformed YAML input causes parse error
- Unsupported source/target format combination returns error
- Empty payload returns validation error

## How this service works

Pure-compute data format conversion (no network): JSON<->CSV, JSON<->YAML, JSON normalize/minify, Markdown->HTML (sanitized), HTML->Markdown/text, base64/hex, TOML->JSON. Operates only on the supplied data.

## Output

Returns the converted payload in the target format (JSON or YAML) along with basic metadata describing the source and target formats used in the conversion.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "enum": [
    "base64",
    "csv",
    "hex",
    "html",
    "json",
    "markdown",
    "text",
    "toml",
    "yaml"
   ],
   "type": "string",
   "description": "Target format"
  },
  "data": {
   "type": "string",
   "description": "The data to convert (the source document as a string)"
  },
  "from": {
   "enum": [
    "base64",
    "csv",
    "hex",
    "html",
    "json",
    "markdown",
    "text",
    "toml",
    "yaml"
   ],
   "type": "string",
   "description": "Source format"
  },
  "options": {
   "type": "object",
   "description": "Per-conversion options, e.g. {minify, sort_keys, indent, delimiter}"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-yaml-format-converter-c1e19894/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
