{"info":{"description":"Pay-per-call image and PDF processing for AI agents. Payment: x402 (USDC on Base + Solana). See /v1/discovery for per-endpoint prices and payment details.","title":"Pixo Agent API","version":"0.1.0"},"openapi":"3.0.3","paths":{"/v1/image/compress":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"colors":{"description":"PNG only, default 256","maximum":256,"minimum":2,"type":"integer"},"file":{"description":"JPEG, PNG, or WebP","format":"binary","type":"string"},"format":{"description":"Target format; defaults to the input format","enum":["jpeg","png","webp"],"type":"string"},"quality":{"description":"JPEG/WebP only, default 90","maximum":100,"minimum":1,"type":"integer"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The compressed image"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Compress or convert an image"}},"/v1/image/crop":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"colors":{"description":"PNG only, default 256","maximum":256,"minimum":2,"type":"integer"},"file":{"format":"binary","type":"string"},"format":{"enum":["jpeg","png","webp"],"type":"string"},"height":{"type":"integer"},"quality":{"description":"JPEG/WebP only, default 90","maximum":100,"minimum":1,"type":"integer"},"width":{"type":"integer"},"x":{"default":0,"type":"integer"},"y":{"default":0,"type":"integer"}},"required":["file","width","height"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The cropped image"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Crop an image to an exact rectangle"}},"/v1/image/flip":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"colors":{"description":"PNG only, default 256","maximum":256,"minimum":2,"type":"integer"},"direction":{"enum":["horizontal","vertical"],"type":"string"},"file":{"format":"binary","type":"string"},"format":{"enum":["jpeg","png","webp"],"type":"string"},"quality":{"description":"JPEG/WebP only, default 90","maximum":100,"minimum":1,"type":"integer"}},"required":["file","direction"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The flipped image"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Mirror an image horizontally or vertically"}},"/v1/image/ocr":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"JPEG, PNG, or WebP (GIF is not accepted for OCR)","format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"JSON: { text: <recognized text> }"},"402":{"description":"Payment required (x402)"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"503":{"description":"Not enabled on this deployment (no Gemini API key)"}},"summary":"Extract text from an image via Google Gemini (content leaves the server)"}},"/v1/image/resize":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"colors":{"description":"PNG only, default 256","maximum":256,"minimum":2,"type":"integer"},"file":{"format":"binary","type":"string"},"fit":{"default":"contain","enum":["contain","cover","fill"],"type":"string"},"format":{"description":"Target format; defaults to the input format","enum":["jpeg","png","webp"],"type":"string"},"height":{"type":"integer"},"quality":{"description":"JPEG/WebP only, default 90","maximum":100,"minimum":1,"type":"integer"},"width":{"type":"integer"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The resized image"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Resize an image; optionally convert format/quality in the same call"}},"/v1/image/rotate":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"angle":{"enum":[90,180,270],"type":"integer"},"colors":{"description":"PNG only, default 256","maximum":256,"minimum":2,"type":"integer"},"file":{"format":"binary","type":"string"},"format":{"enum":["jpeg","png","webp"],"type":"string"},"quality":{"description":"JPEG/WebP only, default 90","maximum":100,"minimum":1,"type":"integer"}},"required":["file","angle"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The rotated image"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Rotate an image clockwise by 90, 180, or 270 degrees"}},"/v1/pdf/compress":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"level":{"default":"balanced","enum":["lossless","balanced","max"],"type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The compressed PDF"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Compress a PDF"}},"/v1/pdf/extract":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"JSON: { text, pageCount, likelyScanned } — likelyScanned=true means there is no text layer; use /v1/pdf/ocr instead"},"402":{"description":"Payment required (x402)"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"503":{"description":"Not enabled on this deployment (no Gemini API key)"}},"summary":"Extract plain text from a PDF (private, in-process)"}},"/v1/pdf/from-markdown":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"UTF-8 Markdown, max 1 MB","format":"binary","type":"string"},"title":{"description":"Optional PDF document title (metadata)","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The typeset PDF"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Convert Markdown to a typeset PDF (in-process, embedded fonts); flat-priced"}},"/v1/pdf/images":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"A ZIP of one PNG per embedded image (422 if the PDF has none)"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Extract embedded raster images from a PDF as a ZIP of PNGs (private, in-process)"}},"/v1/pdf/markdown":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"text/markdown":{"schema":{"type":"string"}}},"description":"The document as Markdown"},"402":{"description":"Payment required (x402)"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"}},"summary":"Convert a PDF to Markdown (private, in-process)"}},"/v1/pdf/merge":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"items":{"format":"binary","type":"string"},"maxItems":20,"minItems":2,"type":"array"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The merged PDF"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Merge 2-20 PDFs in the order provided"}},"/v1/pdf/merge-compress":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"items":{"format":"binary","type":"string"},"maxItems":20,"minItems":2,"type":"array"},"level":{"default":"balanced","enum":["lossless","balanced","max"],"type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The merged and compressed PDF"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Merge 2-20 PDFs and compress the result in one call (bundle rate)"}},"/v1/pdf/ocr":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"PDF up to 30 pages","format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"JSON: { text: <recognized text> }"},"402":{"description":"Payment required (x402)"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"503":{"description":"Not enabled on this deployment (no Gemini API key)"}},"summary":"OCR a scanned PDF via Google Gemini (content leaves the server)","x-max-pages":30}},"/v1/pdf/pages":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"pages":{"description":"qpdf page range, e.g. \"1,3-5,z\" (z = last page); at least one of pages/rotate is required","type":"string"},"rotate":{"description":"Clockwise rotation applied to the output pages","enum":[90,180,270],"type":"integer"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The recomposed PDF"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Select/reorder/delete PDF pages and/or rotate them"}},"/v1/pdf/protect":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"password":{"description":"1-256 chars; used as both user and owner password","type":"string"}},"required":["file","password"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The encrypted PDF"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Password-protect a PDF (AES-256)"}},"/v1/pdf/render":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"dpi":{"default":150,"description":"Render resolution","maximum":300,"minimum":36,"type":"integer"},"file":{"format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"A ZIP of one PNG per page (page-NNNN.png, page order)"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Rasterize PDF pages to PNG images, returned as a ZIP","x-max-pages":50}},"/v1/pdf/split":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"ranges":{"description":"Comma-separated qpdf-syntax ranges, e.g. \"1-3,4-6,7-z\"","type":"string"}},"required":["file","ranges"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"A ZIP of one PDF per range"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Split a PDF into page ranges, returned as a ZIP"}},"/v1/pdf/structured":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"PDF up to 30 pages","format":"binary","type":"string"},"schema":{"description":"A JSON Schema (as a string, max 16 KB) describing the object to extract","type":"string"}},"required":["file","schema"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"JSON: { data: <object matching your schema> }"},"402":{"description":"Payment required (x402)"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"503":{"description":"Not enabled on this deployment (no Gemini API key)"}},"summary":"Extract schema-shaped JSON from a PDF (Google Gemini — content leaves the server)","x-max-pages":30}},"/v1/pdf/tables":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"description":"PDF up to 30 pages","format":"binary","type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"JSON: { tables: [{ page, title, headers, rows }] }"},"402":{"description":"Payment required (x402)"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"503":{"description":"Not enabled on this deployment (no Gemini API key)"}},"summary":"Extract tables from a PDF as JSON (Google Gemini — content leaves the server)","x-max-pages":30}},"/v1/pdf/unlock":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"password":{"type":"string"}},"required":["file","password"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/octet-stream":{"schema":{"format":"binary","type":"string"}}},"description":"The decrypted PDF"},"402":{"description":"Payment required (x402) — response body carries the accepted chains, payTo, and exact USDC amount"},"413":{"description":"Payload too large"},"422":{"description":"Unsupported or corrupt input"},"501":{"description":"Not yet implemented (e.g. GIF)"}},"summary":"Remove a PDF's password (requires the current password); flat-priced"}}},"x-x402-status":"enabled"}