{"openapi":"3.0.3","info":{"title":"zero-gif","version":"0.1.0","description":"Frame-sampling and gif-clip extraction for video URLs. Lets agents 'watch' a video (sample) and then ask for a specific moment (clip)."},"servers":[{"url":"https://zero-gif-zeroclick.vercel.app"}],"paths":{"/v1/sample":{"post":{"operationId":"post__v1_sample","summary":"Extract evenly-spaced frames from a video URL so your own multimodal model can 'watch' it. Body: { video_url, fps?: 1 (max 4), max_frames?: 60 (max 100), width?: 384 (max 768) }. Returns { frames: [{ url, t_seconds, index }], video_duration }. REQUIRED: video_url must be a direct .mp4/.webm/.mov/.mkv file URL — YouTube/Vimeo/Reddit/X page URLs and HLS .m3u8 streams do NOT work; pre-resolve with yt-dlp or use Wikimedia Commons / Internet Archive / Pexels which serve direct files. BEHAVIOR: samples evenly across the WHOLE video, no start/end window. For a long video where you only care about a specific moment, do one wide sample (max_frames 24-30) to localize the moment, then optionally a denser sample (max_frames 100, fps 4) to zoom in. TIMESTAMPS: each frame's t_seconds is in the JSON response, not burned into the image — read the JSON, do not OCR. LIMITS: source ≤ 10 min, ≤ 500 MB. Effective fps is capped to max_frames/duration so you never get more than max_frames frames.","x-payment-info":{"method":"x402","currency":"USDC","amount":"0.01","sku":"vidclip:sample:v1","pricingVersion":2},"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Successful response after payment","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"$ref":"#/components/schemas/PaymentRequired"}}}},"/v1/clip":{"post":{"operationId":"post__v1_clip","summary":"Render a [start_seconds, end_seconds] range of a video URL as a gif (two-pass palette). Body: { video_url, start_seconds, end_seconds, width?: 360 (max 720), fps?: 12 (max 30) }. Returns { gif_url, start, end, duration, size_bytes }. REQUIRED: video_url must be a direct .mp4/.webm/.mov/.mkv URL — YouTube/Vimeo/Reddit/X page URLs and HLS .m3u8 streams do NOT work. RECOMMENDED: keep clips 1-5 seconds and aim for ≤ 10 MB output. Size scales with width × fps × duration. SIZE CHEATSHEET (5s clip): live-action @ 360/12 ≈ 6 MB; live-action @ 480/15 ≈ 14 MB; b/w cartoon or line-art @ 360/12 ≈ 22 MB (cartoons compress poorly — drop to 240/10 to land near 10 MB). LIMITS: source ≤ 10 min / 500 MB; output clip ≤ 30 s. Use /v1/probe (free) first to confirm the source loads.","x-payment-info":{"method":"x402","currency":"USDC","amount":"0.02","sku":"vidclip:clip:v1","pricingVersion":2},"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Successful response after payment","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"$ref":"#/components/schemas/PaymentRequired"}}}},"/openapi.json":{"get":{"operationId":"get__openapi_json","summary":"OpenAPI 3.0 discovery document.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/healthz":{"get":{"operationId":"get__healthz","summary":"Liveness probe — verifies ffmpeg binary and Blob token.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/probe":{"post":{"operationId":"post__v1_probe","summary":"Free metadata probe. Body: { video_url }. Returns { duration_seconds, fps, width, height, codec, size_bytes }. Use this first to confirm the source loads and to plan sampling without paying. REQUIRED: video_url must be a direct .mp4/.webm/.mov/.mkv file URL — YouTube/Vimeo/Reddit/X page URLs and HLS .m3u8 streams do NOT work; pre-resolve with yt-dlp or pull from Wikimedia Commons / Internet Archive / Pexels which serve direct files.","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"PaymentRequired":{"type":"object","description":"x402/MPP 402 advertisement. Decode the PAYMENT-REQUIRED or WWW-Authenticate header for payment requirements.","properties":{"error":{"type":"string"}}}}}}