Skip to content
Sections
On this page

API reference

Every operation of the PAD6 API, with its request, response and a sample.

Overview

Every call goes to https://pad6.com and starts with /api. Answers are JSON.

Keys and sign-in

Send your API key in the Authorization header, as a Bearer token. It is the only place a key is read: a key in the address or the body is ignored.

A key starts with pad6_live_. Make and revoke keys in your workspace, under Developers, API keys. You see a key in full once, when you make it.

A missing, wrong, revoked or expired key answers 401 unauthenticated. The answer does not say which.

A signed-in browser session does not work on these calls. Only a key does.

API access is for paid plans. A workspace that is not on a paid plan answers 403 forbidden.

Authorization: Bearer pad6_live_…

Scopes

A key holds one or both scopes. A key without the scope a call needs answers 403 forbidden. GET /v1/videos and GET /v1/videos/:id work with a key that has generation:write or assets:read. Starting, approving and stopping a video need generation:write.

  • generation:write: Price, start, approve and stop videos, and upload reference videos. It also lists and reads videos. Calls: GET /api/v1/videos, GET /api/v1/videos/:id, POST /api/v1/quotes, POST /api/v1/videos, POST /api/v1/videos/:id/cancel, POST /api/v1/videos/:id/approve, POST /api/v1/reference-uploads, POST /api/v1/reference-uploads/:id/complete, GET /api/v1/reference-uploads/:id, POST /api/v1/reference-uploads/:id/cancel
  • assets:read: List finished videos and get file links. It also lists and reads videos. Calls: GET /api/v1/videos, GET /api/v1/videos/:id, GET /api/v1/assets, GET /api/v1/videos/:id/versions/:n/file
  • Any valid key: GET /api/v1/credits

Lists and pages

The two list calls return up to 100 videos a page. Use limit to ask for fewer. Without it a page holds 20.

Lists are newest first. To read the next page, pass nextCursor as cursor. nextCursor is null on the last page. A cursor that cannot be read answers 400 validation_failed.

Treat a cursor as an opaque text. Do not build one yourself.

Reference pictures or videos

A reference is a picture (PNG, JPEG or WebP, up to 30 MB) or a video (MP4 or MOV, up to 300 MB) you own, used as a guide for a new video. Upload each one, then name it in referenceUploadIds when you price a video. Up to 5 per video. Uploading is free.

The file goes straight to storage and not through this API: make the upload, PUT the file to uploadUrl, then finish the upload with ownershipConfirmed set to true. Order the video with referenceUploadIds and, if you want, seconds.

An upload id that is not ready, or is unknown or another account's, is refused. An unknown id and another account's id give the same 404 not_found.

# 1. Make the upload
curl -X POST 'https://pad6.com/api/v1/reference-uploads' \
  -H 'Authorization: Bearer pad6_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"filename":"clip.mp4","contentType":"video/mp4","bytes":12345678}'

# 2. PUT the file to the uploadUrl from step 1
curl -X PUT 'UPLOAD_URL' -H 'Content-Type: video/mp4' --data-binary @clip.mp4

# 3. Finish the upload
curl -X POST 'https://pad6.com/api/v1/reference-uploads/UPLOAD_ID/complete' \
  -H 'Authorization: Bearer pad6_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"ownershipConfirmed":true}'

# 4. Price a video with it, then start it as usual
curl -X POST 'https://pad6.com/api/v1/quotes' \
  -H 'Authorization: Bearer pad6_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"brief":{"recipe":"short","prompt":"A lemon orzo recipe","sourceUrl":null,"brandId":null,"minutes":null,"seconds":15,"shape":"9:16","narration":true,"referenceUploadIds":["UPLOAD_ID"]}}'

Operations

curlJavaScriptPython
Not available right now

Credit balance

GET/api/v1/credits

Your credits. Needs: any valid key. Answers 200 when it works.

Any valid key can read it.

Changed in release 37: balances and daily limits are now in the new credit unit, 1,000 times the old amounts. Prices are unchanged.

Response: Answer

NameTypeDescription
available requirednumberCredits you can spend now.
reserved requirednumberCredits set aside for videos in progress.
spentThisPeriod requirednumberCredits spent in the current billing period.
bySource requiredobjectAvailable credits by source: trial, plan, pack, adjustment.
curl 'https://pad6.com/api/v1/credits' \
  -H 'Authorization: Bearer pad6_live_…'

List videos

GET/api/v1/videos

The videos of the key's workspace. Needs: generation:write or assets:read. Answers 200 when it works.

A page holds up to 100 videos.

Request: Query

NameTypeDescription
limitnumberRows per page, 1 to 100. 20 when left out.
cursortextThe nextCursor of the page before. Leave out for the first page.

Response: Answer

NameTypeDescription
videos requiredlistUp to one page of videos.
nextCursor requiredtext or nullPass it as cursor for the next page. null on the last page.

Response: Video

NameTypeDescription
id requiredtextThe video id.
title requiredtextThe title.
status requiredchoiceOne of draft, waiting_approval, queued, building, ready, failed, canceled.
aspect requiredchoiceThe frame: 9:16, 4:5, 1:1 or 16:9.
currentVersion requirednumber or nullThe number of the current version, or null while there is none.
versions requiredlistThe versions, each with the fields listed under Version.
createdAt requiredtextWhen the video was created (ISO date).
updatedAt requiredtextWhen the video last changed (ISO date).
creditsCharged requirednumber or nullThe credits this video used, over all its versions. null while a version is still being made or before the first one starts.

Response: Version

NameTypeDescription
number requirednumberThe version number, from 1.
durationSeconds requirednumberLength in seconds.
aspect requiredchoiceThe frame of this version.
createdAt requiredtextWhen this version was created (ISO date).
fileReady requiredtrue or falsetrue when the file can be fetched.
curl 'https://pad6.com/api/v1/videos?limit=20' \
  -H 'Authorization: Bearer pad6_live_…'

Get a video

GET/api/v1/videos/:id

One video, with its versions. Needs: generation:write or assets:read. Answers 200 when it works.

An id that is unknown, or belongs to another workspace, answers 404 not_found.

Response: Video

NameTypeDescription
id requiredtextThe video id.
title requiredtextThe title.
status requiredchoiceOne of draft, waiting_approval, queued, building, ready, failed, canceled.
aspect requiredchoiceThe frame: 9:16, 4:5, 1:1 or 16:9.
currentVersion requirednumber or nullThe number of the current version, or null while there is none.
versions requiredlistThe versions, each with the fields listed under Version.
createdAt requiredtextWhen the video was created (ISO date).
updatedAt requiredtextWhen the video last changed (ISO date).
creditsCharged requirednumber or nullThe credits this video used, over all its versions. null while a version is still being made or before the first one starts.

Response: Version

NameTypeDescription
number requirednumberThe version number, from 1.
durationSeconds requirednumberLength in seconds.
aspect requiredchoiceThe frame of this version.
createdAt requiredtextWhen this version was created (ISO date).
fileReady requiredtrue or falsetrue when the file can be fetched.
curl 'https://pad6.com/api/v1/videos/VIDEO_ID' \
  -H 'Authorization: Bearer pad6_live_…'

List finished videos

GET/api/v1/assets

Finished videos that have a file ready. Needs: assets:read. Answers 200 when it works.

A page holds up to 100 videos.

While private video files are not connected, this call answers 503 service_unavailable.

Request: Query

NameTypeDescription
limitnumberRows per page, 1 to 100. 20 when left out.
cursortextThe nextCursor of the page before. Leave out for the first page.

Response: Answer

NameTypeDescription
videos requiredlistUp to one page of videos.
nextCursor requiredtext or nullPass it as cursor for the next page. null on the last page.

Response: Video

NameTypeDescription
id requiredtextThe video id.
title requiredtextThe title.
status requiredchoiceOne of draft, waiting_approval, queued, building, ready, failed, canceled.
aspect requiredchoiceThe frame: 9:16, 4:5, 1:1 or 16:9.
currentVersion requirednumber or nullThe number of the current version, or null while there is none.
versions requiredlistThe versions, each with the fields listed under Version.
createdAt requiredtextWhen the video was created (ISO date).
updatedAt requiredtextWhen the video last changed (ISO date).
creditsCharged requirednumber or nullThe credits this video used, over all its versions. null while a version is still being made or before the first one starts.

Response: Version

NameTypeDescription
number requirednumberThe version number, from 1.
durationSeconds requirednumberLength in seconds.
aspect requiredchoiceThe frame of this version.
createdAt requiredtextWhen this version was created (ISO date).
fileReady requiredtrue or falsetrue when the file can be fetched.
curl 'https://pad6.com/api/v1/assets?limit=20' \
  -H 'Authorization: Bearer pad6_live_…'

Get a file link

GET/api/v1/videos/:id/versions/:n/file?kind=preview|download

A signed link to the file of one version. Needs: assets:read. Answers 200 when it works.

:n is the version number. An unknown video or version answers 404 not_found.

Request: Query

NameTypeDescription
kindchoice"preview" or "download". "preview" when left out.

Response: Answer

NameTypeDescription
url requiredtextA signed link to the file.
expiresAt requiredtextWhen the link stops working (ISO date).
curl 'https://pad6.com/api/v1/videos/VIDEO_ID/versions/1/file?kind=download' \
  -H 'Authorization: Bearer pad6_live_…'

Price a video

POST/api/v1/quotes

Asks the most credits that can be set aside for a video. Nothing is started and no credits are used. The credits used are known on delivery, in creditsCharged. Needs: generation:write. Answers 201 when it works.

Answers 201 with the quote.

Request: Body

NameTypeDescription
brief requiredobjectThe brief, with the fields listed under Brief.
creativeIdtext or nullOptional. The id of an existing video the quote belongs to, or null.

Request: Brief

NameTypeDescription
recipe requiredchoiceWhat to make. One of topic_video, short: topic_video is a topic video and short is a 15-second video.
prompt requiredtextThe idea, in plain text.
sourceUrl requiredtext or nullA web address to make the video from, or null. YouTube and Google links are refused.
brandId requiredtext or nullThe id of one of your brands, or null.
minutes requirednumber or nullWhole minutes for a topic video, or null.
secondsnumberOptional. A length limit in whole seconds, 10 to 180, for a video shorter than a whole minute. The video is as long as its script needs, up to the limit.
targetSecondsnumberOptional. The video length to aim for, in seconds.
shape requiredtext or nullThe frame, for example "9:16", or null.
narration requiredtrue or falsetrue or false.
sourceslistOptional. Not available right now. Sending it non-empty is refused with 400 validation_failed. Leave it out or send an empty list.
revisesQuoteIdtext or nullOptional. The quote this one replaces, or null.
qualitychoiceOptional. "standard" or "premium". Standard when left out.
detailsobjectOptional. Audience, main points, tone, ending, look and title.
referenceUploadIdtext or nullOptional. The id of one reference you uploaded, or null. Send referenceUploadIds for one or more.
kitUploadIdslistOptional. Not available right now. Sending it non-empty is refused with 400 validation_failed. Leave it out or send an empty list.
referenceUploadIdslistOptional. Up to 5 references, by id, each once. Each must be a ready upload of yours (see Reference pictures or videos).
guidedchoiceOptional. When true, the video stops at its draft and waits for your go-ahead before it is made.

Response: Quote

NameTypeDescription
id requiredtextThe quote id. Send it to start the video.
brief requiredobjectThe brief the quote is for.
credits requirednumberThe most credits that can be set aside for this video. The credits used are known on delivery, in creditsCharged on the video; credits not used come back.
proposedPrice requiredtrue or falsetrue while the price is proposed.
quoteIsCap requiredtrue or falsetrue when credits is the most that can be set aside, not the final number of credits used.
approvalPath requiredchoice"plan_first" or "immediate".
summary requiredtextA short text about the quote.
availableBefore requirednumberCredits available before the video.
availableAfter requirednumberCredits that would be left after it.
sufficient requiredtrue or falsetrue when your credits cover the quote.
createdAt requiredtextWhen the quote was made (ISO date).
expiresAt requiredtextWhen the quote stops being valid (ISO date).
shapechoiceOptional. The frame the video is made in.
removedLinksobjectOptional. How many YouTube and Google links were removed from the text of the brief, as youtube and google counts. Left out when none were removed.
productLinkobject or nullOptional. The product page the quote reads, as domain and read ("ok" or "failed"). Absent or null when the brief has no product link.
videoId requiredtext or nullThe id of the video this quote was used for, once it was used, else null.
curl -X POST 'https://pad6.com/api/v1/quotes' \
  -H 'Authorization: Bearer pad6_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"brief":{"recipe":"topic_video","prompt":"How a heat pump works","sourceUrl":null,"brandId":null,"minutes":1,"shape":"16:9","narration":true}}'

Start a video

POST/api/v1/videos

Starts a video from a quote. Needs: generation:write. Answers 201 when it works.

An Idempotency-Key does not expire. The same key with the same API key always returns the first video and starts nothing new.

The same Idempotency-Key with a different quote answers 409 idempotency_conflict.

A key is kept per API key: the same text under another API key is another request.

Not enough credits answers 402 insufficient_credits, with details.addCreditsUrl. Add credits there, then ask for a new quote. For the free trial video, the link goes to the plans page.

A quote that is too old answers 409 conflict: "This price has expired. Ask for a new one." Ask for a new quote and start again.

Request: Header

NameTypeDescription
Idempotency-Key requiredtextRequired. 8 to 200 characters. Use a new value for each video you want.

Request: Body

NameTypeDescription
quoteId requiredtextThe id of a quote from the quote call.

Response: Answer

NameTypeDescription
video requiredobjectThe video that now exists, with the fields listed under Video.

Response: Video

NameTypeDescription
id requiredtextThe video id.
title requiredtextThe title.
status requiredchoiceOne of draft, waiting_approval, queued, building, ready, failed, canceled.
aspect requiredchoiceThe frame: 9:16, 4:5, 1:1 or 16:9.
currentVersion requirednumber or nullThe number of the current version, or null while there is none.
versions requiredlistThe versions, each with the fields listed under Version.
createdAt requiredtextWhen the video was created (ISO date).
updatedAt requiredtextWhen the video last changed (ISO date).
creditsCharged requirednumber or nullThe credits this video used, over all its versions. null while a version is still being made or before the first one starts.
curl -X POST 'https://pad6.com/api/v1/videos' \
  -H 'Authorization: Bearer pad6_live_…' \
  -H 'Idempotency-Key: my-first-video-0001' \
  -H 'Content-Type: application/json' \
  -d '{"quoteId":"QUOTE_ID"}'

Cancel a video

POST/api/v1/videos/:id/cancel

Stops the video's latest start. Needs: generation:write. Answers 200 when it works.

A video that has already finished answers 409 conflict.

A video that was never started has nothing to stop and answers 409 conflict.

An unknown id answers 404 not_found.

Response: Video

NameTypeDescription
id requiredtextThe video id.
title requiredtextThe title.
status requiredchoiceOne of draft, waiting_approval, queued, building, ready, failed, canceled.
aspect requiredchoiceThe frame: 9:16, 4:5, 1:1 or 16:9.
currentVersion requirednumber or nullThe number of the current version, or null while there is none.
versions requiredlistThe versions, each with the fields listed under Version.
createdAt requiredtextWhen the video was created (ISO date).
updatedAt requiredtextWhen the video last changed (ISO date).
creditsCharged requirednumber or nullThe credits this video used, over all its versions. null while a version is still being made or before the first one starts.
curl -X POST 'https://pad6.com/api/v1/videos/VIDEO_ID/cancel' \
  -H 'Authorization: Bearer pad6_live_…'

Approve the plan of a video

POST/api/v1/videos/:id/approve

A topic video stops at its plan. This approves the plan so the video goes on. Needs: generation:write. Answers 200 when it works.

A video that is not waiting for approval answers 409 conflict.

An unknown id answers 404 not_found.

Approving takes no further credits.

Response: Video

NameTypeDescription
id requiredtextThe video id.
title requiredtextThe title.
status requiredchoiceOne of draft, waiting_approval, queued, building, ready, failed, canceled.
aspect requiredchoiceThe frame: 9:16, 4:5, 1:1 or 16:9.
currentVersion requirednumber or nullThe number of the current version, or null while there is none.
versions requiredlistThe versions, each with the fields listed under Version.
createdAt requiredtextWhen the video was created (ISO date).
updatedAt requiredtextWhen the video last changed (ISO date).
creditsCharged requirednumber or nullThe credits this video used, over all its versions. null while a version is still being made or before the first one starts.
curl -X POST 'https://pad6.com/api/v1/videos/VIDEO_ID/approve' \
  -H 'Authorization: Bearer pad6_live_…'

Start a reference video upload

POST/api/v1/reference-uploads

Makes an upload and gives you an address to send the file to. The file never passes through this API. Making an upload is free. Needs: generation:write. Answers 201 when it works.

A reference may be a PNG, JPEG or WebP picture (up to 30 MB) or an MP4 or MOV video (up to 300 MB, 3 minutes). A file over the size limit answers 413 payload_too_large; a wrong type answers 400 validation_failed.

Up to 3 uploads can be open at once. One more answers 409 conflict: finish or cancel an open one first.

Request: Body

NameTypeDescription
filename requiredtextThe file name, for example "clip.mp4".
contentType requiredtext"video/mp4", "video/quicktime", "image/png", "image/jpeg" or "image/webp".
bytes requirednumberThe exact size of the file in bytes. At most 300 MB for a video, or 30 MB for a picture.

Response: Answer

NameTypeDescription
id requiredtextThe upload id. Use it to finish the upload and in referenceUploadIds.
uploadUrl requiredtextPUT the file here, with exactly bytes bytes and the same Content-Type.
expiresAt requiredtextUpload the file within 3 hours of opening the upload, before expiresAt. Unfinished uploads are removed after that.
curl -X POST 'https://pad6.com/api/v1/reference-uploads' \
  -H 'Authorization: Bearer pad6_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"filename":"clip.mp4","contentType":"video/mp4","bytes":12345678}'

Finish a reference video upload

POST/api/v1/reference-uploads/:id/complete

Checks the file you sent and makes the reference ready to use. Needs: generation:write. Answers 200 when it works.

Anything but true answers 400 validation_failed: "Confirm you own the rights to this video."

An id that is unknown, or belongs to another account, answers 404 not_found.

Request: Body

NameTypeDescription
ownershipConfirmed requiredchoiceMust be the literal true: you confirm you own the rights to this video.

Response: Answer

NameTypeDescription
id requiredtextThe upload id.
status requiredchoice"uploading", "ready" or "failed". Only a "ready" video can be used in an order.
contentType requiredtext"video/mp4" or "video/quicktime".
bytes requirednumberThe size of the file in bytes.
createdAt requiredtextWhen the upload was made (ISO date).
curl -X POST 'https://pad6.com/api/v1/reference-uploads/UPLOAD_ID/complete' \
  -H 'Authorization: Bearer pad6_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"ownershipConfirmed":true}'

Get a reference video

GET/api/v1/reference-uploads/:id

The state of one upload: uploading, ready or failed. Needs: generation:write. Answers 200 when it works.

An id that is unknown, or belongs to another account, answers 404 not_found.

Response: Answer

NameTypeDescription
id requiredtextThe upload id.
status requiredchoice"uploading", "ready" or "failed". Only a "ready" video can be used in an order.
contentType requiredtext"video/mp4" or "video/quicktime".
bytes requirednumberThe size of the file in bytes.
createdAt requiredtextWhen the upload was made (ISO date).
curl 'https://pad6.com/api/v1/reference-uploads/UPLOAD_ID' \
  -H 'Authorization: Bearer pad6_live_…'

Cancel a reference video upload

POST/api/v1/reference-uploads/:id/cancel

Drops an upload that is not finished. A finished one is kept. Needs: generation:write. Answers 200 when it works.

An id that is unknown, or belongs to another account, answers 404 not_found.

Response: Answer

NameTypeDescription
id requiredtextThe upload id.
cancelled requiredtrue or falsetrue when the open upload was dropped.
curl -X POST 'https://pad6.com/api/v1/reference-uploads/UPLOAD_ID/cancel' \
  -H 'Authorization: Bearer pad6_live_…'

Limits and errors

Rate limits

Each key can make a limited number of calls a minute. Every answer carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset.

When the limit is reached the call answers 429 rate_limited with a Retry-After header (seconds). Wait that long, then call again.

Many failed key attempts from one address are also answered 429 rate_limited with Retry-After.

A key can have a daily credit limit, set when the key is made. It counts the credits of videos started with the key in one UTC day. Returned credits do not lower it. Over the limit, a start answers 429 daily_credit_limit_reached with Retry-After (seconds until 00:00 UTC) and this message: "This API key has reached its daily credit limit. The limit resets at 00:00 UTC."

Credits

Check sufficient on the quote before you start a video. When it is false, add credits first.

Credits are set aside when the video starts. The real length is taken on delivery, and the rest comes back. A video that fails or is stopped uses none. Read the credits used so far, across all its versions, in creditsCharged on the video.

When credits run out, a start answers 402 insufficient_credits and nothing is set aside. Add credits on pad6.com, then ask for a new quote.

Errors

An error answer is a JSON body with these fields. The HTTP status says the kind; the code says which.

NameTypeDescription
code requiredtextA short code from the list below.
message requiredtextA sentence you can show to a person.
fieldErrorsobjectOptional. A message per field that was wrong.
retryAfterSecondsnumberOptional. Seconds to wait before the next try.
reasontextOptional. A short key that tells apart refusals that share one code.
detailsvalueOptional. Structured data a refusal carries, such as the stored channel defaults on a 409.
requestId requiredtextGive this to support when you ask about a call.
recoverable requiredtrue or falsetrue when a new try of the same call can work.
{
  "code": "daily_credit_limit_reached",
  "message": "This API key has reached its daily credit limit. The limit resets at 00:00 UTC.",
  "requestId": "…",
  "recoverable": true,
  "retryAfterSeconds": 3600
}
{
  "code": "insufficient_credits",
  "message": "You do not have enough credits for this video. A shorter video uses fewer. Add credits at https://pad6.com/app/billing/credits?topup=1.",
  "requestId": "…",
  "recoverable": true,
  "details": { "addCreditsUrl": "https://pad6.com/app/billing/credits?topup=1" }
}
StatusCodeWhen
401unauthenticatedNo key, or a key that is wrong, revoked or expired. Also when the creator who made the key is no longer a member of the workspace.
403forbiddenThe key does not have the scope the call needs, or the workspace is not on a paid plan.
400validation_failedA field is missing or wrong, or the Idempotency-Key is missing or not 8 to 200 characters, or a cursor cannot be read. fieldErrors names each field.
413payload_too_largeThe request body is too large, or a reference is over its size limit.
404not_foundThe id is unknown or belongs to another workspace.
409conflictThe call cannot be done in the current state, for example cancelling a video that has finished.
409idempotency_conflictThe same Idempotency-Key was used with a different quote.
429rate_limitedToo many calls in a minute. Wait for the Retry-After seconds.
429daily_credit_limit_reachedThe key has reached its daily credit limit. Wait for the Retry-After seconds.
402insufficient_creditsNot enough credits for the video. Add credits on pad6.com, then ask for a new quote.
402plan_neededThe free trial or the plan of this workspace is over and no credits are left. Choose a plan on pad6.com, then ask for a new quote.
409key_cap_reachedThe workspace already has the most active keys it can have, so a new key cannot be made. This comes from making a key in the app, not from the v1 calls. Revoke a key to make another.
503service_unavailablePAD6 is busy for a moment, or a part of it is not connected. A 503 answer may carry Retry-After. When recoverable is false, do not retry.
500internal_errorSomething went wrong on our side. Try again with the same Idempotency-Key.

Make your first video

Request an invite