$ man json-yaml
/json-yaml
PRICE / CALL
$0.005
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
mediakitCATEGORY
uncategorized
STATUS
● live
NAME
json-yaml — converts between json and yaml in either direction
SYNOPSIS
POST https://x402.agentutility.ai/json-yaml
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
Converts between JSON and YAML in either direction. Auto-detects input format from the first non-whitespace byte ('{'/'[' = JSON, otherwise YAML), parses, and re-serializes in the requested target format; pretty-print and indent are configurable. Use it as a format transcoder, config-file translator, Helm values prepper, Kubernetes manifest converter, GitHub Actions workflow YAML helper, or round-trip parser.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| input | string | JSON or YAML source text. Format is auto-detected when 'to' is 'auto' or omitted. | required |
| to | string | Target format. 'auto' converts to the opposite of the detected input. Default 'auto'. enum: json · yaml · auto | optional |
| pretty | boolean | Pretty-print JSON output (2-space indent by default). Ignored when target is YAML. Default true. | optional |
| indent | number | Indent width in spaces (1-8). Default 2. | optional |
OUTPUT — response shape
| field | type | description |
|---|---|---|
| detected_format | string | Input format auto-detected from the payload, either "json" or "yaml". |
| target | string | Output format the input was converted to, the opposite of detected_format ("yaml" or "json"). |
| output | string | Converted payload as a string in the target format, ready to write to a file or pipe downstream. |
EXAMPLES — two ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.agentutility.ai/json-yaml \
-H 'Content-Type: application/json' \
-d '{ }'first response =
402 Payment Required with payment requirements; sign + retry with X-PAYMENT.EXAMPLE 2 · mcp
# Install the MCP package for this endpoint's cluster npx -y @agentutility/mcp-<cluster> # Required: EVM private key with USDC on Base export X402_PRIVATE_KEY=0x... # Then call the json-yaml tool from your MCP-aware agent.
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
- tags
- jsonyamlmediakitformat-conversiondata-transformyaml-to-jsonjson-to-yaml
- methods
- POST
- cluster
- mediakit
- price
- $0.005 USDC per call
ADJACENT — other endpoints in mediakit
| endpoint | description | price |
|---|---|---|
| compress-pdf | PDF compressor / PDF size reducer. | $0.005 |
| convert-html-to-markdown | Convert HTML to Markdown. | $0.005 |
| excel-to-csv | Converts Excel workbooks (.xlsx / .xls) to CSV, TSV, or JSON with multi-sheet handling, returning each sheet by name. | $0.005 |
| excel-to-google-sheets | Converts Excel files for import into Google Sheets. | $0.005 |
| html-markdown | Converts raw HTML or a URL into clean Markdown, preserving headings, lists, tables, code blocks, links, and images. | $0.005 |
| html-to-markdown | Convert HTML to Markdown. | $0.005 |
| pdf-compress | Shrinks PDFs to a smaller size for email or the web, with three quality levels: ebook (lowest, web-quality), printer (medium), prepress (… | $0.005 |
| url-to-markdown | Fetches a public URL, strips boilerplate, and returns clean Markdown plus title and character counts. | $0.005 |
SEE ALSO