---
title: "Preflight a media upload"
method: POST
path: "/uploads"
tags: ["Uploads"]
---

# Preflight a media upload

`POST /uploads`

Reserves transcription credits before creating any storage upload. The declared
duration determines the initial reservation; the server measures the uploaded
media before transcription and reconciles the final cost. Files may be at most
3 GB (3,000,000,000 bytes).

End-to-end local-file flow:
1. Create an upload with `POST /uploads`.
2. For each numbered file part, request a signed URL from
   `POST /uploads/{id}/parts`, then `PUT` that part directly to the returned
   S3 URL and retain its `ETag` response header.
3. Submit the ordered part numbers and ETags to
   `POST /uploads/{id}/complete`.
4. Poll `GET /uploads/{id}`. If it returns `awaiting_credits`, add credits
   and call `POST /uploads/{id}/resume`. When it returns `completed`, fetch
   the returned `transcriptionUrl`.

The Media Caption API key must not be sent to the signed S3 part URL.

## Request body

- UploadRequest
  - `filename` string, required
  - `contentType` string, required — An audio/* or video/* media type.
  - `sizeBytes` integer, required
  - `durationSec` integer, required — Client-measured duration used for the pre-upload credit reservation.

## Response `201`

Credit reservation and multipart upload created

- UploadCreatedResponse
  - `id` string, required
  - `status` 'uploading', required
  - `requiredCredits` integer, required
  - `minPartSizeBytes` integer, required
  - `partUrl` string, required
  - `completeUrl` string, required
  - `statusUrl` string, required
  - `expiresAt` string, date-time, required

## Other responses

- `400` — Invalid request
- `401` — Missing or invalid API key
- `402` — Not enough credits to start processing
- `413` — File exceeds the 3 GB limit
- `429` — Rate limit exceeded
- `500` — Internal server error

---

[API](https://skmtc.dev/mediacaption/apis/media-caption-public-api.md) · [All operations](https://skmtc.dev/mediacaption/apis/media-caption-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mediacaption/media-caption-public-api/revisions/fff36efa50d3/schema)
