$ man json-yaml
/json-yaml(1)
PRICE / CALL
$0.002
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
mediakitCATEGORY
uncategorized
STATUS
● live
NAME
json-yaml — json ↔ yaml bidirectional converter
SYNOPSIS
POST https://x402.org/v1/json-yaml
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
JSON ↔ YAML bidirectional converter. Auto-detects input format. Pure parse, no upstream API.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| input | string | JSON or YAML text. | 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.org/v1/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 once claude mcp add x402 --command "npx x402-deployer-mcp" # then ask Claude Code: # "use the json-yaml tool to ..."
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.002 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 | Excel (.xlsx / .xls) → CSV / TSV / JSON converter. | $0.005 |
| excel-to-google-sheets | Convert Excel to Google Sheets / XLSX to Google Sheets / spreadsheet import / Numbers to Google Sheets / Excel to gsheet. | $0.005 |
| html-to-markdown | HTML → Markdown converter. | $0.005 |
| pdf-compress | PDF compressor / shrink PDF / PDF size reducer / smaller PDF for email. | $0.005 |
| xlsx-to-csv | Excel to CSV / XLSX to CSV / Numbers to CSV / spreadsheet to CSV. | $0.005 |
| audio-transcribe | Audio transcribe / speech-to-text / Whisper-large / multi-language ASR / OpenAI Whisper API compat. | $0.01 |
SEE ALSO