PUT the file straight to storage. This keeps large uploads fast and off the API’s request path.
Flow
POST /v1/uploadwith{ filename, size }(size in bytes).- Receive
{ id, uploadUrl, contentType, uploadUrlExpiresIn, expiresAt }. PUTthe raw file bytes touploadUrlwith exactly the returnedContent-Type; the presigned signature is bound to it.- Use
idasaudioId(audio jobs),imageId(image jobs), orfileId(text jobs).
Constraints
Content types are assigned by extension:
audio/mpeg, audio/wav, application/pdf, text/plain, image/jpeg, image/png, image/webp.
Validation
The declaredsize is checked against your plan limit when the URL is created. When the upload is first consumed by a job, the API additionally verifies that:
- the object actually landed in storage (
UPLOAD_NOT_COMPLETED, 409, if thePUTnever happened), - the real size is within your plan limit (
FILE_TOO_LARGE, 413), - the file’s magic bytes match a valid MP3/WAV/PDF/JPEG/PNG/WebP signature (
INVALID_FORMAT, 422). Plain-text files skip this check.
POST /v1/audio:.mp3and.wavonly.POST /v1/image:.jpg,.jpeg,.png,.webponly.POST /v1/text(fileId):.pdfand.txtonly.