StableTube API

StableTube resolves a YouTube URL to mp4 via x402. /api/download creates a paid server-side download job. StableTube downloads the video, uploads it to S3, and returns a temporary StableTube-owned URL when it is ready.

Endpoints

Pricing

TierMax outputUSD
tube-100mb100 MB$0.05
tube-500mb500 MB$0.10
tube-1gb1 GB$0.20

tiered by maximum output size: tube-100mb $0.05 / tube-500mb $0.10 / tube-1gb $0.20.

Quality and tier

The client chooses the exact output quality. If the requested quality is not available before payment, the call aborts with 404 and you are not charged. The client also chooses a byte-size tier; Modal stops the download if the final mp4 exceeds that tier.

Delivery

StableTube never returns upstream YouTube or *.googlevideo.com URLs, and the API does not stream video bytes through Vercel. When a job is complete, download the file directly from the temporary S3 URL before expiresAt. If the URL expires while the object still exists, poll the job again for a fresh URL.

curl -L "$downloadUrl" -o video.mp4

Upstream

Metadata checks use YTStream on RapidAPI and server-side downloads use a Modal worker backed by the upstream download provider. Outage or breakage is represented as a failed job.