[{"data":1,"prerenderedAt":490,"buildId":491},["ShallowReactive",2],{"blog:article:ai-video-generation-api-node-js":3,"catalog":154},{"article":4,"related":128,"studioPath":153},{"slug":5,"path":6,"title":7,"description":8,"category":9,"categoryLabel":10,"date":11,"updated":11,"readingMinutes":12,"models":13,"featured":17,"primaryKeyword":18,"keywords":19,"words":28,"toc":29,"blocks":55,"faq":122},"ai-video-generation-api-node-js","\u002Fblog\u002Fai-video-generation-api-node-js","AI Video Generation API in Node.js: A Working Script","AI video API Node JS guide: submit a clip with fetch, poll with a backoff, stream the MP4 to disk, verify webhooks and type it all from OpenAPI.","guides","Guides","2026-11-28",5,[14,15,16],"seedance-2-5","veo-3-1","fp-motion-1",false,"ai video api node js",[18,20,21,22,23,24,25,26,27],"video generation api javascript","ai video api typescript","veo api nodejs","wan api node","wan api javascript","hailuo api nodejs","runway api nodejs","flux api nodejs",1186,[30,34,37,40,43,46,49,52],{"id":31,"text":32,"level":33},"what-you-need","What you need",2,{"id":35,"text":36,"level":33},"submit-a-clip-with-fetch","Submit a clip with fetch",{"id":38,"text":39,"level":33},"poll-with-a-backoff","Poll with a backoff",{"id":41,"text":42,"level":33},"stream-the-file-to-disk","Stream the file to disk",{"id":44,"text":45,"level":33},"verify-a-webhook-signature-in-node","Verify a webhook signature in Node",{"id":47,"text":48,"level":33},"typescript-types-from-the-openapi-spec","TypeScript types from the OpenAPI spec",{"id":50,"text":51,"level":33},"veo-wan-hailuo-or-runway-from-node-js","Veo, Wan, Hailuo or Runway from Node.js",{"id":53,"text":54,"level":33},"faq","FAQ",[56,59,63,65,69,71,74,76,79,81,84,86,89,91,93,96,98,100],{"type":57,"html":58},"html","\u003Cp>To generate AI video from Node.js, you \u003Ccode>POST\u003C\u002Fcode> a prompt to a video generation API with \u003Ccode>fetch\u003C\u002Fcode>, read the job until it settles, then stream the file to disk. On Frameport those are the same three calls for all 13 video models on one key, with no SDK: Node 18 and later have \u003Ccode>fetch\u003C\u002Fcode> built in.\u003C\u002Fp>\n\u003Cp>This guide builds that script as one ES module: submit with retries that never charge twice, poll with a backoff and a deadline, download without holding the clip in memory, verify webhooks, and get TypeScript types from the OpenAPI spec. Every field and header is the real API&#39;s.\u003C\u002Fp>\n\u003Ch2 id=\"what-you-need\">What you need\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>Node.js 18 or later. The webhook part uses Express (\u003Ccode>npm install express\u003C\u002Fcode>); the rest needs no package.\u003C\u002Fli>\n\u003Cli>An API key: \u003Ca href=\"\u002Fsignup\">create an account\u003C\u002Fa>, add funds under Billing (from $10), then create a key under API keys. It starts with \u003Ccode>fp_live_\u003C\u002Fcode> and is shown once.\u003C\u002Fli>\n\u003Cli>The key in an environment variable, read on your server only. Never ship it to a browser.\u003C\u002Fli>\n\u003C\u002Ful>",{"type":60,"lang":61,"code":62},"code","curl","export FRAMEPORT_API_KEY=\"fp_live_...\"",{"type":57,"html":64},"\u003Cp>Every snippet below goes in the same file, \u003Ccode>clip.mjs\u003C\u002Fcode>, under this helper. It sends the key, parses the JSON and turns an error answer into an exception that carries the status, the stable \u003Ccode>code\u003C\u002Fcode> and the \u003Ccode>Retry-After\u003C\u002Fcode> delay.\u003C\u002Fp>",{"type":60,"lang":66,"code":67,"title":68},"node","import { randomUUID } from 'node:crypto'\nimport { createWriteStream } from 'node:fs'\nimport { Readable } from 'node:stream'\nimport { pipeline } from 'node:stream\u002Fpromises'\nimport { setTimeout as sleep } from 'node:timers\u002Fpromises'\n\nconst API = 'https:\u002F\u002Fframeport.ai\u002Fv1'\nconst HEADERS = {\n  'Authorization': `Bearer ${process.env.FRAMEPORT_API_KEY}`,\n  'Content-Type': 'application\u002Fjson',\n}\n\nasync function api(path, init = {}) {\n  const res = await fetch(`${API}${path}`, { ...init, headers: { ...HEADERS, ...init.headers } })\n  const body = await res.json().catch(() => ({ error: { code: `http_${res.status}`, message: res.statusText } }))\n  if (!res.ok) {\n    const error = new Error(`${body.error.code}: ${body.error.message}`)\n    error.status = res.status\n    error.code = body.error.code\n    error.retryAfter = Number(res.headers.get('retry-after')) || 0\n    throw error\n  }\n  return body\n}","clip.mjs: the shared helper",{"type":57,"html":70},"\u003Ch2 id=\"submit-a-clip-with-fetch\">Submit a clip with fetch\u003C\u002Fh2>\n\u003Cp>\u003Ccode>POST \u002Fv1\u002Fvideos\u002Fgenerations\u003C\u002Fcode> checks the request, holds its price on your balance and answers at once with \u003Ccode>202 Accepted\u003C\u002Fcode>: the generation, its \u003Ccode>id\u003C\u002Fcode>, \u003Ccode>status: &quot;queued&quot;\u003C\u002Fcode> and \u003Ccode>reserved_usd\u003C\u002Fcode>, the price held. If you want the price first, the same body goes to \u003Ccode>POST \u002Fv1\u002Fgenerations\u002Fquote\u003C\u002Fcode>, which holds nothing and is not rate-limited.\u003C\u002Fp>\n\u003Cp>Send an \u003Ccode>Idempotency-Key\u003C\u002Fcode> with every submit. A network error can hide whether the request arrived; sent again with the same key and the same body, it returns the first generation instead of starting, and charging, a second clip. That makes the retry loop below safe:\u003C\u002Fp>",{"type":60,"lang":66,"code":72,"title":73},"async function submit(body, idempotencyKey = randomUUID()) {\n  for (let attempt = 1; ; attempt++) {\n    try {\n      return await api('\u002Fvideos\u002Fgenerations', {\n        method: 'POST',\n        headers: { 'Idempotency-Key': idempotencyKey },\n        body: JSON.stringify(body),\n      })\n    }\n    catch (error) {\n      \u002F\u002F No status: the network failed. 409 request_in_progress: the first try is still being accepted.\n      const retry = !error.status || error.status === 429 || error.status >= 500 || error.code === 'request_in_progress'\n      if (!retry || attempt === 5) throw error\n      await sleep((error.retryAfter || 2 ** attempt) * 1000)\n    }\n  }\n}\n\nconst gen = await submit({\n  model: 'seedance-2-5',\n  prompt: 'A paper boat drifts down a rain-soaked street at dusk, low tracking shot',\n  duration: 5,\n  resolution: '720p',\n  aspect_ratio: '16:9',\n  max_cost_usd: 1.35,\n})\nconsole.log(gen.id, gen.status, 'held', gen.reserved_usd)","Submit, retrying only what is safe to retry",{"type":57,"html":75},"\u003Cp>A \u003Ccode>400\u003C\u002Fcode> is never retried: the message names the field that is off and lists what the model takes. \u003Ccode>max_cost_usd\u003C\u002Fcode> caps the request: one that would cost more is refused with \u003Ccode>400 max_cost_exceeded\u003C\u002Fcode> before anything is held. In production, use your own job id as the idempotency key; the same key with the same body stays safe for 24 hours (\u003Ca href=\"\u002Fdocs\u002Fidempotency\">idempotency\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch2 id=\"poll-with-a-backoff\">Poll with a backoff\u003C\u002Fh2>\n\u003Cp>A generation moves from \u003Ccode>queued\u003C\u002Fcode> to \u003Ccode>running\u003C\u002Fcode>, then ends \u003Ccode>succeeded\u003C\u002Fcode> or \u003Ccode>failed\u003C\u002Fcode>. Read it until it settles, waiting a little longer each time, and give up at a deadline: a loop with no exit can run forever.\u003C\u002Fp>",{"type":60,"lang":66,"code":77,"title":78},"async function wait(gen, timeoutMs = 30 * 60_000) {\n  const deadline = Date.now() + timeoutMs\n  let delay = 2000\n  while (gen.status === 'queued' || gen.status === 'running') {\n    if (Date.now() > deadline) throw new Error(`${gen.id} is still ${gen.status}`)\n    await sleep(delay)\n    delay = Math.min(delay * 1.5, 15_000)\n    gen = await api(`\u002Fgenerations\u002F${gen.id}`)\n  }\n  return gen\n}\n\nconst done = await wait(gen)\nif (done.status === 'failed') {\n  throw new Error(done.error.message) \u002F\u002F nothing was charged: the hold went back to the balance\n}\nconsole.log('charged', done.cost_usd)","Wait for the result",{"type":57,"html":80},"\u003Cp>\u003Ccode>GET \u002Fv1\u002Fgenerations\u002F{id}\u003C\u002Fcode> reads a generation of any type, so the same function waits for images and clip edits too. Reads are not counted against your rate limit. Giving up in your script does not stop the clip: read it later by id, or take a webhook. A generation that runs too long is ended by the API with the \u003Ccode>timeout\u003C\u002Fcode> code, and like every failure it costs nothing.\u003C\u002Fp>\n\u003Ch2 id=\"stream-the-file-to-disk\">Stream the file to disk\u003C\u002Fh2>\n\u003Cp>Each finished output has a signed \u003Ccode>url\u003C\u002Fcode> that opens without a key for about an hour. Pipe the response into a file rather than buffering the whole clip in memory:\u003C\u002Fp>",{"type":60,"lang":66,"code":82,"title":83},"async function download(gen, path) {\n  const res = await fetch(gen.outputs[0].url)\n  if (!res.ok) throw new Error(`download failed: ${res.status}`)\n  await pipeline(Readable.fromWeb(res.body), createWriteStream(path))\n}\n\nawait download(done, 'boat.mp4')","Download the MP4",{"type":57,"html":85},"\u003Cp>When a link has expired, read the generation again for a fresh one, or stream \u003Ccode>GET \u002Fv1\u002Fgenerations\u002F{id}\u002Fcontent\u003C\u002Fcode> with your key. Files are not kept forever: copy the ones you keep to your own storage (\u003Ca href=\"\u002Fdocs\u002Ffiles\">files\u003C\u002Fa>).\u003C\u002Fp>\n\u003Ch2 id=\"verify-a-webhook-signature-in-node\">Verify a webhook signature in Node\u003C\u002Fh2>\n\u003Cp>A service that runs many clips should not poll each one. Add an endpoint under \u003Cstrong>Webhooks\u003C\u002Fstrong> in the dashboard and each generation of the workspace ends with a signed \u003Ccode>POST\u003C\u002Fcode>: \u003Ccode>generation.succeeded\u003C\u002Fcode> or \u003Ccode>generation.failed\u003C\u002Fcode>, with the generation in \u003Ccode>data\u003C\u002Fcode>. The \u003Ccode>Frameport-Signature\u003C\u002Fcode> header reads \u003Ccode>t=&lt;unix seconds&gt;,v1=&lt;hex&gt;\u003C\u002Fcode>, an HMAC-SHA256 of the timestamp, a dot and the raw body, keyed with the endpoint&#39;s secret. Verify it on the raw bytes, which is why the route takes \u003Ccode>express.raw\u003C\u002Fcode>:\u003C\u002Fp>",{"type":60,"lang":66,"code":87,"title":88},"import crypto from 'node:crypto'\nimport express from 'express'\n\nconst SECRET = process.env.WEBHOOK_SECRET \u002F\u002F whsec_..., shown once when you add the endpoint\n\nfunction verify(raw, header = '', toleranceSeconds = 300) {\n  const parts = Object.fromEntries(header.split(',').map(part => part.trim().split('=')))\n  const age = Math.abs(Date.now() \u002F 1000 - Number(parts.t))\n  if (!parts.v1 || !(age \u003C= toleranceSeconds)) return false\n  const expected = crypto.createHmac('sha256', SECRET).update(`${parts.t}.`).update(raw).digest('hex')\n  return expected.length === parts.v1.length\n    && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1))\n}\n\nconst app = express()\n\napp.post('\u002Fhooks\u002Fgenerations', express.raw({ type: 'application\u002Fjson' }), (req, res) => {\n  if (!verify(req.body, req.get('Frameport-Signature'))) return res.sendStatus(400)\n  const event = JSON.parse(req.body)\n  res.sendStatus(204) \u002F\u002F answer within 10 seconds, then do the work\n  console.log(event.type, event.data.id, event.data.status)\n})\n\napp.listen(3000)","hooks.mjs: an Express receiver",{"type":57,"html":90},"\u003Cp>A delivery that gets no \u003Ccode>2xx\u003C\u002Fcode> is sent again after 1, 5 and 15 minutes, with the same delivery id, so keep the ids you have handled. The guide to \u003Ca href=\"\u002Fblog\u002Fai-video-api-webhooks\">AI video API webhooks\u003C\u002Fa> covers retries, duplicates and catching up after an outage; the \u003Ca href=\"\u002Fdocs\u002Fwebhooks\">webhooks reference\u003C\u002Fa> has every header.\u003C\u002Fp>\n\u003Ch2 id=\"typescript-types-from-the-openapi-spec\">TypeScript types from the OpenAPI spec\u003C\u002Fh2>\n\u003Cp>The API is described by an OpenAPI 3.1 file at \u003Ca href=\"\u002Fopenapi.json\">\u002Fopenapi.json\u003C\u002Fa>, so you can type requests and answers without a hand-written SDK. Generate a declaration file once:\u003C\u002Fp>",{"type":60,"lang":61,"code":92},"npx openapi-typescript https:\u002F\u002Fframeport.ai\u002Fopenapi.json -o api.d.ts",{"type":60,"lang":66,"code":94,"title":95},"import type { components, paths } from '.\u002Fapi.js' \u002F\u002F the api.d.ts generated above\n\ntype VideoRequest = paths['\u002Fv1\u002Fvideos\u002Fgenerations']['post']['requestBody']['content']['application\u002Fjson']\ntype Generation = components['schemas']['Generation']\n\nconst body: VideoRequest = {\n  model: 'seedance-2-5',\n  prompt: 'A paper boat drifts down a rain-soaked street at dusk, low tracking shot',\n  duration: 5,\n}\nconst gen: Generation = await api('\u002Fvideos\u002Fgenerations', { method: 'POST', body: JSON.stringify(body) })","Typed requests",{"type":57,"html":97},"\u003Cp>Regenerate the file when the \u003Ca href=\"\u002Fchangelog\">changelog\u003C\u002Fa> announces new fields. The \u003Ca href=\"\u002Fdocs\u002Fopenapi\">OpenAPI page\u003C\u002Fa> lists other generators.\u003C\u002Fp>\n\u003Ch2 id=\"veo-wan-hailuo-or-runway-from-node-js\">Veo, Wan, Hailuo or Runway from Node.js\u003C\u002Fh2>\n\u003Cp>The script does not change from one model to the next: swap \u003Ccode>model\u003C\u002Fcode>, then the options that model takes. Each keeps its own grid of lengths and resolutions.\u003C\u002Fp>\n\u003Cdiv class=\"blog-table box blog-table-wide\">\u003Ctable class=\"tbl\">\u003Cthead>\u003Ctr>\u003Cth scope=\"col\">Model\u003C\u002Fth>\u003Cth scope=\"col\">\u003Ccode>model\u003C\u002Fcode>\u003C\u002Fth>\u003Cth scope=\"col\">Lengths\u003C\u002Fth>\u003Cth scope=\"col\">Resolutions\u003C\u002Fth>\u003Cth scope=\"col\">Sound\u003C\u002Fth>\u003Cth scope=\"col\">From\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Fseedance-2-5\">Seedance 2.5\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>seedance-2-5\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>4 to 30 seconds\u003C\u002Ftd>\u003Ctd>480p and 720p\u003C\u002Ftd>\u003Ctd>On or off, same price\u003C\u002Ftd>\u003Ctd>$0.12 \u002F s\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Fveo-3-1\">Veo 3.1\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>veo-3-1\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>4, 6 or 8 seconds\u003C\u002Ftd>\u003Ctd>720p, 1080p and 4K\u003C\u002Ftd>\u003Ctd>On or off, priced apart\u003C\u002Ftd>\u003Ctd>$0.235 \u002F s\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Fwan-3\">Wan 3.0\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>wan-3\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>2 to 30 seconds\u003C\u002Ftd>\u003Ctd>480p, 720p and 1080p\u003C\u002Ftd>\u003Ctd>On or off, same price\u003C\u002Ftd>\u003Ctd>$0.06 \u002F s\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Fhailuo-3\">Hailuo 3\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>hailuo-3\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>5 to 15 seconds\u003C\u002Ftd>\u003Ctd>2K\u003C\u002Ftd>\u003Ctd>On or off, same price\u003C\u002Ftd>\u003Ctd>$0.15 \u002F s\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Frunway-gen-4-5\">Runway Gen-4.5\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>runway-gen-4-5\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>2 to 10 seconds\u003C\u002Ftd>\u003Ctd>720p\u003C\u002Ftd>\u003Ctd>No soundtrack\u003C\u002Ftd>\u003Ctd>$0.14 \u002F s\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>\u003Ca href=\"\u002Fmodels\u002Ffp-motion-1\">Frameport Motion 1\u003C\u002Fa>\u003C\u002Ftd>\u003Ctd>\u003Ccode>fp-motion-1\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>5 to 15 seconds\u003C\u002Ftd>\u003Ctd>480p, 768p, 1080p and 2K\u003C\u002Ftd>\u003Ctd>On or off, same price\u003C\u002Ftd>\u003Ctd>$0.02 \u002F s\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>On Veo 3.1, \u003Ccode>audio: false\u003C\u002Fcode> takes the lower silent price: an 8-second clip at 1080p is $3.72 with sound and $1.88 without. Read each grid from \u003Ccode>GET \u002Fv1\u002Fmodels\u003C\u002Fcode>, which needs no key, rather than typing it into your code: a value off the grid comes back as a \u003Ccode>400\u003C\u002Fcode> naming what the model takes. To call the API from a web app with the key kept on the server, see \u003Ca href=\"\u002Fblog\u002Fnextjs-ai-image-generation\">Next.js AI image generation\u003C\u002Fa>. Typed clients can be generated from the spec: see the \u003Ca href=\"\u002Fblog\u002Fopenapi-client-ai-generation-api\">OpenAPI client generator\u003C\u002Fa> guide.\u003C\u002Fp>",{"type":99,"model":14},"cta",{"type":53,"id":53,"title":54,"items":101},[102,106,110,114,118],{"q":103,"html":104,"text":105},"Do I need an SDK to call an AI video API from Node.js?","\u003Cp>No. It is HTTPS and JSON, so the built-in \u003Ccode>fetch\u003C\u002Fcode> is enough: send the key as a Bearer token and read the JSON back. For types, generate them from the OpenAPI file.\u003C\u002Fp>","No. It is HTTPS and JSON, so the built-in fetch is enough: send the key as a Bearer token and read the JSON back. For types, generate them from the OpenAPI file.",{"q":107,"html":108,"text":109},"How often should I poll a video generation?","\u003Cp>Every few seconds, backing off up to about fifteen, with a deadline. Reads are not counted against your rate limit, but for many clips at once a webhook is simpler than a loop per clip.\u003C\u002Fp>","Every few seconds, backing off up to about fifteen, with a deadline. Reads are not counted against your rate limit, but for many clips at once a webhook is simpler than a loop per clip.",{"q":111,"html":112,"text":113},"How do I keep a retry from charging twice?","\u003Cp>Send an \u003Ccode>Idempotency-Key\u003C\u002Fcode> header with each submit and reuse it on the retry. The same key with the same body returns the first generation for 24 hours, so a timeout followed by a retry never starts a second clip.\u003C\u002Fp>","Send an Idempotency-Key header with each submit and reuse it on the retry. The same key with the same body returns the first generation for 24 hours, so a timeout followed by a retry never starts a second clip.",{"q":115,"html":116,"text":117},"Can I call the API from React or the browser?","\u003Cp>Not with your key: it spends money, so it belongs on your server, in an API route or a worker. Let the browser call your backend, and let your backend call the API and receive the webhooks.\u003C\u002Fp>","Not with your key: it spends money, so it belongs on your server, in an API route or a worker. Let the browser call your backend, and let your backend call the API and receive the webhooks.",{"q":119,"html":120,"text":121},"Can I generate images from Node.js the same way?","\u003Cp>Yes. \u003Ccode>POST \u002Fv1\u002Fimages\u002Fgenerations\u003C\u002Fcode> takes a \u003Ccode>model\u003C\u002Fcode> such as \u003Ccode>flux-3-image\u003C\u002Fcode> or \u003Ccode>nano-banana-pro\u003C\u002Fcode>, a \u003Ccode>prompt\u003C\u002Fcode> and \u003Ccode>n\u003C\u002Fcode> from 1 to 4, and returns a generation that the same \u003Ccode>wait\u003C\u002Fcode> function follows to the end. The \u003Ca href=\"\u002Fdocs\u002Fimages\">images reference\u003C\u002Fa> has the fields, and the \u003Ca href=\"\u002Fblog\u002Fai-video-generation-api-python\">Python version of this guide\u003C\u002Fa> shows the same steps with \u003Ccode>requests\u003C\u002Fcode>.\u003C\u002Fp>","Yes. POST \u002Fv1\u002Fimages\u002Fgenerations takes a model such as flux-3-image or nano-banana-pro, a prompt and n from 1 to 4, and returns a generation that the same wait function follows to the end. The images reference has the fields, and the Python version of this guide shows the same steps with requests.",[123,124,125,126,127],{"q":103,"html":104,"text":105},{"q":107,"html":108,"text":109},{"q":111,"html":112,"text":113},{"q":115,"html":116,"text":117},{"q":119,"html":120,"text":121},[129,138,146],{"slug":130,"path":131,"title":132,"description":133,"category":9,"categoryLabel":10,"date":11,"updated":11,"readingMinutes":134,"models":135,"featured":17},"ai-video-prompt-guide","\u002Fblog\u002Fai-video-prompt-guide","AI Video Prompt Guide: Prompts Video Models Follow","An AI video prompt guide for developers: subject, action, camera, light and sound in order, camera moves, model quirks and templates to fill from code.",7,[14,15,136,137,16],"wan-3","hailuo-3",{"slug":139,"path":140,"title":141,"description":142,"category":9,"categoryLabel":10,"date":11,"updated":11,"readingMinutes":143,"models":144,"featured":17},"first-and-last-frame-video-api","\u002Fblog\u002Ffirst-and-last-frame-video-api","First and Last Frame AI Video by API: Control Both Ends","First and last frame AI video by API: which models take both frames, the request body, how to prompt the motion between them, loops and transitions.",6,[14,15,137,16,145],"seedance-2-0",{"slug":147,"path":148,"title":149,"description":150,"category":9,"categoryLabel":10,"date":11,"updated":11,"readingMinutes":12,"models":151,"featured":17},"image-to-video-api","\u002Fblog\u002Fimage-to-video-api","Image to Video API: Animate a Still in One Call","Turn a picture into a clip by API: a first frame, first and last frames or reference pictures, which models take each, the request and what it costs.",[14,16,15,136,137,152],"grok-imagine","\u002Fstudio",[155,174,183,193,218,235,254,269,283,298,313,327,338,351,364,377,389,400,408,417,427,436,446,454,473],{"id":156,"type":157,"name":158,"description":159,"maker":160,"family":160,"own":161,"image":162,"private":173},"fp-image-2","image","Frameport Image 2","Photoreal renders, up to 4 reference images.","Frameport",true,{"pricing":163,"options":165},{"per_image":164,"per_extra_reference_image":-1},0.025,{"aspect_ratios":166,"max_images":172},[167,168,169,170,171],"1:1","3:4","4:3","9:16","16:9",4,{},{"id":175,"type":157,"name":176,"description":177,"maker":160,"family":160,"own":161,"image":178,"private":182},"fp-image-3","Frameport Image 3","Clean photoreal renders for characters.",{"pricing":179,"options":180},{"per_image":164,"per_extra_reference_image":-1},{"aspect_ratios":181,"max_images":172},[167,168,169,170,171],{},{"id":184,"type":157,"name":185,"description":186,"maker":160,"family":160,"own":161,"image":187,"private":192},"fp-image-1","Frameport Image 1","Generation and reference-driven renders, up to 10 reference images.",{"pricing":188,"options":190},{"per_image":164,"per_extra_reference_image":189},0.0025,{"aspect_ratios":191,"max_images":172},[167,168,169,170,171],{},{"id":16,"type":194,"name":195,"description":196,"maker":160,"family":197,"own":161,"video":198,"private":216},"video","Frameport Motion 1","Our video engine, with native sound.","Frameport Motion",{"pricing":199,"options":206},{"default_resolution":200,"per_second":201,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},"768p",{"480p":202,"768p":203,"1080p":204,"2K":205},0.02,0.06,0.08,0.095,{"resolutions":207,"durations":211,"aspect_ratios":214,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":172,"identity_resolutions":215,"seed":17,"negative_prompt":17},[208,200,209,210],"480p","1080p","2K",{"min":12,"max":212,"step":213},15,1,[171,170,167,169,168],[200,209],{"resolutions":217},[208,200],{"id":14,"type":194,"name":219,"description":220,"maker":221,"family":222,"own":17,"video":223},"Seedance 2.5","The long-take flagship — up to 30 seconds with sound","ByteDance","Seedance",{"pricing":224,"options":229},{"default_resolution":225,"per_second":226,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},"720p",{"480p":227,"720p":228},0.12,0.27,{"resolutions":230,"durations":231,"aspect_ratios":233,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":172,"identity_resolutions":-1,"seed":161,"negative_prompt":17},[208,225],{"min":172,"max":232,"step":213},30,[171,169,167,168,170,234],"21:9",{"id":15,"type":194,"name":236,"description":237,"maker":238,"family":239,"own":17,"video":240},"Veo 3.1","Google’s flagship — up to 4K with native audio","Google","Veo",{"pricing":241,"options":247},{"default_resolution":209,"per_second":242,"per_second_with_audio":245,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"720p":243,"1080p":243,"4K":244},0.235,0.465,{"720p":244,"1080p":244,"4K":246},0.695,{"resolutions":248,"durations":250,"aspect_ratios":252,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":253,"identity_resolutions":-1,"seed":161,"negative_prompt":161},[225,209,249],"4K",{"min":172,"max":251,"step":33},8,[171,170],3,{"id":145,"type":194,"name":255,"description":256,"maker":221,"family":222,"own":17,"video":257},"Seedance 2.0","Character consistency, up to 4K",{"pricing":258,"options":265},{"default_resolution":225,"per_second":259,"per_second_with_audio":-1,"aspect_ratio_multiplier":263,"per_reference_image":-1,"per_frame_image":-1},{"480p":204,"720p":260,"1080p":261,"4K":262},0.175,0.435,0.9,{"21:9":264},1.32,{"resolutions":266,"durations":267,"aspect_ratios":268,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":172,"identity_resolutions":-1,"seed":161,"negative_prompt":17},[208,225,209,249],{"min":172,"max":212,"step":213},[171,169,167,168,170,234],{"id":137,"type":194,"name":270,"description":271,"maker":272,"family":273,"own":17,"video":274},"Hailuo 3","2K cinematic physics, subject references","MiniMax","Hailuo",{"pricing":275,"options":279},{"default_resolution":210,"per_second":276,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":278,"per_frame_image":-1},{"2K":277},0.15,0.047,{"resolutions":280,"durations":281,"aspect_ratios":282,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":253,"identity_resolutions":-1,"seed":17,"negative_prompt":17},[210],{"min":12,"max":212,"step":213},[234,171,169,167,168,170],{"id":284,"type":194,"name":285,"description":286,"maker":287,"family":287,"own":17,"video":288},"runway-gen-4-5","Runway Gen-4.5","Cinematic motion, strong prompt adherence","Runway",{"pricing":289,"options":292},{"default_resolution":225,"per_second":290,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"720p":291},0.14,{"resolutions":293,"durations":294,"aspect_ratios":296,"audio_toggle":17,"start_frame":161,"end_frame":17,"max_reference_images":297,"identity_resolutions":-1,"seed":161,"negative_prompt":17},[225],{"min":33,"max":295,"step":213},10,[171,170],0,{"id":299,"type":194,"name":300,"description":301,"maker":238,"family":239,"own":17,"video":302},"veo-3-1-fast","Veo 3.1 Fast","Veo quality, faster and a quarter of the price",{"pricing":303,"options":309},{"default_resolution":225,"per_second":304,"per_second_with_audio":307,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"720p":305,"1080p":227,"4K":306},0.093,0.29,{"720p":227,"1080p":291,"4K":308},0.35,{"resolutions":310,"durations":311,"aspect_ratios":312,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":253,"identity_resolutions":-1,"seed":161,"negative_prompt":161},[225,209,249],{"min":172,"max":251,"step":33},[171,170],{"id":314,"type":194,"name":315,"description":316,"maker":221,"family":222,"own":17,"video":317},"seedance-2-0-fast","Seedance 2.0 Fast","Seedance references and sound, faster",{"pricing":318,"options":323},{"default_resolution":225,"per_second":319,"per_second_with_audio":-1,"aspect_ratio_multiplier":322,"per_reference_image":-1,"per_frame_image":-1},{"480p":320,"720p":321},0.063,0.145,{"21:9":264},{"resolutions":324,"durations":325,"aspect_ratios":326,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":172,"identity_resolutions":-1,"seed":161,"negative_prompt":17},[208,225],{"min":172,"max":212,"step":213},[171,169,167,168,170,234],{"id":328,"type":194,"name":329,"description":330,"maker":272,"family":273,"own":17,"video":331},"hailuo-3-max","Hailuo 3 Max","Fast Hailuo motion, 768p",{"pricing":332,"options":334},{"default_resolution":200,"per_second":333,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"480p":203,"768p":305},{"resolutions":335,"durations":336,"aspect_ratios":337,"audio_toggle":17,"start_frame":161,"end_frame":161,"max_reference_images":297,"identity_resolutions":-1,"seed":17,"negative_prompt":17},[208,200],{"min":12,"max":212,"step":213},[234,171,169,167,168,170],{"id":152,"type":194,"name":339,"description":340,"maker":341,"family":339,"own":17,"video":342},"Grok Imagine","Quick clips from a prompt or a start image","xAI",{"pricing":343,"options":347},{"default_resolution":225,"per_second":344,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":346},{"480p":305,"720p":345,"1080p":306},0.165,0.014,{"resolutions":348,"durations":349,"aspect_ratios":350,"audio_toggle":17,"start_frame":161,"end_frame":17,"max_reference_images":297,"identity_resolutions":-1,"seed":17,"negative_prompt":17},[208,225,209],{"min":213,"max":212,"step":213},[171,170,167,169,168],{"id":352,"type":194,"name":353,"description":-1,"maker":221,"family":222,"own":17,"video":354},"seedance-2-0-mini","Seedance 2.0 Mini",{"pricing":355,"options":360},{"default_resolution":208,"per_second":356,"per_second_with_audio":-1,"aspect_ratio_multiplier":359,"per_reference_image":-1,"per_frame_image":-1},{"480p":357,"720p":358},0.041,0.088,{"21:9":264},{"resolutions":361,"durations":362,"aspect_ratios":363,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":172,"identity_resolutions":-1,"seed":161,"negative_prompt":17},[208,225],{"min":172,"max":212,"step":213},[171,169,167,168,170,234],{"id":365,"type":194,"name":366,"description":367,"maker":238,"family":239,"own":17,"video":368},"veo-3-1-lite","Veo 3.1 Lite","Veo with sound, on every account",{"pricing":369,"options":373},{"default_resolution":225,"per_second":370,"per_second_with_audio":372,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"720p":371,"1080p":203},0.036,{"720p":203,"1080p":305},{"resolutions":374,"durations":375,"aspect_ratios":376,"audio_toggle":161,"start_frame":161,"end_frame":161,"max_reference_images":297,"identity_resolutions":-1,"seed":161,"negative_prompt":161},[225,209],{"min":172,"max":251,"step":33},[171,170],{"id":136,"type":194,"name":378,"description":379,"maker":380,"family":381,"own":17,"video":382},"Wan 3.0","Up to 30 seconds, references and sound","Alibaba","Wan",{"pricing":383,"options":385},{"default_resolution":225,"per_second":384,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"480p":203,"720p":227,"1080p":243},{"resolutions":386,"durations":387,"aspect_ratios":388,"audio_toggle":161,"start_frame":161,"end_frame":17,"max_reference_images":253,"identity_resolutions":-1,"seed":161,"negative_prompt":17},[208,225,209],{"min":33,"max":232,"step":213},[171,169,167,168,170],{"id":390,"type":157,"name":391,"description":392,"maker":393,"family":394,"own":17,"image":395},"gpt-image-2-5-sunburst","GPT Image 2.5 Sunburst","OpenAI's flagship — precise text, composition and control","OpenAI","GPT Image",{"pricing":396,"options":398},{"per_image":397,"per_extra_reference_image":-1},0.085,{"aspect_ratios":399,"max_images":172},[167,168,169,170,171],{"id":401,"type":157,"name":402,"description":403,"maker":393,"family":394,"own":17,"image":404},"gpt-image-2-5-flare","GPT Image 2.5 Flare","OpenAI's image model tuned for expressive, dramatic frames",{"pricing":405,"options":406},{"per_image":397,"per_extra_reference_image":-1},{"aspect_ratios":407,"max_images":172},[167,168,169,170,171],{"id":409,"type":157,"name":410,"description":411,"maker":238,"family":412,"own":17,"image":413},"nano-banana-2-1","Nano Banana 2.1","Google's fast multimodal image model","Nano Banana",{"pricing":414,"options":415},{"per_image":397,"per_extra_reference_image":-1},{"aspect_ratios":416,"max_images":172},[167,168,169,170,171],{"id":418,"type":157,"name":419,"description":420,"maker":221,"family":421,"own":17,"image":422},"seedream-5-0-pro","Seedream 5.0 Pro","ByteDance's flagship — rich detail and texture","Seedream",{"pricing":423,"options":425},{"per_image":424,"per_extra_reference_image":-1},0.099,{"aspect_ratios":426,"max_images":172},[167,168,169,170,171],{"id":428,"type":157,"name":429,"description":430,"maker":238,"family":412,"own":17,"image":431},"nano-banana-pro","Nano Banana Pro","Google's highest-fidelity image model",{"pricing":432,"options":434},{"per_image":433,"per_extra_reference_image":-1},0.16,{"aspect_ratios":435,"max_images":172},[167,168,169,170,171],{"id":437,"type":157,"name":438,"description":439,"maker":440,"family":441,"own":17,"image":442},"flux-3-image","Flux 3 Image","Black Forest Labs' FLUX.3 — photoreal and typography","Black Forest Labs","Flux",{"pricing":443,"options":444},{"per_image":358,"per_extra_reference_image":-1},{"aspect_ratios":445,"max_images":172},[167,168,169,170,171],{"id":447,"type":157,"name":448,"description":449,"maker":341,"family":339,"own":17,"image":450},"grok-imagine-2-0","Grok Imagine 2.0","xAI's fast, characterful image model",{"pricing":451,"options":452},{"per_image":358,"per_extra_reference_image":-1},{"aspect_ratios":453,"max_images":172},[167,168,169,170,171],{"id":455,"type":194,"name":456,"description":457,"maker":160,"family":458,"own":161,"edit":459,"video":467},"fp-replace-1","Frameport Replace 1","Up to four people in your clip replaced by the faces you send: moves, lips, scene and sound kept.","Frameport Replace",{"tool":460,"formats":461,"min_seconds":33,"max_seconds":295,"min_billed_seconds":33,"max_bytes":464,"max_frames":465,"fps":466,"max_faces":172},"replace",[462,463],"mp4","mov",64000000,600,24,{"pricing":468,"options":471},{"default_resolution":200,"per_second":469,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"768p":227,"1080p":470},0.25,{"resolutions":472,"durations":-1,"aspect_ratios":-1,"audio_toggle":-1,"start_frame":-1,"end_frame":-1,"max_reference_images":-1,"identity_resolutions":-1,"seed":-1,"negative_prompt":-1},[200,209],{"id":474,"type":194,"name":475,"description":476,"maker":160,"family":477,"own":161,"edit":478,"video":483},"fp-upscale-1","Frameport Upscale 1","Your clip at 1080p or 2K: the same motion, frame rate and sound, sharper detail.","Frameport Upscale",{"tool":479,"formats":480,"min_seconds":213,"max_seconds":232,"min_billed_seconds":12,"max_bytes":481,"max_frames":482,"fps":-1,"max_faces":-1},"upscale",[462,463],100000000,900,{"pricing":484,"options":488},{"default_resolution":209,"per_second":485,"per_second_with_audio":-1,"aspect_ratio_multiplier":-1,"per_reference_image":-1,"per_frame_image":-1},{"1080p":486,"2K":487},0.03,0.05,{"resolutions":489,"durations":-1,"aspect_ratios":-1,"audio_toggle":-1,"start_frame":-1,"end_frame":-1,"max_reference_images":-1,"identity_resolutions":-1,"seed":-1,"negative_prompt":-1},[209,210],1795901824956,"b270fb84-a112-44f2-9801-f99d6c2e889e"]