Skip to main content
POST
Create an upload

Authorizations

Authorization
string
header
required

A ZeroGen API key: zg_ for a live key, zg_test_ for a test key.

Headers

Idempotency-Key
string

Makes retries safe: a retry with the same key and body returns the first response for 24 hours instead of repeating the work. Reusing a key with a different body returns 409.

Required string length: 1 - 255
Pattern: ^[\x21-\x7e]+$

Body

application/json
filename
string
required
Required string length: 1 - 1024
Pattern: ^(?:.*[\\/])?[^\\/]{1,255}$
contentType
enum<string>
required
Available options:
audio/aac,
audio/aiff,
audio/flac,
audio/mp4,
audio/mpeg,
audio/ogg,
audio/wav,
image/avif,
image/bmp,
image/gif,
image/jpeg,
image/png,
image/tiff,
image/webp,
video/mp4,
video/quicktime,
video/webm,
video/x-matroska,
video/x-msvideo
sizeBytes
integer
required
Required range: 1 <= x <= 5368709120
projectId
string

The project to upload into; omit for the organization's default project.

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
folderId
string

Add the asset to this folder in the project.

Pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
sha256
string

Lowercase hex SHA-256 of the file, to reuse an identical file in the project.

Pattern: ^[0-9a-f]{64}$

Response

An identical file is already in the project.

id
string
required

The upload's ID, which completes it

projectId
string
required
status
enum<string>
required

upload_required: PUT the bytes, then complete; ready: the asset can be used

Available options:
upload_required,
ready
assetId
string | null
required

Once ready, the Library asset to send as a generation input; an identical file already in the project is reused

upload
object | null
required

Where to PUT the file's exact bytes, with these headers, before expiresAt

folder
object

Whether the asset was added to the folder named at create