{"openapi":"3.1.0","info":{"title":"svgsmith-x402","description":"Convert raster images (PNG/JPEG/WebP) into clean, editable, self-verified SVG vector art. Built for AI agents: no account, no API key, no subscription.\n\n**Pricing & payment (x402):** `POST /v1/convert` costs **$0.02 USDC on Base** per conversion. Call with no payment to receive **HTTP 402** with a `PAYMENT-REQUIRED` header (base64 JSON challenge). Sign an EIP-3009 `TransferWithAuthorization` for the quoted amount, retry the same request with the signed payload in a `PAYMENT-SIGNATURE` header — the response settles the payment and returns the result. You are only charged when a conversion succeeds.\n\n**Free alternative:** the same engine is an open-source CLI — `pip install svgsmith` (FSL-1.1-MIT).\n\nMore: https://svgsmith.dev · https://svgsmith.dev/llms.txt","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Root  Get"}}}}}}},"/v1/health":{"get":{"summary":"Health","operationId":"health_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health V1 Health Get"}}}}}}},"/v1/convert":{"post":{"summary":"Convert a raster image (PNG/JPEG/WebP) to editable SVG — $0.02 USDC via x402","description":"Convert a raster image to SVG.\n\nTwo interchangeable request shapes (payment is gated identically before the\nbody is read, so an x402 proxy can relay either):\n  * ``multipart/form-data`` — ``file`` upload, options as form fields, returns\n    raw ``image/svg+xml`` (CLI/direct use).\n  * ``application/json`` — ``imageUrl`` or ``imageBase64`` + options, returns\n    ``{\"svg\": ..., \"meta\": {...}}`` (JSON x402 routers like h402).","operationId":"convert_endpoint_v1_convert_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"required":["imageBase64"]},{"required":["imageUrl"]}],"properties":{"imageBase64":{"type":"string"},"imageUrl":{"type":"string"},"mode":{"type":"string","enum":["auto","binary","color","pixel"]},"detail":{"type":"string","enum":["high","normal","clean","poster"]},"transparent_background":{"type":"boolean"},"solid_background":{"type":"boolean"},"background":{"type":"string"},"uniform_outline":{"type":"boolean"}},"type":"object"}},"multipart/form-data":{"schema":{"properties":{"file":{"type":"string","format":"binary"}},"type":"object","required":["file"]}}}},"responses":{"200":{"description":"The converted SVG. JSON requests return {svg, meta}; multipart requests return raw image/svg+xml.","content":{"application/json":{"schema":{},"example":{"svg":"<svg xmlns=...>...</svg>","meta":{"mode":"color","detail":"high","bytes":38563,"similarity":0.97}}}}},"402":{"description":"Payment required (x402). The challenge rides the `PAYMENT-REQUIRED` response header (base64 JSON: amount, asset, payTo, network eip155:8453). Sign an EIP-3009 TransferWithAuthorization and retry with the `PAYMENT-SIGNATURE` request header. You are only charged on success."}}}},"/v1/rasterize":{"post":{"summary":"Rasterize an SVG to PNG — $0.01 USDC via x402","operationId":"rasterize_endpoint_v1_rasterize_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_rasterize_endpoint_v1_rasterize_post"}}},"required":true},"responses":{"200":{"description":"The rendered PNG (image/png).","content":{"application/json":{"schema":{}}}},"402":{"description":"Payment required (x402): challenge in the PAYMENT-REQUIRED header; retry with PAYMENT-SIGNATURE. Charged only on success."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_rasterize_endpoint_v1_rasterize_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height"},"scale":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Scale"},"background":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Background"}},"type":"object","required":["file"],"title":"Body_rasterize_endpoint_v1_rasterize_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}