Skip to content
Alphahelmstudio is early software: things will change, and some will break.What's newReport an issue

Start an upload

POST
/v1/studio/uploads
curl --request POST \
--url http://localhost:8300/v1/studio/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "filename": "example", "content_type": "image/png", "bytes": 1, "duration_s": 1 }'

Stores a pending take (source upload, invisible until completed) and signs a single-use PUT link for the key u/<caller>/uploads/<take_id>.<png|jpg|webp|wav|mp3|m4a>, valid 15 minutes (PUT /files/{path}): image/png, an audio take; duration_s required, at most 600 s), at most 50 MB (52428800 bytes). 422 for any other type or size (“only png, jpeg and webp images or wav, mp3 and m4a audio can be uploaded”, “file is larger than 50 MB”, “audio is longer than 600 s”). A pending upload not completed within an hour is discarded. optimises a file before this call: bytes is the file it uploads.

Media typeapplication/json
object
filename
required

The file’s name; only its base name (without extension) is kept, as the title

string
>= 1 characters <= 255 characters
content_type
required
string
Allowed values: image/png image/jpeg image/webp audio/wav audio/mpeg audio/mp4
bytes
required
integer
>= 1 <= 52428800
duration_s

Audio only (required): its length as the browser decoded it; studio records it, the runner reads the file itself

number
> 0 <= 600

The upload

Media typeapplication/json
object
take_id
required

Pass to /v1/studio/uploads/{take_id}/complete; becomes the take’s id

string format: uuid
upload_url
required

Signed single-use link: PUT the bytes here with exactly this Content-Type and Content-Length

string
content_type
required
string
bytes
required
integer
expires_at
required
string format: date-time

Example

{
"upload_url": "/files/u/7d1e.../uploads/9b2f....png?exp=1767225600&bytes=48213&ct=image%2Fpng&sig=ab12"
}

Missing or invalid x-api-key (Kong), or missing/invalid/expired/revoked bearer token

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Invalid input

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}

Retryable

Media typeapplication/json
object
detail
required
string

Example generated

{
"detail": "example"
}