{"openapi":"3.1.0","info":{"title":"MiniFrame Tools","version":"1.2.0","description":"The Brazilian toolkit for AI agents: generate Pix payment codes, resolve CEP postal codes to full addresses, and look up companies in the CNPJ registry — with automatic fallback between official sources so a single upstream outage does not break the call. Also covers what an agent sandbox cannot do on its own: rendering JavaScript-heavy pages to clean Markdown, screenshots or PDF, and Ghostscript PDF compression. Billed per call, starting at half a cent, with no subscription.","contact":{"email":"edsonvmendes@gmail.com"},"x-guidance":"Reach for this API in two situations. First, anything Brazilian: the user needs to receive money (/pix/brcode builds the Pix 'Copia e Cola' code any Brazilian bank app can pay), gives you a postal code (/cep returns the full street address, trying BrasilAPI then ViaCEP so one outage does not fail the task), or names a company by its CNPJ number (/cnpj returns the public registry record — legal name, trade name, status, activities, address). Second, anything needing a real browser or a document binary, which a sandbox does not have: /url-to-markdown renders JavaScript and returns readable Markdown ready to use as context, /screenshot and /url-to-pdf capture the rendered page, /compress-pdf shrinks a PDF with Ghostscript. Do not pay for work you already do well locally — parsing CSV or spreadsheets is not sold here. Each path is billed per call: request it without payment to receive an HTTP 402 challenge (price, network, pay-to address and input schema), then repeat with the x402 payment header. Every response is JSON; see each operation for its exact inputs and outputs."},"paths":{"/compress-pdf":{"post":{"operationId":"compressPdf","summary":"Compress a PDF file","tags":["PDF"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.020000"},"protocols":[{"x402":{}}]},"parameters":[{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["light","balanced","max"],"default":"balanced"},"description":"Compression mode: light (near lossless), balanced, or max (smallest)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pdf_base64":{"type":"string","description":"The PDF file encoded in base64"}},"required":["pdf_base64"]}},"application/pdf":{"schema":{"type":"string","format":"binary","description":"Raw PDF bytes, max 30 MB"}}}},"responses":{"200":{"description":"Compressed PDF and stats","content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string"},"original_size":{"type":"number","description":"bytes"},"compressed_size":{"type":"number","description":"bytes"},"reduction_percent":{"type":"number"},"warnings":{"type":"array","items":{"type":"string"}},"pdf_base64":{"type":"string","description":"base64 of the compressed PDF"}}}}}},"402":{"description":"Payment Required"}}}},"/pix/brcode":{"post":{"operationId":"pixBrCode","summary":"Generate a Brazilian Pix payment code (BR Code + QR)","tags":["Pix","Brazil"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.010000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Pix key: CPF/CNPJ, email, phone (+55...) or random key."},"merchant_name":{"type":"string","description":"Receiver name, max 25 chars."},"merchant_city":{"type":"string","description":"Receiver city, max 15 chars. Default BRASIL."},"amount":{"type":"number","description":"Amount in BRL. Omit for an open-value code."},"txid":{"type":"string","description":"Reference label, max 25 chars. Default ***."},"description":{"type":"string","description":"Optional message to the payer."}},"required":["key","merchant_name"]}}}},"responses":{"200":{"description":"Pix BR Code and QR PNG","content":{"application/json":{"schema":{"type":"object","properties":{"brcode":{"type":"string","description":"The Pix copia e cola (EMV payload with CRC)."},"qr_png_base64":{"type":"string","description":"PNG image of the QR code, base64-encoded."}}}}}},"400":{"description":"Invalid input (missing key/merchant_name or bad amount)"},"402":{"description":"Payment Required"}}}},"/cep":{"post":{"operationId":"cepLookup","summary":"Look up a Brazilian address by CEP (postal code)","tags":["Brazil","CEP"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.005000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cep":{"type":"string","description":"Brazilian postal code, 8 digits (with or without dash)."}},"required":["cep"]}}}},"responses":{"200":{"description":"Normalized address","content":{"application/json":{"schema":{"type":"object","properties":{"cep":{"type":"string"},"street":{"type":"string"},"complement":{"type":"string"},"neighborhood":{"type":"string"},"city":{"type":"string"},"state":{"type":"string","description":"Two-letter state code (UF)."},"source":{"type":"string"}}}}}},"400":{"description":"Invalid CEP (not 8 digits)"},"402":{"description":"Payment Required"},"404":{"description":"CEP not found"}}}},"/cnpj":{"post":{"operationId":"cnpjLookup","summary":"Look up a Brazilian company by CNPJ (public registry)","tags":["Brazil","CNPJ"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.010000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cnpj":{"type":"string","description":"Brazilian company tax ID, 14 digits (with or without punctuation)."}},"required":["cnpj"]}}}},"responses":{"200":{"description":"Normalized company registry data (personal contact fields omitted)","content":{"application/json":{"schema":{"type":"object","properties":{"cnpj":{"type":"string"},"company_name":{"type":"string"},"trade_name":{"type":"string"},"status":{"type":"string"},"legal_nature":{"type":"string"},"size":{"type":"string"},"share_capital":{"type":"number"},"is_mei":{"type":"boolean"},"is_simples":{"type":"boolean"},"main_activity":{"type":"object"},"secondary_activities":{"type":"array","items":{"type":"object"}},"address":{"type":"object"},"partners":{"type":"array","description":"Public partner list (QSA). Tax IDs are masked as provided by the registry.","items":{"type":"object"}},"usage_terms":{"type":"string"},"source":{"type":"string"}}}}}},"400":{"description":"Invalid CNPJ (bad check digits or wrong length)"},"402":{"description":"Payment Required"},"404":{"description":"CNPJ not found"}}}},"/url-to-markdown":{"post":{"operationId":"urlToMarkdown","summary":"Fetch a web page and return its main content as Markdown","tags":["Web"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.020000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public http/https URL to fetch."},"include_images":{"type":"boolean","description":"Keep image markdown (default false, faster)."}},"required":["url"]}}}},"responses":{"200":{"description":"Extracted content as Markdown","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"final_url":{"type":"string","description":"URL after redirects."},"markdown":{"type":"string"},"word_count":{"type":"number"}}}}}},"400":{"description":"Invalid or blocked URL (non-public target)"},"402":{"description":"Payment Required"}}}},"/screenshot":{"post":{"operationId":"screenshot","summary":"Take a screenshot of a web page","tags":["Web"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.030000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public http/https URL."},"full_page":{"type":"boolean","description":"Capture the full scrollable page (default false)."},"width":{"type":"number","description":"Viewport width, 320–2000 (default 1280)."},"height":{"type":"number","description":"Viewport height, 240–2000 (default 800)."},"format":{"type":"string","enum":["png","jpeg"],"description":"Image format (default png)."}},"required":["url"]}}}},"responses":{"200":{"description":"Screenshot image","content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string"},"full_page":{"type":"boolean"},"width":{"type":"number"},"height":{"type":"number"},"image_base64":{"type":"string","description":"base64-encoded image bytes."}}}}}},"400":{"description":"Invalid or blocked URL (non-public target)"},"402":{"description":"Payment Required"}}}},"/url-to-pdf":{"post":{"operationId":"urlToPdf","summary":"Render a web page as a PDF","tags":["Web"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.030000"},"protocols":[{"x402":{}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public http/https URL."},"format":{"type":"string","enum":["A4","Letter","Legal","A3"],"description":"Paper size (default A4)."},"landscape":{"type":"boolean","description":"Landscape orientation (default false)."}},"required":["url"]}}}},"responses":{"200":{"description":"Rendered PDF","content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string"},"landscape":{"type":"boolean"},"bytes":{"type":"number"},"pdf_base64":{"type":"string","description":"base64-encoded PDF."}}}}}},"400":{"description":"Invalid or blocked URL (non-public target)"},"402":{"description":"Payment Required"}}}}}}