# StableTube API Base URL: `https://stabletube.dev` YouTube downloads as an x402 API. POST a YouTube URL, get back a direct `*.googlevideo.com` CDN download URL. The URL is short-lived (~6 hours). There is no history, no SIWX, no free re-resolve — if the URL expires, repay. ## Workflow ``` 1. Optional: GET /api/info?url=... # free metadata + available qualities 2. POST /api/download # paid; returns direct downloadUrl 3. Consume downloadUrl within ~6h # plain HTTP GET / curl ``` ## Endpoints - `GET /api/info?url=...` — free. Title, duration, channel, thumbnails, `availableQualities`. - `POST /api/download` — paid. Body: `url`, `quality` (`360p` | `720p` | `1080p`, default `720p`), `format` (`mp4`). Returns `downloadUrl`, `mimeType`, `contentLengthBytes`, `expiresAt`. ## Quality fallback If the requested `quality` isn't available for that video, the closest lower quality is returned and reflected in the response `quality` field. If no mp4 stream exists at all, the call aborts with 404 inside the `.paid()` pricing function — you are not charged. ## Pricing Floor $0.02. flat per-quality: 360p $0.02 / 720p $0.04 / 1080p $0.08. See `/openapi.json` for full request/response schemas.