Chuyển đến nội dung

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

Khóa

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.

Thử lại

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.

429

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

Tác vụ

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.

Sự cố

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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
limitqueryintegerKhông
cursorquerystringKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
titlestringCó
product_idstring (uuid)Có
brand_idstring (uuid)Không
briefBriefInCó
aspect9:16 | 1:1 | 4:5 | 16:9Không
delivery_modestill | videoKhông
voice_idstring (uuid)Không
video_qualitystandard | premiumKhông
video_modelstringKhông
keyframe_qualitystandard | premiumKhông
talkingbooleanKhông
cast_modeauto | noneKhông
captionsoff | wordsKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
revintegerCó
cast_modeauto | noneKhông
titlestringKhông
brand_idstring (uuid)Không
briefBriefInKhông
delivery_modestill | videoKhông
voice_idstring (uuid)Không
lookstringKhông
keyframe_qualitystandard | premiumKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
revintegerCó
axesAxisIn[]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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (uuid)Có
expires_inqueryintegerKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
cut_idsstring (uuid)[]Có
aspects1: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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
refinemore_premium | more_playful | shorter_lines | new_ideaKhông
overwritebooleanKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
actionkeyframes_preview | render | exportsCó
shot_idsstring (uuid)[]Không
cut_idsstring (uuid)[]Không
aspects1: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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
revintegerCó
scenesSceneIn[]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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
cast_member_idstring (uuid)Không
no_castbooleanKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
ad_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
duration_squeryintegerKhông
aspectquery9:16 | 1:1 | 4:5 | 16:9Khô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
kindquerystringKhông
cursorquerystringKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
asset_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
asset_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
asset_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
asset_idpathstring (uuid)Có
expires_inqueryintegerKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
urlstringCó

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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
filenamestringCó
mimestringCó
bytesintegerCó
sha256stringCó

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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
asset_idsstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
cursorquerystringKhông
limitqueryintegerKhông

Phản hồi: 200, 422

GET/api/v1/w/{workspace_id}/castList cast members

Phạm vi: jobs:read

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có

Phản hồi: 200, 422

POST/api/v1/w/{workspace_id}/castCreate a cast member

Phạm vi: jobs:write

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
namestringCó
visual_descriptionstringCó

Phản hồi: 202, 422

POST/api/v1/w/{workspace_id}/cast/{member_id}/approveApprove a cast portrait

Phạm vi: jobs:write

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
member_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
portrait_asset_idstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
member_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
kindstringCó
paramsobjectKhông

Phản hồi: 200, 422

GET/api/v1/w/{workspace_id}/eventsStream job events

Phạm vi: jobs:read

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
kindquerystringKhông
statusquerystringKhông
cursorquerystringKhông
limitqueryintegerKhông
ad_idquerystring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
job_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
job_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
keyframe_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
keyframe_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
keyframe_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
limitqueryintegerKhông
cursorquerystringKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
namestringKhông
descriptionstringKhông
brand_idstring (uuid)Không
attributesobjectKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
product_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
product_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
product_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
namestringKhông
descriptionstringKhông
brand_idstring (uuid)Không
attributesobjectKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
product_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
product_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
asset_idstring (uuid)Có
rolestringKhông
captionstringKhông
sortintegerKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
product_idpathstring (uuid)Có
image_idpathstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
urlstringCó

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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
industryqueryfashion | beauty | food_drink | electronics | home | sports | otherKhông
langqueryen-US | vi-VN | en | viKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
keypathstringCó
langqueryen-US | vi-VN | en | viKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
keypathstringCó
Nội dung JSON
TrườngKiểuBắt buộc
versionintegerCó
product_idstring (uuid)Không
upload_idsstring (uuid)[]Không
requeststringKhông
overridesMakeOverridesKhông
qualityquick | publishCó
languageen-US | vi-VN | en | viKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
kindpathstringCó
secondsqueryintegerKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
promptstringCó
inputsstring (uuid)[]Có
cast_member_idstring (uuid)Không
seedintegerKhông
variantstringKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
promptstringCó
negativestringKhông
widthintegerCó
heightintegerCó
countintegerCó
seedintegerKhông
variantstringKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
promptstringCó
negativestringKhông
secondsintegerCó
resolutionstringCó
inputstring (uuid)Không
seedintegerKhông
variantstringKhô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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
inputstring (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

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
promptstringCó
negativestringKhông
secondsintegerCó
resolutionstringCó
inputstring (uuid)Không
seedintegerKhông
variantstringKhông

Phản hồi: 202, 422

POST/api/v1/w/{workspace_id}/tools/upscaleCreate an upscale job

Phạm vi: jobs:write

Tham số
TênVị tríKiểuBắt buộc
workspace_idpathstring (uuid)Có
Nội dung JSON
TrườngKiểuBắt buộc
inputstring (uuid)Có
scaleintegerCó

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