Skip to content
AdRecast

Developers

API & MCP docs

Run the whole remake flow from code or an AI agent: find a template → upload product images → review the script → estimate → generate → poll → export. Billing, credit holds and trial rules are identical to the web app.

Authentication

Create a key in Settings → API keys (scopes read / write / spend) and send it as a Bearer token. Keys are shown once.

Authorization: Bearer rk_live_…

Cost rules

MCP

Remote MCP server (streamable HTTP): https://adrecast.com/api/mcp

{
  "mcpServers": {
    "adrecast": {
      "url": "https://adrecast.com/api/mcp",
      "headers": { "Authorization": "Bearer ${ADRECAST_API_KEY}" }
    }
  }
}

Remake proven video ads for the user's product. Flow: search_templates → create_upload_url (PUT each product image) → create_project → poll get_project → get_script / update_script → estimate_cost (show the user) → generate_video with confirm=true → poll get_job / list_clips → export_video confirm=true → get_export.download_url. Never set confirm=true without the user approving the credit estimate. Resolutions: 720p, 1080p, 2K.

REST v1

Base URL https://adrecast.com/api/v1 · OpenAPI /api/v1/openapi.json

EndpointMCP toolDescription
POST /templates/searchsearch_templatesSearch the Meta Ad Library (cached, budgeted) for ads to remake. Each result has a remake_url you can pass to create_project as source {type:"url"}. Free for you; results cached 6 h.
POST /uploadscreate_upload_urlGet a signed URL to upload ONE image (jpeg/png/webp ≤10 MB) or a source video. kind=product_image (default): pass `path` in create_project.product.image_paths (1–6 required). kind=person_image: a presenter reference photo for create_character.image_paths. kind=voice_sample: an audio recording (mp3/wav/m4a/webm/ogg ≤20 MB, ≥30 s) for clone_character_voice. kind=video: source upload. PUT the raw bytes to upload_url with the given Content-Type.
POST /projectscreate_projectCreate a project from ONE set of materials: source ad (url / template / upload), product info + uploaded image paths, an optional presenter (character_id from create_character, or an inline character {name?, description?, image_paths?, likeness_consent} saved to the library) and the script mode: replica (default, 1:1 remake of the source script) or brief (script_brief {instruction?, tone?, target_duration_s?} → a new script written in one pass). Requires the $1 trial or a top-up first (402 payment_required otherwise); analysis and script are included. The project stops at phase script_review for the user to review / edit, then confirm_script (auto_confirm=true skips review; auto_generate=true is one-click: script and stills are confirmed automatically and every video starts, needs the spend scope). Optional scene_image_paths (≤4 product_image paths: every shot is set in that place) and audio_mode=source (keep the own voice + music of the source video, lip-synced; script and language stay those of the source). Script mode (script_mode): replica (default) = the spoken lines of the source, word for word, only the source brand/product name swapped for yours (silent clips stay empty); brief = write the script from script_brief {instruction?, tone?, target_duration_s?}. Resolution (720p | 1080p | 2K) is fixed here.
POST /characterscreate_characterSave a reusable on-screen presenter: an appearance description and/or 1–3 person reference photos (create_upload_url kind=person_image). Photos require likeness_consent=true (you have the right to use this person's likeness). Free. Moderated automatically before first use: minors and celebrities / public figures are rejected (moderation_status pending → approved | rejected). Use the id as create_project.character_id or set_project_character.
GET /characterslist_charactersYour character library (newest first) with moderation_status.
DELETE /characters/{character_id}delete_characterRemove a character from your library (its cloned voice, if any, is deleted too). Projects already using it are unaffected.
PATCH /characters/{character_id}update_characterRename a library character and/or set its voiceover voice: voice=none (default narrator) or voice=preset with voice_id from list_voices. Free. Replacing a cloned voice deletes the clone.
POST /characters/{character_id}/voice-cloneclone_character_voiceInstant Voice Clone from a recording of at least 30 s (create_upload_url kind=voice_sample). Requires voice_consent=true (your own voice or you are authorized by the speaker). SPENDS 1000 credits (fixed): without confirm=true returns confirmation_required with the price. Async: poll list_characters until voice.status is ready or failed (failed releases the credits). Deleting the character deletes the clone. Unused clones are deleted after 60 days (voice.expires_at; any voiceover with it extends it). When the voice service is full it fails with voice_slots_full and nothing is charged.
POST /characters/{character_id}/voice-keepkeep_character_voiceExtend a ready cloned voice by 60 days from max(now, voice.expires_at). SPENDS 1000 credits: without confirm=true returns confirmation_required with the price.
GET /voiceslist_voicesVoices a character can use: free preset voices (MiniMax) and your own cloned voices, plus clone_credits (price of clone_character_voice; cloning is currently disabled).
PUT /projects/{project_id}/characterset_project_characterBefore any video is generated: switch the project presenter to a library character (character_id) or back to automatic (null), and regenerate the look. Look regenerations: 3 free per character, then 20 credits. Fails with video_started once video generation began.
GET /projectslist_projectsList your 50 most recent projects.
GET /projects/{project_id}get_projectProject status (phase: analyzing → scripting → script_review → storyboard → generating → editing), the source-ad analysis, and active jobs. In script_review the script waits for the user: edit / add / delete / reorder lines or rewrite_script, then confirm_script.
GET /projects/{project_id}/scriptget_scriptOrdered script lines (one per clip) with spoken line_text, visual_desc and status. script_review=true means the script is still in review (all edits free, structure editable). still_regen_on_edit marks lines whose still is regenerated when edited after confirm.
PATCH /projects/{project_id}/scriptupdate_scriptEdit line_text / visual_desc. In script_review: free. After confirm_script: allowed for scenes without video; a scene that already has a still gets ONLY that still regenerated (3 free regenerations per scene, then 20 credits; resend with confirm=true when the response is confirmation_required). Scenes with video return clip_locked (use revise).
POST /projects/{project_id}/script/rewriterewrite_scriptRewrite the whole script from an instruction (e.g. "funnier, lead with the guarantee"), an optional tone (friendly | energetic | premium | humorous | urgent | calm | authentic) and an optional target_duration_s (5–120). The scene count is kept unless the target length needs more or fewer scenes. Only while phase = script_review (before confirm_script); FREE, applied automatically, max 5 per project per day. Returns rewrite_id; poll get_rewrite. After confirm use update_script for single lines or revise for clips with video.
POST /projects/{project_id}/clips/{clip_id}/stillregenerate_stillMake a new still for one scene (clip_id from get_script / list_clips). Use it to retry a still that failed (status still_pending with no still job running) or to re-roll a still that is ready / confirmed. Optional visual_desc replaces the scene's visual description. Scenes with video return clip_locked (use redo_scene). 3 free regenerations per scene, then 20 credits: without confirm=true a paid regeneration returns confirmation_required with the estimate; resend with confirm=true. A running still job returns still_in_progress. Poll list_clips or get_job.
POST /projects/{project_id}/clips/{clip_id}/redoredo_sceneRedo one rendered scene (status done or flagged): a new still and video (kind=visual, the default, with optional instruction describing the change) or a re-voiced video (kind=voice, instruction = the new spoken line). A scene QC flagged gets its first redo free; every other redo costs 80% of generating the scene again. Without confirm=true a paid redo returns confirmation_required with the estimate (the free redo never asks). Returns job_id, free and credits. Poll get_job, then list_clips. Scenes not yet rendered return not_redoable.
GET /rewrites/{rewrite_id}get_rewriteStatus of a rewrite (queued → applied | failed). Re-read get_script after applied.
POST /projects/{project_id}/variants/hookcreate_hook_variantCreate a new sequence that swaps only the opening (hook) line for hook_text and regenerates just that clip; everything else is reused for free. The regenerated clip is charged like normal generation.
GET /hookslist_hook_formulasThe 12-formula hook library (zh / en). With project_id each formula comes filled from that project's own product info ({product}, {benefit}, {audience}); formulas the product info cannot support honestly (e.g. no number in the selling points) are marked available=false. Free.
GET /variant-styleslist_variant_stylesPreset looks for style-swap variants (key, zh / en name). Generic visual styles only; no studio or brand names. Free.
POST /projects/{project_id}/variants/estimateestimate_variantsPlan + price a variant batch on a project whose base video is finished. hooks: [{formula | text, visual?}] swaps the opening line AND makes a new opening image; characters: [{user_character_id (approved library character) | ai_description}] swaps the presenter on talking shots; products: [{product_id from add_variant_product}] swaps the product; scripts: [{instruction}] rewrites every spoken line keeping the beats (each shot's length locked ±15%, stills reused, re-voiced + re-rendered); styles: [{key}] re-renders every shot in a preset look (list_variant_styles; generic looks only, product kept as in its photo). Script + product cannot be crossed in one matrix. mode=each (one variant per choice) or matrix (all combinations). Max 10 variants. Price = ONLY the regenerated video seconds × the normal credits per second (720p 40, 1080p 50, 2K 60; multi-person dialogue shots ×1.5 exactly as in normal generation, single-speaker talking shots are not); new stills included, unchanged shots free, no per-variant fee. ALWAYS show this to the user before create_variants.
POST /projects/{project_id}/variantscreate_variantsRun a variant batch (same input as estimate_variants). SPENDS CREDITS: without confirm=true returns confirmation_required with the estimate. The estimate is frozen once for the whole batch; the first variant runs as a pilot and the rest only start after it succeeded (a failed pilot stops the batch). You are charged for the seconds actually generated, never more than the estimate. auto_export (default true) renders each finished variant as a free 9:16 export named {product}_{project}_{H#_C#_P#[_S#][_R#]}_{lang}_9x16_{date}.mp4. Optional max_credits caps the batch. Poll list_variants.
GET /projects/{project_id}/variantslist_variantsBase + every variant of a project: code (H#_C#_P#), status, which shots were regenerated vs reused, per-shot video URLs (for side-by-side comparison), exports with versioned file names and download URLs, recent batches with frozen vs used credits.
GET /projects/{project_id}/variants/manifestget_variant_manifestCSV of the project's variants (optionally one batch_id): filename, code, hook line, character, product, language, seconds, status, utm_content (= lower-case code, for ad naming / UTM) and download_url.
POST /projects/{project_id}/variants/productsadd_variant_productAdd another product to a project for product-swap variants: name, selling_points (the only source of claims for its lines) and 1–4 image_paths from create_upload_url (kind=product_image). Free. Returns product_id for estimate_variants / create_variants products.
POST /variant-batches/{batch_id}/cancelcancel_variant_batchStop a running batch. Seconds already generated are charged; the rest of the frozen credits are released.
POST /projects/{project_id}/script/linesadd_lineOnly in script_review: insert a new line (scene) after after_clip_id (null = first) with line_text (empty = b-roll) and/or visual_desc. Free; its still is made after confirm_script. Max 12 lines. Returns the new clip_id and the updated estimate.
DELETE /projects/{project_id}/script/lines/{clip_id}delete_lineOnly in script_review: remove a line (at least one must remain). Returns the updated estimate.
PUT /projects/{project_id}/script/lines/orderreorder_linesOnly in script_review: set the line order. clip_ids must list every line of the project exactly once (see get_script).
POST /projects/{project_id}/script/confirmconfirm_scriptLock the reviewed script (phase script_review → storyboard) and start the look + storyboard stills (free). After this, lines can no longer be added, deleted, reordered or rewritten; single-line edits via update_script regenerate only that scene's still. Idempotent. Unpaid accounts get script_only.
POST /projects/{project_id}/estimateestimate_costCredit estimate for generating video for the given clips (default: all clips with ready stills), plus current balance and shortfall. 100 credits = $1. ALWAYS call this and show the user before generate_video.
POST /projects/{project_id}/generategenerate_videoGenerate video for clips. SPENDS CREDITS: without confirm=true it only returns the estimate (error confirmation_required). Set confirm=true only after the user approved the estimate; optional max_credits caps spend. pilot=true renders the riskiest clip first.
GET /projects/{project_id}/jobslist_jobsRecent jobs for a project.
GET /projects/{project_id}/clipslist_clipsClips with status and still / video preview URLs.
POST /projects/{project_id}/exportsexport_videoRender the final ad (720p | 1080p | 2K, default = project resolution, no upscaling; 9:16 free; 1:1 / 16:9 re-frame costs 20 credits/s). Captions: subtitle_style defaults to 'source' = the original ad's caption style (font, size, colour, highlight, uppercase, position); classic / bold / karaoke are presets over it. burn_subtitles defaults to on, unless the source ad had no spoken captions (then none are burned). Requires confirm=true. Returns export_id; poll get_export for download_url.
GET /jobs/{job_id}get_jobStatus of one job (queued | running | paused | succeeded | failed). Poll every 10–30 s or use webhooks.
GET /exports/{export_id}get_exportExport status and download_url (+ srt_url) once done.
GET /balanceget_balanceAvailable and frozen credits. 100 credits = $1.
POST /studio/quotestudio_quotePrice one Studio generation without starting it: credits frozen now, total_credits (text_to_video: first frame + video) and the unit price. Image kinds are per image, video and talking_avatar per second. Prices are 0.8× the matching remake price (100 credits = $1). Outputs carry no watermark (trial accounts run 1 job at a time). Failures release the frozen credits automatically. ALWAYS show this to the user before create_studio_generation.
POST /studiocreate_studio_generationStart one Studio generation: text_to_image, image_edit, image_to_video, first_last_frame, talking_avatar or text_to_video. You choose only resolution, duration and aspect. SPENDS CREDITS: without confirm=true returns confirmation_required with the quote; nothing is frozen. Prompts and input images are moderated before any spend (rejected → credits released). text_to_video makes the first frame first (status awaiting_confirm), then needs confirm_studio_video (or discard_studio_video). Errors: payment_required (needs the $1 trial or a top-up), insufficient_credits, busy (concurrent job limit of your plan), daily_cap (new accounts), studio_paused (try later), not_owned (an input is not yours). Poll get_studio_generation. Prices are 0.8× the matching remake price (100 credits = $1). Outputs carry no watermark (trial accounts run 1 job at a time). Failures release the frozen credits automatically.
GET /studiolist_studio_generationsYour Studio generations, newest first (limit ≤100, before = created_at cursor; next_before pages on), plus the current price table.
GET /studio/assetslist_studio_assetsImages you can pass as create_studio_generation.input_keys: your product and character photos, recent project stills and Studio images. Each has key, a preview url and source. Free.
GET /studio/{generation_id}get_studio_generationStatus (queued → running → succeeded | failed | rejected | cancelled; text_to_video stops at awaiting_confirm with first_frame_url and video_credits; reconciling = delivery unclear, refunded automatically within 24 h), output URLs, credits frozen / charged (trial_watermark is always false, kept for compatibility). Poll every 10–30 s.
POST /studio/{generation_id}/confirmconfirm_studio_videotext_to_video at awaiting_confirm: freeze the video seconds and start the video from the first frame. SPENDS CREDITS: without confirm=true returns confirmation_required with the price and first_frame_url. The price is derived server-side from the generation's resolution and duration. Fails with not_awaiting_confirm otherwise.
POST /studio/{generation_id}/discarddiscard_studio_videotext_to_video at awaiting_confirm: drop the first frame instead of making the video. Nothing more is charged (the first frame stays charged). Fails with not_awaiting_confirm otherwise.
POST /studio/{generation_id}/savesave_studio_outputCopy output image `index` of a succeeded image generation into your library: as=product returns a key for create_project.product.image_paths; as=character also creates a library character (consent=true required; moderated like any person photo). Free.

Example

API=https://adrecast.com/api/v1
H="Authorization: Bearer $ADRECAST_API_KEY"
curl -s -X POST $API/templates/search -H "$H" -H 'Content-Type: application/json' -d '{"query":"vitamin c serum"}'
curl -s -X POST $API/projects/$PID/estimate -H "$H" -H 'Content-Type: application/json' -d '{}'
curl -s -X POST $API/projects/$PID/generate -H "$H" -H 'Content-Type: application/json' \
  -H "Idempotency-Key: gen-$PID-1" -d '{"confirm":true,"max_credits":600}'

Webhooks

Events job.completed / job.failed. Verify the signature:

AdRecast-Signature: t=<unix>,v1=<hex>      // same value also sent as legacy Replica-Signature
v1 = HMAC_SHA256(secret, "<t>.<raw body>")   // reject if |now - t| > 300 s; dedupe by body.id

Agent skill

A SKILL.md for Claude / Cursor-style agents: SKILL.md (generic: ad-remake-api) · 48 tools.