Cheap, fast & reliable video infrastructure.

Upload a video and get back an adaptive stream up to 4K, an MP4, a poster and a hosted player. Uploading and encoding are free.

Bring your agent.

Add your app's secret key to your project and paste one prompt. Your agent reads the API docs, wires up uploads and playback, and keeps the key on the server.

Paste this into your agentWorks in Claude Code, Codex, Cursor and any coding agent that can work in your project.

Set up Cap Infra in this project so it can upload and play video.

Cap Infra is Cap's video and speech API. All you need is the app's secret key and the REST API. Read https://cap.so/openapi.json and https://cap.so/docs/api/rest-api first. Use only the methods and paths documented there, and take every field name from the OpenAPI document.

1. Find the secret key. I created the app in the Cap Infra console and put its secret key (csk_) in this project's local environment file as CAP_SECRET_KEY. Check that the variable is set without printing its value, and that the file is ignored by git. If it is missing, stop and ask me to add it to the file. Never ask me to paste the key into the chat, and never print, log or commit it.
2. Keep the key on the server. Send it only from server code, as Authorization: Bearer followed by the key. It never goes into browser code, a client bundle or a public environment variable.
3. Create uploads on the server. For a signed-in user, call POST /api/developer/v1/uploads and give the browser only what it returns for that one video: the upload token (cut_), the video id and the embed URL. In production, set corsOrigin to the site's origin.
4. Upload from the browser. With the upload token as the Bearer credential, call POST /api/developer/sdk/v1/upload/multipart/initiate, then POST /api/developer/sdk/v1/upload/multipart/presign-part with up to 50 part numbers in one request. PUT each part to its signed URL and keep the ETag it answers with, then call POST /api/developer/sdk/v1/upload/multipart/complete. If a call answers 401 with the code upload_token_expired, get a new token from the server with POST /api/developer/v1/uploads/{id}/token and continue with the same uploadId and ETags.
5. Wait until it plays. From the server, poll GET /api/developer/v1/videos/{id}/status every 3 seconds. Stop when status is ready or errored, and show errorReason if it failed.
6. Play it. Show the video with its embedUrl, or build a player from hlsUrl and mp4Url in GET /api/developer/v1/videos/{id}. Use hlsUrl when it is present and mp4Url otherwise. shareUrl is the link to send to someone. Video that viewers stream is billed per delivered minute.
7. Transcribe when I ask. Transcripts are billed per audio hour, so confirm with me first. For a public URL call POST /api/developer/v1/transcripts. For a file call POST /api/developer/v1/transcripts/uploads, PUT the file to the signed URL it returns, then call POST /api/developer/v1/transcripts/{id}/start. Poll GET /api/developer/v1/transcripts/{id} every 5 seconds until status is complete or error.
8. Stay inside the limit. A secret key allows 300 requests a minute across every endpoint. After a 429, wait for the number of seconds in the Retry-After header before you send the request again.
9. Watch the credits. GET /api/developer/v1/usage shows the balance and whether uploads are allowed. A 402 means the app needs credit, so tell me and I will add it in the console.
10. Use the MCP server if you want tools. Cap Infra has a hosted MCP server at https://cap.so/api/developer/mcp that takes the same secret key as Authorization: Bearer. Its requests count toward the same limit.

Finish by uploading one short test video through the code you wrote. Ask me first, because stored video is billed one month when it becomes ready, then daily. Then tell me what you changed and give me the video's shareUrl, and ask what I want to build next.

Or link your agent to this page. The prompt is on it.

Read https://cap.so/infra and set up Cap Infra for this project.

Fast to first play.

An hour of 4K is playable in under 5 seconds after its upload finishes.

From upload finished

under5seconds

for 1 hour of 4K to be playable

about2minutes

for 1 hour of 4K to be fully processed

Playback starts while the rest of the ladder encodes. Every rendition up to 4K follows in about 2 minutes.

One upload. Every resolution.

Your server creates an upload and gets a short-lived token. The browser or your server sends the file with it, and Cap encodes it for every screen.

An upload is encoded to renditions from 4K, 1440p, 1080p, 720p, 360p, never above the source resolution.
Adaptive HLS
Up to five renditions from 360p to 4K, never above the source.
MP4
One file for downloads and as a fallback.
Poster
A frame from the video to show before playback.
Hosted player
A link to a player page, ready when the video is created.
Iframe embed
The same player for your own pages.

curl

curl -X POST https://cap.so/api/developer/v1/uploads \
  -H "Authorization: Bearer csk_your_secret_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "User Recording", "userId": "user_42", "corsOrigin": "https://app.example.com"}'

curl https://cap.so/api/developer/v1/videos/abc123def456/status \
  -H "Authorization: Bearer csk_your_secret_key_here"

When it is ready

{
  "data": {
    "id": "abc123def456",
    "externalUserId": "user_42",
    "duration": 124.5,
    "durationSeconds": 124.5,
    "width": 1920,
    "height": 1080,
    "transcriptionStatus": null,
    "ready": true,
    "status": "ready",
    "errorReason": null,
    "playbackId": "Zk3vQ9s2Lm8Rt1Xy7Bc4Df6G",
    "renditions": [
      { "name": "1080p", "width": 1920, "height": 1080, "bitrate": 3565000, "bytes": 55480000, "codecs": "avc1.640028,mp4a.40.2" },
      { "name": "720p", "width": 1280, "height": 720, "bitrate": 1161000, "bytes": 18070000, "codecs": "avc1.64001f,mp4a.40.2" },
      { "name": "360p", "width": 640, "height": 360, "bitrate": 261000, "bytes": 4060000, "codecs": "avc1.64001e,mp4a.40.2" }
    ],
    "takenDown": false,
    "hlsUrl": "https://cap.so/api/developer/playback/Zk3vQ9s2Lm8Rt1Xy7Bc4Df6G/master.m3u8",
    "mp4Url": "https://cap.so/api/developer/playback/Zk3vQ9s2Lm8Rt1Xy7Bc4Df6G/video.mp4",
    "posterUrl": "https://cap.so/api/developer/playback/Zk3vQ9s2Lm8Rt1Xy7Bc4Df6G/poster.jpg",
    "outputs": { "hls": "ready", "mp4": "ready" }
  }
}

Between the two requests, the file is sent in parts with the upload token. See Multipart Upload in the docs.

Transcribe audio or video.

Send a public URL or upload an audio or video file and get text back, with word and segment timings. No video hosting needed.

$0.10 per audio hour.

curl

curl -X POST https://cap.so/api/developer/v1/transcripts \
  -H "Authorization: Bearer csk_your_secret_key_here" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: standup-2026-11-11" \
  -d '{"url": "https://example.com/standup.mp3"}'

Play it anywhere.

A ready video has an HLS URL, an MP4 URL and a poster that work in any player. One of the two can still be encoding when the video becomes ready, so play whichever is present. Or use the hosted player link or the iframe embed and build nothing.

The embed takes autoplay, muted, loop, start time and controls as query parameters.

<iframe
  src="https://cap.so/dev/Zk3vQ9s2Lm8Rt1Xy7Bc4Df6G/embed"
  title="Product Demo"
  style="width: 100%; aspect-ratio: 16 / 9; border: 0"
  allow="autoplay"
  allowfullscreen
  loading="lazy"
></iframe>

Pay for minutes, not plans.

Three things are charged: stored video, delivered video and speech to text. Uploading and encoding are free. Credits are prepaid.

Cap Infra prices by resolution
Meter1080p1440p4K
Uploading and encodingat every resolutionFree
Storageper 1,000 minutes, per month$0.85$1.45$2.80
Deliveryper 1,000 delivered minutesat every resolution$0.95
Playera hosted page and an iframe embedIncluded

Each video is charged one month of storage when it first becomes ready, then daily once that month is over. Uploading and encoding are free. A video is billed by its length and resolution tier. Videos are encoded up to 1080p by default, and 1440p and 4K are set per upload.

A delivered minute is a minute of video your viewers' players download. Delivered minutes are the media seconds in the video bytes we actually send, counting part of a segment in proportion; transfers the viewer abandons part-way aren't counted. For HLS it counts the exact seconds of the segments served, from each segment's EXTINF duration and EXT-X-BYTERANGE range. For MP4 downloads it counts the bytes served divided by the file's average bytes per second. Playlists, posters, HEAD requests, responses other than 200 or 206 and empty responses are never counted. Delivery is billed per delivered minute and charged once a day from the app's balance, when the day's figures become final. The player is included: the hosted page and the iframe embed have no separate fee. The video it streams counts as delivery. Delivery is billed from 14 November 2026. Earlier days are not charged.

Speech to text
$0.10 per audio hour

Estimate your bill.

Resolution

Sets the storage rate

Resolution to estimate

$0.85 per 1,000 minutes, per month

min
min

$0.10 per hour of audio

hr

Estimated month

$33.25

Storage
$4.25
Delivery
$19.00
Speech to text
$10.00
Uploading and encoding
Free
Start building

$5 of credit every month with Cap Pro.

Cap Pro includes $5 of Cap Infra credit every month. Claim it from an app's Billing page and your usage is drawn from it.

What $5 covers at 1080pEither one, every month
minutes stored for 30 days
5,800
hours transcribed
50

Worked out from the prices above and rounded down.

Questions

The full reference is in the docs.

What does Cap Infra charge for?

Three things: stored video, delivered video and speech to text. Each video is charged one month of storage when it first becomes ready, then daily once that month is over. Uploading and encoding are free. Delivery is billed per delivered minute and charged once a day from the app's balance, when the day's figures become final. The player is included: the hosted page and the iframe embed have no separate fee. The video it streams counts as delivery.

What is a delivered minute?

A delivered minute is a minute of video your viewers' players download. Delivered minutes are the media seconds in the video bytes we actually send, counting part of a segment in proportion; transfers the viewer abandons part-way aren't counted. For HLS it counts the exact seconds of the segments served, from each segment's EXTINF duration and EXT-X-BYTERANGE range. For MP4 downloads it counts the bytes served divided by the file's average bytes per second. Playlists, posters, HEAD requests, responses other than 200 or 206 and empty responses are never counted. Delivery is one flat rate at every resolution.

How does resolution change the price?

Storage is priced per 1,000 minutes a month by resolution tier: $0.85 up to 1080p, $1.45 at 1440p and $2.80 at 4K. One month is charged when a video first becomes ready, then it is charged daily once that month is over. A video is billed at the lower of its source resolution and the tier it was created with. The default tier is 1080p, and 1440p and 4K are set per upload. Delivery is one flat rate at every resolution.

How do I pay?

With prepaid credits. Each app has its own balance, and auto top-up can add credit from a saved card when the balance runs low. There are no seats and no plans. Cap Pro includes $5 of credit every month.

Do I have to use the Cap player?

No. A ready video has an HLS URL and an MP4 URL that need no API key and work in any player. One can still be encoding when the video becomes ready, so play whichever is present. The hosted player is there when you want a link or an iframe embed with nothing to build.

Can I use the speech API without hosting my video on Cap?

Yes. Send a public URL or upload an audio or video file and get a transcript back, at $0.10 per hour of audio. Uploaded videos are not transcribed automatically.

How do I know when a video is ready?

Check the video's status from your server every 3 seconds until it is ready or errored. A video is ready as soon as its first output can be played, and the other output follows.

How do API keys work?

Each app has a secret key that stays on your server. Your server creates an upload and gives the browser a short-lived upload token that works for that one video.

Is Cap Infra compliant for sensitive video?

Cap is SOC 2 Type II, ISO 27001 and HIPAA compliant, and a BAA is available. Cap is open source.

Cheap, fast & reliable video infrastructure.

SOC 2 Type II, ISO 27001 and HIPAA compliant. BAA available. Open source.