Nhà phát triển
Tài liệu API
API của gói Business đang được mở dần; liên hệ chúng tôi để tham gia. Phần tham chiếu dưới đây được tạo từ cùng đặc tả mà máy chủ sử dụng, nên liệt kê đúng các endpoint mà khóa API có thể gọi.
Những điều cơ bản
Xác thực
Gửi khóa của bạn trong header Authorization: Authorization: Bearer vc_live_…. Khóa thuộc
về một không gian làm việc và có các phạm vi quyền. Lệnh gọi nằm ngoài phạm vi quyền của khóa,
hoặc tới endpoint không được liệt kê ở đây, sẽ trả về 403.
Idempotency
Các endpoint tạo tác vụ yêu cầu header Idempotency-Key. Thử lại với cùng khóa và cùng nội
dung sẽ trả về phản hồi gốc; cùng khóa nhưng khác nội dung sẽ trả về 409 idempotency_mismatch.
Giới hạn tần suất
Yêu cầu vượt giới hạn sẽ trả về 429 rate_limited kèm header Retry-After tính bằng giây.
Tác vụ và lỗi
Theo dõi tác vụ
Tạo tác vụ sẽ trả về 202 cùng tác vụ và số credit được giữ lại. Gọi lặp lại (polling) GET /api/v1/w/{workspace_id}/jobs/{job_id} cho đến khi trạng thái là succeeded, failed,
canceled hoặc expired.
Lỗi
Lỗi dùng application/problem+json với code ổn định, ví dụ insufficient_credits (402),
moderation_blocked (422), validation_error (422), not_found (404).
Tham chiếu endpoint
65 thao tác, được tạo từ đặc tả API công khai.
GET/api/v1/cast/libraryList the cast library
Phạm vi: jobs:read
Phản hồi: 200
GET/api/v1/voicesList the voices an ad can use
The voices you may give an ad (voice_id), each with a short sample to hear.
Phạm vi: ads:read
Phản hồi: 200
GET/api/v1/w/{workspace_id}/adsList ads
Your ads, newest first, each with its brief, settings and plan. limit (1-100) and cursor page the list: next_cursor is null on the last page. Without limit you get up to 200 ads and a next_cursor when there are more.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
limit | query | integer | Không |
cursor | query | string | Không |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/adsCreate an ad
Create an ad for one of your products, 201. The ad starts without scenes: call plan:make (the autopilot) or script:generate next. Costs nothing. Send an Idempotency-Key to retry safely: the same key and body answers with the ad already made instead of a second one. A block you leave out (keyframe_quality for the frames, video_model and video_quality for the clips) is made at the standard tier of ads.keyframe_quality and ads.video_models (their default: true); if that tier cannot be used the call answers 409 tier_unavailable {block, tier, reason} and never uses another. Talking is refused with 409 talk_unavailable (reason not_live) while it is switched off for new ads.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
title | string | Có |
product_id | string (uuid) | Có |
brand_id | string (uuid) | Không |
brief | BriefIn | Có |
aspect | 9:16 | 1:1 | 4:5 | 16:9 | Không |
delivery_mode | still | video | Không |
voice_id | string (uuid) | Không |
video_quality | standard | premium | Không |
video_model | string | Không |
keyframe_quality | standard | premium | Không |
talking | boolean | Không |
cast_mode | auto | none | Không |
captions | off | words | Không |
Phản hồi: 201, 422
DELETE/api/v1/w/{workspace_id}/ads/{ad_id}Remove an ad
Remove the ad. Files already delivered stay in your library. Costs nothing.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/ads/{ad_id}Read an ad
The ad with its scenes and axes. rev is what an edit must send back. For where the ad stands and what to do next, read GET /ads/{id}/status.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
Phản hồi: 200, 422
PATCH/api/v1/w/{workspace_id}/ads/{ad_id}Edit an ad
Change the title, brief, voice, delivery mode, look or keyframe_quality. Send the rev you read: a stale one is 409 revision_conflict. Changing what a frame is drawn from makes that frame stale (it must be drawn and approved again). Costs nothing.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
rev | integer | Có |
cast_mode | auto | none | Không |
title | string | Không |
brand_id | string (uuid) | Không |
brief | BriefIn | Không |
delivery_mode | still | video | Không |
voice_id | string (uuid) | Không |
look | string | Không |
keyframe_quality | standard | premium | Không |
Phản hồi: 200, 422
PUT/api/v1/w/{workspace_id}/ads/{ad_id}/axesReplace the variation axes of an ad
Write the axes (hook, setting, outfit, cta) that make the cuts of the ad. The number of cuts is limited by the plan (max_cuts_per_ad). Costs nothing.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
rev | integer | Có |
axes | AxisIn[] | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/ads/{ad_id}/cutsList the cuts of an ad
Every cut with its shots: the state of each frame (missing, pending, ready, approved, stale), the ids to approve or redraw, the safety-check note on a frame, and the estimate of the render.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/ads/{ad_id}/deliverablesList the signed deliveries of an ad
Each cut with a signed delivery: download links (15 minutes unless you send expires_in, 300 to 3600 seconds; outside that range is 422) for the signed video, its .srt and cover, its exports, and the models and licenses behind it. asset_id is the signed file's asset id (what POST /assets/zip takes); signer and signed_at (UTC) come from its signature record and the signing job. A file that is not signed yet is not listed.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
expires_in | query | integer | Không |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/ads/{ad_id}/exportsExport rendered cuts in other frames
One export.reframe job per cut and frame that has no file yet. Each export is assembled again from the clip intermediates (one lossy encode) and signed.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
cut_ids | string (uuid)[] | Có |
aspects | 1:1 | 4:5 | 16:9[] | Có |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/ads/{ad_id}/keyframes:previewMake the keyframes an ad is missing
One ad.keyframe job per keyframe hash with no ready or pending keyframe. A close-up that uses the product photo is cropped at once and costs nothing. Spends credits: ask POST /ads/{id}/quote with action keyframes_preview for the price first. Idempotency-Key is required. max_credits: the most credits this call may hold. When the price is higher the call answers 409 price_exceeds_max_credits (required, max_credits, balance) and holds nothing. Left out: no limit.
Phạm vi: ads:spend
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/ads/{ad_id}/plan:makeMake the whole ad plan for the seller (the autopilot)
Queue an ad.plan job, 0 credits: read the photos, fill the brief, write the scenes, pick the versions and time the voice, stage by stage (JobItem.stage). 409 plan_would_overwrite when the seller's own scenes would be replaced and overwrite is not true. 429 ai_daily_limit when the day's plans are used. A plan already running for the ad is returned instead of a second one.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
refine | more_premium | more_playful | shorter_lines | new_idea | Không |
overwrite | boolean | Không |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/ads/{ad_id}/quotePrice a step of an ad before paying for it
What keyframes:preview (shot_ids), render (cut_ids) or exports (cut_ids, aspects) would hold right now, with your balance and what is left after. Nothing is held and no job is queued. The price follows what is already drawn: frames and clips you have are not charged again. Needs only ads:read, so a read-only key can ask. It is a POST (it has a body), so it counts in the write limit of the key and, like any write, is refused with 503 while the rate limiter is down.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
action | keyframes_preview | render | exports | Có |
shot_ids | string (uuid)[] | Không |
cut_ids | string (uuid)[] | Không |
aspects | 1:1 | 4:5 | 16:9[] | Không |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/ads/{ad_id}/renderRender the cuts of an ad
Every keyframe must be approved first (409 approval_required lists the rest). Queues an ad.render parent that holds the price of the clips it must draw. Clips already ready or being drawn are reused and cost nothing. Spends credits: ask POST /ads/{id}/quote with action render for the price first. Idempotency-Key is required. max_credits: the most credits this call may hold. When the price is higher the call answers 409 price_exceeds_max_credits (required, max_credits, balance) and holds nothing. Left out: no limit.
Phạm vi: ads:spend
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
Phản hồi: 202, 422
PUT/api/v1/w/{workspace_id}/ads/{ad_id}/scenesReplace the scenes of an ad
Write the whole list of scenes (1-12). Send the rev you read: a stale one is 409 revision_conflict. Frames whose scene changed become stale. Costs nothing.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
rev | integer | Có |
scenes | SceneIn[] | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/ads/{ad_id}/script:generateWrite the scenes of an ad with the LLM
Queue an ad.script job. It replaces every scene when it succeeds. no_cast true: no scene shows a person (the same when the ad's cast_mode is none); with cast_member_id it is 422 validation_error. 429 ai_daily_limit when the day's scripts are used.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
cast_member_id | string (uuid) | Không |
no_cast | boolean | Không |
Phản hồi: 202, 422
GET/api/v1/w/{workspace_id}/ads/{ad_id}/statusWhere an ad stands and what to do next
One call for a machine: stage (needs_plan, planning, needs_keyframes, keyframes_generating, awaiting_approval, ready_to_render, rendering, done, failed), the frames by state, the jobs running now (the system's helper jobs are left out), the progress of a render, next_actions (operationIds that make sense now), the credits the next paid step needs, and last_error of a frame or render that failed.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/ads/{ad_id}/voice:measureRead the voice lines of an ad and time its scenes
Queue an ad.voiceover job in the ad's voice. Lines already read are reused.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
ad_id | path | string (uuid) | Có |
Phản hồi: 202, 422
GET/api/v1/w/{workspace_id}/ads/keyframe-qualityFrame quality choices for a new ad, with price and wait
The frame options of the create-ad step, with credits per frame and the wait of one pass. standard is the default; premium (Qwen: scenes that show only the product; an API image model: every scene, see draws_people; keyframe_quality: premium on ads.create) is left out while it cannot be used. Every plan can buy it. The price comes from the price table, never a fixed number.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/ads/talkingWhether the AI model can speak the voice-over, with price and wait
The talking choice of the create-ad step (talking: true on ads.create): available, why not when it is not, credits per second of the speaking scenes and the wait of one clip. The price comes from the price table.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/ads/video-modelsVideo models a new ad can be made with, with price and wait
Every video model that has a price, cheapest second first. A model that cannot be used right now has available false and a reason. Send the key as video_model on ads.create.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/ads/video-qualityVideo quality choices for a new ad, with price and wait
The options of the create-ad step, with credits per second and the wait. Premium is left out while it is off for everyone and shown locked when only this plan cannot use it.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
duration_s | query | integer | Không |
aspect | query | 9:16 | 1:1 | 4:5 | 16:9 | Không |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/assetsList images
List images in this workspace.
Phạm vi: assets:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
kind | query | string | Không |
cursor | query | string | Không |
Phản hồi: 200, 422
DELETE/api/v1/w/{workspace_id}/assets/{asset_id}Remove an image
Soft-delete an image. The file is removed later.
Phạm vi: assets:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
asset_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/assets/{asset_id}Read an image
Read one image in this workspace.
Phạm vi: assets:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
asset_id | path | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/assets/{asset_id}/completeComplete an image upload
Download the uploaded object, validate it, and mark it ready or rejected.
Phạm vi: assets:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
asset_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/assets/{asset_id}/download-urlCreate a download URL
Short-lived URL for one ready file in this workspace. It works for 15 minutes unless you send expires_in (300 to 3600 seconds; outside that range is 422). A video is served only as its signed copy (Content Credentials); a clip intermediate is never served.
Phạm vi: assets:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
asset_id | path | string (uuid) | Có |
expires_in | query | integer | Không |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/assets/import-urlImport an image from a link
For a caller with no file to upload: give the https address of a public image and a cpu job (asset.import_url, 0 credits) fetches it, checks it like an upload and answers with output.asset_id. A link to a private address, a page that is not an image, an image that is too small or too large, or a redirect to a private address fails the job and makes no asset. Idempotency-Key is required.
Phạm vi: assets:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
url | string | Có |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/assets/uploadsStart an image upload
Start a three-step image upload. The file is checked when it is completed. Send an Idempotency-Key to retry safely: the same key and body answers with the same asset_id and upload address.
Phạm vi: assets:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
filename | string | Có |
mime | string | Có |
bytes | integer | Có |
sha256 | string | Có |
Phản hồi: 201, 422
POST/api/v1/w/{workspace_id}/assets/zipZip several files for download
Queue an asset.zip job (0 credits) that packs 1 to 100 ready files of this workspace into one zip. The job output is {asset_id}: download it with download-url like any file. A delivery is packed as its signed copy. The files may add up to 2 GB at most.
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
asset_ids | string (uuid)[] | Có |
Phản hồi: 202, 422
GET/api/v1/w/{workspace_id}/billing/ledgerList credit ledger
Every credit movement of the workspace, newest first: grants, holds, spends, refunds. Pages with `cursor`/`next_cursor`. Needs the `credits:read` scope.
Phạm vi: credits:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
cursor | query | string | Không |
limit | query | integer | Không |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/castList cast members
Phạm vi: jobs:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/castCreate a cast member
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
name | string | Có |
visual_description | string | Có |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/cast/{member_id}/approveApprove a cast portrait
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
member_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
portrait_asset_id | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/cast/{member_id}/revokeRevoke a cast member
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
member_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/creditsRead the credit balance
The credits the workspace can spend now, the buckets they sit in (with expiry), and today's GPU credit use against the daily cap (`limit` is null when no cap applies). A bucket with `frozen` true belongs to a payment whose refund waits for the payment provider: it is not in `balance` and cannot be spent until the refund is declined. Needs the `credits:read` scope.
Phạm vi: credits:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/estimateEstimate the credits for a job
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
kind | string | Có |
params | object | Không |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/eventsStream job events
Phạm vi: jobs:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/jobsList jobs
Newest first, 20 by default (limit 1-100, next_cursor for the next page). Filter by kind, status, or ad_id to follow one ad. The system's own helper jobs are never listed.
Phạm vi: jobs:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
kind | query | string | Không |
status | query | string | Không |
cursor | query | string | Không |
limit | query | integer | Không |
ad_id | query | string (uuid) | Không |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/jobs/{job_id}Read a job
Phạm vi: jobs:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
job_id | path | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/jobs/{job_id}/cancelCancel a job
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
job_id | path | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/keyframes/{keyframe_id}/approveApprove a keyframe
Say the frame is good enough to animate. Nothing is drawn as a clip from a frame that is not approved (409 approval_required on render). An approval made with an API key is recorded on the keyframe itself (which key). Costs nothing.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
keyframe_id | path | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/keyframes/{keyframe_id}/regenerateDraw a keyframe again with a new seed
The scene gets a new seed, so its hash and job are new. The old keyframe stays. Spends credits (the price of one frame per shot of the scene). Idempotency-Key is required. max_credits: the most credits this call may hold. When the price is higher the call answers 409 price_exceeds_max_credits (required, max_credits, balance) and holds nothing. Left out: no limit.
Phạm vi: ads:spend
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
keyframe_id | path | string (uuid) | Có |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/keyframes/{keyframe_id}/revokeWithdraw the approval of a keyframe
Take the approval back. Costs nothing.
Phạm vi: ads:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
keyframe_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/productsList products
Products in this workspace, newest first. limit (1-100) and cursor page the list: next_cursor is null on the last page. Without limit you get up to 200 products and a next_cursor when there are more.
Phạm vi: products:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
limit | query | integer | Không |
cursor | query | string | Không |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/productsCreate a product
Create a product. Send an Idempotency-Key to retry safely: the same key and body answers with the product already made instead of a second one.
Phạm vi: products:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
name | string | Không |
description | string | Không |
brand_id | string (uuid) | Không |
attributes | object | Không |
Phản hồi: 201, 422
DELETE/api/v1/w/{workspace_id}/products/{product_id}Remove a product
Soft-delete a product.
Phạm vi: products:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
product_id | path | string (uuid) | Có |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/products/{product_id}Read a product
Read a product.
Phạm vi: products:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
product_id | path | string (uuid) | Có |
Phản hồi: 200, 422
PATCH/api/v1/w/{workspace_id}/products/{product_id}Update a product
Update a product.
Phạm vi: products:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
product_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
name | string | Không |
description | string | Không |
brand_id | string (uuid) | Không |
attributes | object | Không |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/products/{product_id}/analyzeLet the AI look at the photos of a product
Queue a product.analyze job (0 credits). The AI reads the photos, names the product, gives each photo a role and suggests the brief. The same photos are never read twice: a repeat answers from the saved analysis. A job already waiting or running is returned instead of a new one. 429 ai_daily_limit when the day's analyses are used.
Phạm vi: products:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
product_id | path | string (uuid) | Có |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/products/{product_id}/imagesAttach an image to a product
Attach a ready image from this workspace to a product.
Phạm vi: products:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
product_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
asset_id | string (uuid) | Có |
role | string | Không |
caption | string | Không |
sort | integer | Không |
Phản hồi: 201, 422
DELETE/api/v1/w/{workspace_id}/products/{product_id}/images/{image_id}Detach an image from a product
Detach a product image.
Phạm vi: products:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
product_id | path | string (uuid) | Có |
image_id | path | string (uuid) | Có |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/products/import-urlImport a product from a URL
Queue a product import. Returns the cpu job. At most 20 images.
Phạm vi: products:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
url | string | Có |
Phản hồi: 202, 422
GET/api/v1/w/{workspace_id}/templatesThe template library
The live templates, the newest version of each key, in the order of the library. Each has a sample video and poster (signed links, 15 minutes), the choices the customer may change, and the credits of its two quality levels: quick and publish (post-ready). lang (en or vi) picks the language of the name, description and ready prompt; left out, the caller's own.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
industry | query | fashion | beauty | food_drink | electronics | home | sports | other | Không |
lang | query | en-US | vi-VN | en | vi | Không |
Phản hồi: 200, 422
GET/api/v1/w/{workspace_id}/templates/{key}One template
The newest live version of a template, in the shape of the library.
Phạm vi: ads:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
key | path | string | Có |
lang | query | en-US | vi-VN | en | vi | Không |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/templates/{key}/makeMake a video from a template
Make an ad from a live version of a template, from a product you have (product_id) or from 1 to 10 uploaded photos (upload_ids). The ad has its choices locked, only overrides the template allows (422 override_not_allowed), and runs by itself: plan, scene images, checks, clips and delivery. A scene image the check doubts pauses the ad (autopilot.state needs_review); you look at it in the editor and it goes on. Each step holds and, on a failure, refunds its own credits. 402 when the balance is below estimate_max. Costs up to estimates_max credits in all. Send an Idempotency-Key to retry safely.
Phạm vi: ads:spend
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
key | path | string | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
version | integer | Có |
product_id | string (uuid) | Không |
upload_ids | string (uuid)[] | Không |
request | string | Không |
overrides | MakeOverrides | Không |
quality | quick | publish | Có |
language | en-US | vi-VN | en | vi | Không |
Phản hồi: 202, 422
GET/api/v1/w/{workspace_id}/tools/{kind}/optionsStandard and premium choices of a tool, with price and wait
The choices of one tool: `image.edit` (the product photoshoot), `image.generate` (generate an image), `video.from_image` (image to video) or `video.from_text` (text to video); any other `kind` is a 404. Each option has the `variant` to send to the tool call, its credits per image or per second (per resolution for video), and the wait. Premium is left out while it is off for everyone and shown locked (`locked_reason` "plan") when only this workspace's plan cannot use it. Premium video is 720p only and up to 5 seconds. Premium errors: `image_premium_unavailable` (photoshoot and image generation) and `premium_unavailable` (both videos), both 409 with a `reason`. `seconds` (1-5, default 5) sets the wait shown for premium video.
Phạm vi: jobs:read
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
kind | path | string | Có |
seconds | query | integer | Không |
Phản hồi: 200, 422
POST/api/v1/w/{workspace_id}/tools/image-editCreate an image edit job
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
prompt | string | Có |
inputs | string (uuid)[] | Có |
cast_member_id | string (uuid) | Không |
seed | integer | Không |
variant | string | Không |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/tools/image-generateCreate an image generation job
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
prompt | string | Có |
negative | string | Không |
width | integer | Có |
height | integer | Có |
count | integer | Có |
seed | integer | Không |
variant | string | Không |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/tools/image-to-videoCreate an image-to-video job
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
prompt | string | Có |
negative | string | Không |
seconds | integer | Có |
resolution | string | Có |
input | string (uuid) | Không |
seed | integer | Không |
variant | string | Không |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/tools/remove-backgroundCreate a background removal job
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
input | string (uuid) | Có |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/tools/text-to-videoCreate a text-to-video job
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
prompt | string | Có |
negative | string | Không |
seconds | integer | Có |
resolution | string | Có |
input | string (uuid) | Không |
seed | integer | Không |
variant | string | Không |
Phản hồi: 202, 422
POST/api/v1/w/{workspace_id}/tools/upscaleCreate an upscale job
Phạm vi: jobs:write
| Tên | Vị trí | Kiểu | Bắt buộc |
|---|---|---|---|
workspace_id | path | string (uuid) | Có |
| Trường | Kiểu | Bắt buộc |
|---|---|---|
input | string (uuid) | Có |
scale | integer | Có |
Phản hồi: 202, 422
GET/api/v1/whoamiIdentify the API key
Which workspace and plan the key belongs to, and the key's own scopes and expiry. Call it first: it gives the `workspace_id` the other routes need. Any valid key may call it, whatever its scopes. A browser session gets 401.
Phản hồi: 200