{"openapi":"3.1.0","info":{"title":"Sinko","version":"1.0.0","description":"Create short links with custom slugs, shorten up to 10 URLs in one payment, and generate downloadable QR codes. Pay with USDC on Base via x402.","x-guidance":"Use a UUID v4 Idempotency-Key for paid requests. On timeout, 429, or 503, retry with the same key, body, and payment signature. Follow Retry-After when present."},"servers":[{"url":"https://sinko.app"}],"paths":{"/v1/qr":{"post":{"summary":"Generate a QR code for 0.01 USDC on Base","description":"Turn an HTTP or HTTPS URL into a downloadable 512 × 512 PNG QR code. The response includes the PNG and an x402 payment receipt.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.01"}},"parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"header","name":"PAYMENT-SIGNATURE","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":2000}}},"example":{"url":"https://sinko.app/x402"}}}},"responses":{"200":{"description":"Downloadable QR code","headers":{"PAYMENT-RESPONSE":{"schema":{"type":"string"}}},"content":{"image/png":{"schema":{"type":"string","format":"binary","contentMediaType":"image/png"}}}},"400":{"description":"Invalid URL or idempotency key"},"402":{"description":"x402 payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"}}}},"409":{"description":"Payment or idempotency conflict"},"413":{"description":"Request body too large"},"429":{"description":"Too many requests. Retry after the indicated number of seconds.","headers":{"Retry-After":{"schema":{"type":"integer"}}}},"503":{"description":"Service unavailable or settlement pending. Retry with the original signed request."}}}},"/v1/slugs/{slug}":{"get":{"summary":"Check whether a custom slug is available","security":[],"parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":64}}],"responses":{"200":{"description":"Current availability","content":{"application/json":{"schema":{"type":"object","required":["available"],"properties":{"available":{"type":"boolean"}}}}}},"400":{"description":"Invalid or reserved slug"},"429":{"description":"Too many requests. Retry after the indicated number of seconds.","headers":{"Retry-After":{"schema":{"type":"integer"}}}},"503":{"description":"Service unavailable"}}}},"/{slug}":{"get":{"summary":"Follow a public short link","security":[],"parameters":[{"in":"path","name":"slug","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":64}}],"responses":{"302":{"description":"Redirect to the destination","headers":{"Location":{"schema":{"type":"string","format":"uri"}}}},"404":{"description":"Short link not found"},"429":{"description":"Too many requests. Retry after the indicated number of seconds.","headers":{"Retry-After":{"schema":{"type":"integer"}}}}}}},"/v1/links":{"post":{"summary":"Create a public short link for 0.05 USDC on Base","description":"Shorten one HTTP or HTTPS URL. Supply a custom slug or let Sinko generate one. The short link redirects publicly after payment settles.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.05"}},"parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"header","name":"PAYMENT-SIGNATURE","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":4096},"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":64}}},"example":{"url":"https://example.com/campaign","slug":"spring-campaign"}}}},"responses":{"201":{"description":"Short links created","headers":{"PAYMENT-RESPONSE":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["short_url"],"properties":{"short_url":{"type":"string","format":"uri"}}}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"}}}},"409":{"description":"Slug, payment, or idempotency conflict"},"413":{"description":"Request body too large"},"429":{"description":"Too many requests. Retry after the indicated number of seconds.","headers":{"Retry-After":{"schema":{"type":"integer"}}}},"503":{"description":"Service unavailable or settlement pending. Retry with the original signed request if signed."}}}},"/v1/links/batch":{"post":{"summary":"Create up to 10 short links in one payment at 0.05 USDC per link","description":"Shorten 1 to 10 URLs in one payment. Each URL can have a custom slug. Results follow input order. Use the same links array for the quote and signed request.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"dynamic","currency":"USD","min":"0.05","max":"0.50"}},"parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"header","name":"PAYMENT-SIGNATURE","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["links"],"properties":{"links":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":4096},"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":64}}}}}},"example":{"links":[{"url":"https://example.com/campaign","slug":"spring-campaign"}]}}}},"responses":{"201":{"description":"Short links created","headers":{"PAYMENT-RESPONSE":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["links"],"properties":{"links":{"type":"array","items":{"type":"object","required":["short_url"],"properties":{"short_url":{"type":"string","format":"uri"}}}}}}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"}}}},"409":{"description":"Slug, payment, or idempotency conflict"},"413":{"description":"Request body too large"},"429":{"description":"Too many requests. Retry after the indicated number of seconds.","headers":{"Retry-After":{"schema":{"type":"integer"}}}},"503":{"description":"Service unavailable or settlement pending. Retry with the original signed request if signed."}}}}}}