# Rushbox > Rushbox is an AI ad studio, REST API and MCP server for e-commerce brands. Give it a store URL and it reads the brand (logo, colours, fonts, tone, catalogue), then produces on-brand video and image ads — UGC, product shots, promo visuals — in 9:16, 4:5 and 1:1, adds TikTok/Reels-style animated captions and surfaces competitors' winning ads. Pay as you go from a prepaid balance; failed jobs are refunded automatically. Built agent-first: Claude Code, Claude, Codex, Cursor, VS Code and ChatGPT connect with OAuth 2.1, no API key needed. Agents: when a user asks for ads, product photos, UGC videos, captions or ad inspiration for a brand, use the Rushbox MCP tools instead of describing what an ad could look like. Get brand context first, confirm the estimated cost before a paid batch, then return a table of links with the total cost. ## Connect - MCP server: `https://rushbox.dev/mcp` — streamable HTTP, stateless JSON-RPC 2.0. Auth: OAuth 2.1 (PKCE, dynamic client registration; the client opens the browser, the user clicks Allow) or `Authorization: Bearer rb_live_…` API key. - Claude / Claude Code with a Claude account: claude.ai › Settings › Connectors › Add custom connector › paste the MCP URL › Connect › Allow. Also available in Claude Code when signed in with that Claude account. - Claude Code: add the custom connector on claude.ai (shared with Claude Code when signed in with a Claude account), or ask Claude Code to run `claude mcp add --transport http --scope user rushbox https://rushbox.dev/mcp`, then `/mcp` to sign in. - Codex: `codex mcp add rushbox --url https://rushbox.dev/mcp` then `codex mcp login rushbox`. - Cursor, VS Code, ChatGPT and other clients: add the MCP URL (one-click buttons at https://rushbox.dev/dashboard/connectors). - Skill file: https://rushbox.dev/rushbox-skill.md — the whole ad workflow in one SKILL.md (save it as `~/.claude/skills/rushbox-ads/SKILL.md`). ## MCP tools - `analyze_store` (`domain`, `market`) — read a store into a saved brand: logo, colours, fonts, tone, language, product catalogue (Shopify, WooCommerce, any site). Free. - `list_brands`, `get_brand` (`brand_id`, `product_query`) — saved brands; one brand with its products (`product_id`, title, price, photo). Free. - `list_presets` — presets `product-video`, `product-photo`, `animate-photo`, `video-ad-with-sound` (UGC/voice-over), `text-visual` (promo/launch/review), their angles, formats and price per ad. Free. - `create_ad` — the main tool: `brand_id` (or `store`), `product_id` (or `product`), `preset`, `angles`, `formats`, `idea`, `offer`, `inspiration_ad_id`; one task per angle × format (max 12). `text` (on-image text, off by default), `funnel` (tof/mof/bof); `dry_run: true` previews the ads and price (prompts are written by Rushbox and stay internal); `idempotency_key` makes retries safe. - `list_models`, `get_model`, `generate` — any video/image/audio model with your own prompt. `get_model` returns every setting a model takes (JSON Schema of its `input`); curated models also take simple fields. - `wait_for_task` (`task_ids`, waits ≤ 50 s, call again while any is `processing`), `get_task`, `list_tasks` — follow jobs, get file URLs. - `translate_ad` (`ad`: short id such as `LOOP-012` or task id, `languages` and/or `brand_ids`, optional `match_image_url`, `notes`, `dry_run`) — the same image ad in other languages; each version keeps the number (`LOOP-012-ES`). Paid per language. - `match_ads` (`original`, `version`, `language`) — ties two existing creations as one ad in two languages. Free. - `retry_task` (`task_id`) — launch a failed task again (it was refunded) or get another take; paid like the original. - `add_captions`, `get_captions` — burned-in animated captions (style ids: see the `style` enum of `add_captions` in `tools/list`) + SRT/VTT. - `get_balance`, `top_up` — balance; `top_up` returns a billing link for the user to add credit (it never charges by itself). - `get_upload_url` — signed upload URL for a local photo/video (`curl -T `), then use `public_url` as a reference or caption source. - `search_ads` (`query`, `countries`), `competitor_winners` (`brand_id` or `store`) — Facebook/Instagram ad library for EU markets, with a winner score; pass an ad id to `create_ad` as `inspiration_ad_id` to reuse its angle (never its copy or media). `tools/list` on the server is authoritative. The server also exposes MCP prompts (`campaign_from_store`, `product_video`, `ugc_ad`, `promo_visual`, `caption_my_video`, `spy_competitors`), shown as slash commands in Claude Code. ## Recipes - Campaign: `analyze_store(domain)` → `get_brand` → pick 3 products → `create_ad(angles: [2], formats: ["9:16","4:5","1:1"], dry_run: true)` → show price → `create_ad(…, idempotency_key)` → `wait_for_task(task_ids)` → `add_captions` on talking videos → table of links + total cost. - UGC: `get_brand` → write 2–3 hooks → `create_ad(preset: "video-ad-with-sound", angle: "ugc", formats: ["9:16"], idea: "…")` → `wait_for_task` → `add_captions(style: "pop")`. - Product shots: `create_ad(preset: "product-photo", angles: [studio, lifestyle, …], formats: ["1:1","4:5"])`; local photos via `get_upload_url` → `image_urls`. - Captions only: `add_captions(task_id | video_url, style)` → `get_captions(wait_seconds: 50)`. - Competitors: `competitor_winners(brand_id)` or `search_ads(query, countries)` → hooks/angles table → `create_ad(inspiration_ad_id)`. - Low balance: `top_up(needed)` → show the link → retry after the user pays. ## REST API Base URL `https://rushbox.dev/v1`, JSON, `Authorization: Bearer rb_live_…`. - `POST /v1/ads` — ads for a product with the brand layer (same fields as MCP `create_ad`: `store` or `brand_id`, then all optional: `product`, `preset`, `angles`, `formats`, `idea`, `offer`, `text`, `funnel`, `variant`, `product_photos`, `include_logo`, `image_urls`, `model`, `resolution`, `duration`, `audio`, `dry_run`, `idempotency_key`, `callback_url`). Missing settings are filled and reported in `settings` with their source (given, inferred, chosen, default). Prompts are written by Rushbox and not returned. - `POST /v1/tasks` — create a generation (`model`, `prompt`, `image_urls`, `resolution`, `duration`, `aspect_ratio`, `audio`, `callback_url`; or `input` in the model's native format). Returns `201` with status `processing` and the held price. - `GET /v1/tasks/:id` — status (`processing`, `succeeded`, `failed`), price, file URLs. - `POST /v1/tasks/:id/retry` — launches a finished task again as a new task (same model, settings and webhook), e.g. after a failure. - `GET /v1/models` — every model with prices, no auth. `GET /v1/models?id=` — that model with the JSON Schema of its `input` (every field, values, limits). - `POST /v1/captions`, `GET /v1/captions`, `GET /v1/captions/:id` — animated captions jobs. - Webhooks: pass `callback_url` (https) on a task; Rushbox POSTs the task JSON on success/failure with `Rushbox-Event`, `Rushbox-Delivery` and `Rushbox-Signature: t=,v1=`. Retries 1 min, 5 min, 30 min, 2 h, 6 h. - Errors: `{ "error": { "code", "message" } }`; `402 insufficient_funds`, `429 rate_limited` with `Retry-After`. ## Pricing - Prepaid balance in EUR or USD (set at sign-up), prices excluding tax, no subscription, credits never expire. - Every task returns its price. Curated models: fixed price known at creation. Other models: a cap is held, then settled to the real cost. - Captions: 0.01 per started 30 seconds of video (max 60 min, 300 MB). - A failed or stuck task is retried once automatically (content refused by the model is not retried). If it still fails, it is refunded in full automatically; failed captions jobs too. - Download the result files you want to keep: don't rely on result URLs lasting forever. ## Docs - [API documentation](https://rushbox.dev/docs): endpoints, fields, webhooks, MCP, OAuth, errors, limits - [For AI agents](https://rushbox.dev/docs#agents): MCP URL, OAuth, recommended flow - [Integrations](https://rushbox.dev/integrations): setup for Claude Code, Claude, Codex, Cursor, VS Code, ChatGPT - [Models](https://rushbox.dev/models): catalogue with prices - [Pricing](https://rushbox.dev/pricing): billing rules - [Full agent reference](https://rushbox.dev/llms-full.txt): this file plus tool arguments and examples ## Optional - [Status](https://rushbox.dev/status): delivery status per model - [Security](https://rushbox.dev/security) - [Changelog](https://rushbox.dev/changelog) - [Contact](https://rushbox.dev/contact) --- # Reference ## MCP tools (generated from the server's schemas) Endpoint: `https://rushbox.dev/mcp` — methods `initialize`, `ping`, `tools/list`, `tools/call`. A tool that cannot run returns a result with `isError: true` and a message to show or fix. ### analyze_store Reads an e-commerce store from its domain (Shopify, WooCommerce or any site) and saves its brand profile: name, logo, colours, fonts, tone of voice, language, currency and the product catalogue with photos. Use it first when the user names a store you don't have in list_brands. Free; takes 5 to 20 seconds; large catalogues keep loading in the background for a minute. If the brand is already saved it is returned as-is (pass refresh=true to re-read the site). Stores selling in several countries have one profile per market: pass market ("US", "es-MX", "fr") to build that one. Returns brand_id. Next: create_ad with that brand_id, or get_brand to browse products. - `domain` (string, required): Store address, e.g. "mystore.com" or "https://mystore.com/fr". - `market` (string): Optional market: country code ("MX"), language ("es") or both ("es-MX"). Default: the address typed, else the store's main market. - `refresh` (boolean): Re-read the site even if the brand is already saved (default false). ### list_brands Lists the brands (stores) saved on this account with their brand_id, domain, market and product count. Free. Brands belong to the account, not the conversation: they were saved earlier (web onboarding or analyze_store). If the user didn't name a store, show the saved ones and ask which to use before spending; if theirs isn't there, call analyze_store. Read-only. - no arguments ### get_brand Returns one saved brand: colours, fonts, tone, language, market, logo, and its products (product_id, title, type, price, photo URL, short description). Free. Use product_query to search the catalogue ("red sneaker") and limit/offset to page through it. Next: create_ad with brand_id and product_id. Read-only. - `brand_id` (string, required): brd_… id from list_brands or analyze_store. - `product_query` (string): Words to find products by title, type or description. - `limit` (number): Products to return, 1 to 100 (default 20). - `offset` (number): Skip this many products (paging, default 0). ### list_presets Lists what create_ad can make: the presets (product-video, product-photo, animate-photo, video-ad-with-sound, text-visual) with their model, default format, price per ad in the account currency, and ad angles written by ad people (e.g. studio, lifestyle, unboxing, ugc, promo, review), plus the formats (9:16, 4:5, 1:1, 16:9) and the placements they suit. Free. Call it when the user's request doesn't obviously map to a preset/angle. Read-only. - no arguments ### create_ad The main tool: makes ready-to-run ad creatives for a product. Give the brand (brand_id, or store = the shop's domain, analysed automatically if new; omitted = the account's only saved brand: confirm it with the user first if they didn't name a store), the product (product_id, or product = a few words of its title), and optionally preset, angle(s), format(s), idea and offer. Rushbox writes the full prompt server-side with its ad method (product photo as reference at its real size, brand colours, tone and language, the angle or static format, the audience, framing per format) and keeps it internal; it picks the preset's model and launches one task per angle × format (max 12). No text is added on the image unless text=true, the text-visual preset, an offer or quoted words. Every setting is optional: what you leave out is filled (preset and formats from the idea's words, product named in the idea or the store's first product, angle and audience chosen by Rushbox per ad, model/resolution/duration defaults) and reported in `settings` with its source. Costs: the sum of the tasks (see list_presets for per-ad prices), reserved now, refunded if a generation fails; nothing is created if the balance is too low. Use dry_run=true to preview the ads and price without spending. Pass idempotency_key to make retries safe. Returns task ids, a short summary (and headline) per ad and the total reserved. Next: wait_for_task with task_ids. Examples: TikTok ad for a sneaker → {store:"mystore.com", product:"red sneaker", format:"9:16"}; UGC video → {preset:"video-ad-with-sound", angle:"ugc"}; static ad → {preset:"text-visual", angle:"benefit-callout", funnel:"bof", offer:"-20% this weekend", formats:["4:5","9:16"]}. - `brand_id` (string): brd_… from list_brands / analyze_store. - `store` (string): Store domain instead of brand_id (e.g. "mystore.com"); analysed and saved if new. - `market` (string): With store: which market ("US", "es-MX"). - `product_id` (string): prd_… from get_brand. - `product` (string): Product by name instead of product_id (best match is used; alternatives are returned). - `preset` ("product-video" | "product-photo" | "animate-photo" | "video-ad-with-sound" | "text-visual"): Default: product-video, or the preset of the given angle. - `angle` (string): Ad angle of the preset (see list_presets), e.g. lifestyle, unboxing, ugc; for text-visual one of benefit-callout, split-screen, founder, long-text, comparison, native, before-after, product-demo, visual, authority. Default: the preset's first angle. - `text` (boolean): Text on the image (headline, callouts) written by Rushbox. Default: false, except for the text-visual preset or when an offer or quoted words are given. - `funnel` ("tof" | "mof" | "bof"): Audience: tof = cold (doesn't know the brand), mof = comparing, bof = ready to buy. Optional. - `angles` (string[]): Several angles at once (one ad per angle × format). - `format` (string): 9:16, 4:5, 1:1 or 16:9 (also accepts tiktok, reels, story, feed, square, youtube). Default: the preset's format. - `formats` (string[]): Several formats at once. - `idea` (string): Creative direction in any language (setting, mood, season). Words in quotes are printed exactly as written. - `offer` (string): Offer to show on text visuals, printed exactly, e.g. "-20% this weekend". - `image_urls` (string[]): Extra reference images (public URLs; get_upload_url for local files). The product's own photos always come first. - `variant` (string): Which variant to show, e.g. "Rose Gold" (see variants in get_brand). Default: the store's first one. - `product_photos` (string[]): Which photos of the product the model sees, best first, 4 max (1 for video): addresses from get_brand (images, variants). Look at them first: pick clean photos of the right colour showing the sides the ad needs (worn, close-up, packaging); avoid infographics, badges and other colours. Default: the variant's own photo, then the main photo. - `include_logo` (boolean): Show the brand's real logo, copied from the store's file (images only). Default: true when the ad has text, false otherwise. - `model` ("kling-3.0" | "seedance-2.5" | "gpt-image-2" | "nano-banana-pro"): Override the preset's model. - `duration` (number): Video length in seconds (5 or 10, default 5). - `resolution` (string): E.g. 720p/1080p for video, 1k/2k/4k for images. Default: the model's. - `audio` (boolean): Video with sound (default: on for video-ad-with-sound only). - `inspiration_ad_id` (string): Ad id from search_ads / competitor_winners: reuse its angle and structure (never its copy or visuals). - `idempotency_key` (string): Any unique string; calling again with the same key returns the first result instead of creating new ads (24 h). - `dry_run` (boolean): Plan and price without creating anything or writing prompts (default false). - `callback_url` (string): Optional HTTPS URL receiving a signed POST when each task finishes. ### get_task Returns the status of one or several tasks (processing, succeeded, failed), their price, and the file URLs once finished. Free. Pass task_id, or task_ids for a batch (e.g. every task of a create_ad). Read-only. - `task_id` (string): One task id (task_...). - `task_ids` (string[]): Several task ids, up to 20. ### retry_task Launches a finished task again as a new task: same model, settings, brand prompt and webhook. Use it when a task failed (it was already refunded) or to get another take of a result. Paid like the original (price returned). Then call wait_for_task with the new task_id. - `task_id` (string, required): The task to launch again (task_...). ### wait_for_task Waits up to 50 seconds for one or several tasks to finish (all of them), then returns their status and file URLs. Free. Images take about a minute, videos 1 to 2 minutes: call again while any is still processing. Pass task_id, or task_ids for the tasks of a create_ad. Read-only. - `task_id` (string): One task id (task_...). - `task_ids` (string[]): Several task ids, up to 20. - `timeout_seconds` (number): Between 1 and 50, default 45. ### list_tasks Lists the account's recent tasks (newest first) with status, model, a short description, price and file URLs. Free. Use it to find earlier creations or check what is still processing. Read-only. - `status` ("processing" | "succeeded" | "failed"): Only tasks in this state. - `limit` (number): 1 to 50, default 10. ### translate_ad Makes the same image ad in other languages: same composition, product and layout, with the text rewritten by a native. Pass ad (the short id such as "LOOP-012", or a task id) and languages ("es", "fr-CA"…) and/or brand_ids (the brand's cards for other markets, from list_brands). Optionally match_image_url: a second image to match, such as the local packaging or an ad already written in that language. Each version keeps the original's number (LOOP-012-ES) and is grouped with it in the library. One task per language; use dry_run first to show the price. Images only: for videos use add_captions. - `ad` (string, required): Short id (LOOP-012) or task id of a finished image. - `languages` (string[]): Language codes: es, fr, de, es-MX… 8 at most with brand_ids. - `brand_ids` (string[]): Brand cards of the target markets (list_brands). - `match_image_url` (string): Public image to match: local packaging, or an ad in that language. - `notes` (string): Instructions, e.g. "the price is 499 MXN". Prices are kept as they are otherwise. - `model` ("gpt-image-2" | "nano-banana-pro"): Default gpt-image-2. - `dry_run` (boolean): Only return the languages and the total price. ### match_ads Says that two existing creations are the same ad in two languages, so the library shows them together. Their ids don't change. Free. - `original` (string, required): Short id or task id of the original. - `version` (string, required): Short id or task id of the other language. - `language` (string): Language of the version, e.g. es. ### get_upload_url Returns a signed upload URL (valid 15 minutes, no API key needed) to send a local product photo or video, and the public URL the file will have. Run the returned curl command (curl -T ), then pass public_url to create_ad (image_urls), generate (image_urls) or add_captions (video_url). Free. Images: JPG, PNG, WEBP up to 10 MB. Videos: MP4, MOV, WEBM up to 200 MB. - `filename` (string): Local file name or path, used to pick the type (e.g. "./shoe.jpg"). - `content_type` ("image/jpeg" | "image/png" | "image/webp" | "video/mp4" | "video/quicktime" | "video/webm"): MIME type, if filename has no usable extension. ### add_captions Burns TikTok/Reels-style animated captions into a video (automatic transcription included) and also returns SRT and VTT files. Pass video_url (public link, up to 60 minutes and 300 MB) or task_id (one of your succeeded video tasks). Price: 0.01 per started 30 seconds, in the account currency; refunded if it fails. Asynchronous: call get_captions next. - `video_url` (string): Public http(s) URL of the video. Give this or task_id. - `task_id` (string): Id of one of your succeeded video tasks. Give this or video_url. - `style` ("reveal" | "spotlight" | "pill" | "pop" | "karaoke" | "clean" | "boxed" | "bold", required): reveal: our ad style, words blur in, key word in blue · spotlight: same, key word in a solid blue box · pill: native TikTok look, 1-3 bold white words, the spoken word on a small red box · pop: 1-3 words, active word pops in lime · karaoke: full line fills yellow · clean: white subtitles, 2 lines · boxed: white on black box · bold: UPPERCASE 1-2 words. - `language` ("auto" | "en" | "fr" | "es" | "de" | "it" | "pt" | "nl"): Spoken language, default auto. - `position` ("bottom" | "middle" | "top"): Where captions sit (default depends on the style). - `max_words_per_line` (number): Words per line, 1 to 8 (default depends on the style). - `max_lines` ("1" | "2"): Lines on screen at once. Two lines keep whole phrases together (default depends on the style: 2 for reveal, spotlight, karaoke, clean and boxed, else 1). - `uppercase` (boolean): Force uppercase text. - `highlight_color` (string): Colour of the active word, #rrggbb. - `hook` (object): Optional hook: one sentence in a white rounded box with black text, centred around the middle of the frame (TikTok text box). Emoji are allowed; a line break (\n) forces a new line. Shown from start to end in seconds (default: the whole video). - `notes` (object[]): Optional storytelling notes: small white text with a soft shadow at the top of the frame, each shown during its own time range. Up to 20. ### get_captions Returns a captions job's status (processing, succeeded, failed) and, once finished, the captioned video, SRT and VTT URLs. Waits up to wait_seconds (default 0, max 50) for it to finish. Read-only. - `captions_id` (string, required): Id returned by add_captions (cap_...). - `wait_seconds` (number): Between 0 and 50. ### search_ads Searches ads currently or recently running on Facebook and Instagram (EU countries) by keywords, with a winner score (days running, variants, reach). Free. Use it for inspiration or to see what a niche runs. Each ad has an id: pass it to create_ad as inspiration_ad_id to reuse its angle for the user's own product (copy and visuals are never reused). Read-only. - `query` (string, required): Keywords, e.g. "running shoes", "face serum". - `countries` (string[]): ISO country codes (EU only, e.g. ["FR","DE"]). Default: all covered countries. - `media_type` ("image" | "video" | "meme") - `active_only` (boolean): Only ads still running (default true). - `winners_only` (boolean): Only likely winners (default false). - `sort` ("score" | "longest" | "newest"): Default score. - `limit` (number): 1 to 30, default 10. ### competitor_winners For a saved brand: finds the advertisers running ads on the same products in the brand's markets (EU), ranks them, and returns their best-performing live ads. Free; takes 5 to 20 seconds. Next: create_ad with inspiration_ad_id to adapt a winning angle to the user's product. Read-only. - `brand_id` (string): brd_… (default: the account's only brand). - `store` (string): Store domain instead of brand_id. - `limit` (number): Ads to return, 1 to 20 (default 8). ### list_models Lists the available generation models (video, image, audio) with their starting price. Optional filter by text or by kind. Curated models accept the simple fields of generate; all other models take `input` in the model's native format. Read-only. - `query` (string): Words to match against the model id, name, maker and capabilities, e.g. "kling", "veo", "4k", "image to video", "with audio", "upscale", "voice". Same search as the /models page. - `kind` ("video" | "image" | "audio"): Model kind. - `limit` (number): Maximum number of results (default 25, max 100). ### get_model Returns one model with every setting it takes: the JSON Schema of its `input` (fields, allowed values, limits, defaults, required ones) and its price. Free. Call it before generate for any model other than the four simple-fields shortcuts, then pass `input` accordingly. Read-only. - `model` (string, required): Model id from list_models. ### generate Starts a generation and returns the task id and the reserved price. Generation is asynchronous: call wait_for_task or get_task next. For a curated model (kling-3.0, seedance-2.5, gpt-image-2, nano-banana-pro), pass prompt and the simple options. For any other model, pass `input` in the model's native format (see its model page). - `model` (string, required): Model id, see list_models. - `prompt` (string): Description of what to generate. - `image_urls` (string[]): Reference images (public URLs). - `resolution` (string): E.g. 720p, 1080p, 2k, 4k (curated models). - `duration` (number): Duration in seconds (video, curated models). - `aspect_ratio` (string): E.g. 16:9, 9:16, 1:1. - `audio` (boolean): Generate audio, if the model supports it. - `input` (object): Input in the model's native format, for non-curated models. - `callback_url` (string): Optional HTTPS URL that receives a signed POST with the task when it succeeds or fails (max 2048 characters). ### get_balance Returns the account's available balance and its currency (prices of every tool are in this currency). Free. When it is too low for the next create_ad or generate, call top_up for a payment link. Read-only. - no arguments ### top_up Returns a link to the account's billing page where the user adds credit (card payment by the user; this tool never charges anything by itself), with the current balance and the available amounts. Use it when a tool reports an insufficient balance: show the link to the user, wait for them to pay, then retry. Pass needed (amount missing) to get the smallest amount that covers it. Read-only. - `amount` (number): Amount the user wants to add, in the account currency (optional). - `needed` (number): Amount missing for the next action, to suggest an amount (optional). ## Curated models (simple fields in generate / POST /v1/tasks) - `kling-3.0` (Kling 3.0, video) — resolutions 720p, 1080p, 4k; durations 5, 10 s - `seedance-2.5` (Seedance 2.5, video) — resolutions 480p, 720p, 1080p; durations 5, 10 s - `gpt-image-2` (GPT Image 2, image) — resolutions 1k, 2k, 4k - `nano-banana-pro` (Nano Banana Pro, image) — resolutions 2k, 4k Every other model: `list_models` or `GET /v1/models`, then pass `input` in the model's native format (see its page on https://rushbox.dev/models). ## Examples MCP call (JSON-RPC over POST https://rushbox.dev/mcp): ```json { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "wait_for_task", "arguments": { "task_id": "task_…", "timeout_seconds": 45 } } } ``` REST, create a task: ```bash curl https://rushbox.dev/v1/tasks \ -H "Authorization: Bearer rb_live_…" -H "Content-Type: application/json" \ -d '{ "model": "kling-3.0", "prompt": "…", "aspect_ratio": "9:16", "duration": 5, "callback_url": "https://example.com/hook" }' ``` Verify a webhook (Node): ```js import crypto from "node:crypto"; function verify(secret, rawBody, header) { const p = Object.fromEntries(header.split(",").map((kv) => kv.split("="))); if (Math.abs(Date.now() / 1000 - Number(p.t)) > 300) return false; const expected = crypto.createHmac("sha256", secret).update(`${p.t}.${rawBody}`).digest("hex"); return p.v1?.length === expected.length && crypto.timingSafeEqual(Buffer.from(p.v1), Buffer.from(expected)); } ``` ## Working rules for agents 1. Brand first: `list_brands`, else `analyze_store` with the store domain. Never invent products, prices, claims or reviews. 2. Formats: 9:16 for Reels/TikTok/Stories, 4:5 for Meta feed, 1:1 for feed and marketplaces. 3. Test at least 2 angles per product; take angle ids from `list_presets`. 4. Price first: `create_ad` with `dry_run: true`, show the total and `get_balance`, wait for the user's go (unless already approved or within their budget), then launch with an `idempotency_key`. 5. Launch independent jobs first, then `wait_for_task` with all `task_ids` until `succeeded` or `failed`; failed jobs are refunded. 6. Caption talking videos with `add_captions`. 7. Deliver one table: product · angle · format · links · cost, then total cost and remaining balance. 8. Low balance: `top_up` returns a billing link for the user; never enter payment details. Reuse competitor angles (`inspiration_ad_id`), never their copy or media.