ToAPIs
    InicioToAPIs
    Generación de imágenesGPT Image 2.6, Gemini, FLUX…Generación de videoSeedance, Veo, Kling, Sora…Chat y redacciónGPT-5.6, Claude, DeepSeek…Voz y músicaLocuciones, TTS, audio
    NovedadSeedance 2.5
    PreciosDocumentación de APIMCP
    BlogAlternativas
    Iniciar sesiónEmpieza gratis
    Todos los modelosPreciosDocumentación de APIMCPBlogAlternativas
    Iniciar sesiónEmpieza gratis

    Idioma

    1. Inicio
    2. Blog
    3. Tutorial
    4. Automated E-Commerce Video Ad Pipeline: Combining Seedance and MiniMax APIs
    Volver a todos los artículos
    tutorial2026-12-017 min de lectura

    Automated E-Commerce Video Ad Pipeline: Combining Seedance and MiniMax APIs

    A production-shaped product-image-to-video pipeline that routes official Seedance and MiniMax IDs by documented duration and resolution windows. Costs are a 2026-12-01 catalog estimate, not a $1.20-per-ad unit price, and client-side stitching stays out of band.

    ToAPIs Engineering & Evaluation Team
    E-commerceSeedanceMiniMaxImage-to-VideoPipeline
    TL;DR - Puntos clave
    • Use documented IDs only: seedance-2-5 (4–30 s, 480p–4k, first-frame via image_with_roles), MiniMax-H3 (4–15 s, 2K or 768p, same first-frame field), and MiniMax-Hailuo-2.3 (6 or 10 s; 1080P allows 6 s only, first frame via image_urls). Hailuo Fast is image-to-video only.
    • A 15-second vertical ad is a valid official duration on seedance-2-5 and MiniMax-H3, not on a single Hailuo 2.3 clip. If you need a longer cut than a model allows, concatenate on the client (for example with FFmpeg). That stitch is out-of-band — the API does not emit a 15-second official Hailuo file.
    • Stage the product image once with POST /v1/uploads/images or a public HTTP(S) URL. Optional cleanup can use gpt-image-2 image-to-image (reference_images / image_urls). Official GPT Image 2 pages do not document a separate inpainting mask field; Shopify import and ElevenLabs audio are not ToAPIs contracts.
    • Combine the two families for documented capability differences — duration windows, resolution, audio flags, camera-directive syntax, and required image fields — not for unpublished "lifestyle versus cinematic" lab results.
    • Pricing in this article is a 2026-12-01 public-catalog estimate (1 credit ≈ $0.005). It is not a $1.20-per-ad or $150-per-UGC unit cost. Confirm rates in your account before you budget a catalog of variations.

    Automated E-Commerce Video Ad Pipeline: Combining Seedance and MiniMax APIs

    A product-image-to-video pipeline is a good fit for ToAPIs when every model call stays inside a documented duration, resolution, and image-input window. This tutorial wires official seedance-2-5, MiniMax-H3, and MiniMax-Hailuo-2.3 IDs around one staged product URL. It does not invent a $1.20-per-ad unit cost, a 15-second Hailuo clip, a Shopify scrape API, or an ElevenLabs field on the video request.

    Planning drafts also treated seedance-2, minimax-h3, and gpt-image-2 loosely. The official names to call today are seedance-2-5 (or seedance-2 when you want the 4–15-second Seedance 2 family), MiniMax-H3, and gpt-image-2 for optional image-to-image cleanup. See Precise First-Frame Control in Video APIs for the URL-versus-Base64 contract, and Eliminating Video Generation Timeouts for completion signaling.

    1. TL;DR & Performance Overview

    • One staged URL, several official IDs. Upload the product still with POST /v1/uploads/images (or pass a public HTTP(S) URL). Then submit first-frame jobs with image_with_roles on Seedance and MiniMax-H3, or image_urls on Hailuo 2.3.
    • Honor each duration window. 15-second vertical ads are in range for seedance-2-5 (4–30 s) and MiniMax-H3 (4–15 s). MiniMax-Hailuo-2.3 is 6 or 10 seconds only (1080P → 6 s). Stitching shorter clips is a client-side step.
    • Combine families for documented differences, not for unpublished creative rankings: length, resolution, generate_audio, Hailuo camera directives, and which image field the page requires.
    • Price from the 2026-12-01 catalog, in credits, with USD only as an estimate at 1 credit ≈ $0.005. Confirm the account catalog before you budget.

    2. Official IDs and Why Two Families Appear in One Pipeline

    Official IDMode this pipeline usesDurationResolutionImage fieldOther documented traits
    seedance-2-5First-frame I2V4–30 s, or -1480p, 720p, 1080p, 4kimage_with_roles role first_frame; use aspect_ratio: "adaptive"generate_audio defaults to true; public HTTP(S) URLs only
    seedance-2-5-flashFaster first-frame preview4–30 s, or -1480p or 720p onlySame roles; up to 10 imagesLower-cost preview branch; no 1080p / 4k
    MiniMax-H3First-frame I2V4–15 s2K or 768pimage_with_roles role first_frameFirst/last-frame mode ignores a specific aspect ratio and uses adaptive
    MiniMax-Hailuo-2.3First-frame I2V6 or 10 s; 1080P allows 6 only768P or 1080Pimage_urls (one starting frame)15 camera directives such as [Push in]; max 2000-character prompt
    MiniMax-Hailuo-2.3-FastFirst-frame I2V onlySame 6 / 10 s window768P or 1080Pimage_urls requiredNo text-to-video; useful as a cheaper variation branch

    MiniMax-H3-Max-Turbo is being deprecated by the model provider and does not support reference media; official docs recommend MiniMax-H3-Lite for new integrations that need a lighter H3-family ID. This pipeline uses MiniMax-H3 itself when you want the 2K first-frame path.

    Optional cleanup uses gpt-image-2 on POST /v1/images/generations with reference_images (or compatible image_urls). That is documented image-to-image generation, not a ToAPIs inpainting API. Base64 is not accepted in those fields either.

    Third-party steps — pulling product images from Shopify, adding a voice-over with ElevenLabs, or burning captions — stay out of band. They are not ToAPIs request fields.

    3. Production Implementation: Stage, Branch, Bounded Wait

    Product image flowing into an optional cleanup step, two model gateways, and an optional client-side stitch

    Figure 1. Documented pipeline: stage a product URL, optionally clean it up, branch to official Seedance and MiniMax IDs, and stitch only on the client if you need a longer cut.

    The following program uploads one product image, optionally runs gpt-image-2, then starts three documented video jobs: a 15-second seedance-2-5 1080p 9:16 clip, an 8-second MiniMax-H3 2K first-frame clip, and a 6-second MiniMax-Hailuo-2.3 1080P clip with a camera directive. Each job is polled with the official 5 / 10 / 600 bound.

    python
    import os
    import random
    import time
    import requests
    
    API_KEY = os.environ["TOAPIS_API_KEY"]
    BASE_URL = os.environ.get("TOAPIS_BASE_URL", "https://toapis.com")  # or https://toapis.cn
    
    
    def upload_image(path: str) -> str:
        with open(path, "rb") as fh:
            resp = requests.post(
                f"{BASE_URL}/v1/uploads/images",
                headers={"Authorization": f"Bearer {API_KEY}"},
                files={"file": fh},
                timeout=60,
            )
        resp.raise_for_status()
        body = resp.json()
        if not body.get("success"):
            raise RuntimeError(body)
        return body["data"]["url"]
    
    
    def optional_cleanup(image_url: str, prompt: str) -> str:
        """Documented gpt-image-2 image-to-image. Not an inpainting-mask API."""
        resp = requests.post(
            f"{BASE_URL}/v1/images/generations",
            headers={
                "Authorization": f"Bearer {API_KEY}",
                "Content-Type": "application/json",
            },
            json={
                "model": "gpt-image-2",
                "prompt": prompt,
                "size": "9:16",
                "resolution": "2k",
                "reference_images": [image_url],
            },
            timeout=30,
        )
        resp.raise_for_status()
        task_id = resp.json().get("id") or resp.json().get("task_id")
        return poll_task(f"{BASE_URL}/v1/images/generations/{task_id}")["url"]
    
    
    def submit_video(payload: dict) -> str:
        resp = requests.post(
            f"{BASE_URL}/v1/videos/generations",
            headers={
                "Authorization": f"Bearer {API_KEY}",
                "Content-Type": "application/json",
            },
            json=payload,
            timeout=30,
        )
        resp.raise_for_status()
        body = resp.json()
        task_id = body.get("id") or body.get("task_id")
        if not task_id:
            raise RuntimeError(body)
        return task_id
    
    
    def poll_task(url: str, max_wait: int = 600) -> dict:
        start = time.time()
        interval = 10
        time.sleep(5)
        while time.time() - start < max_wait:
            resp = requests.get(url, headers={"Authorization": f"Bearer {API_KEY}"}, timeout=30)
            if resp.status_code == 429:
                retry_after = int(resp.headers.get("Retry-After", interval))
                time.sleep(retry_after + random.uniform(0, 1))
                interval = min(interval * 2, 120)
                continue
            resp.raise_for_status()
            data = resp.json()
            status = data.get("status")
            if status == "completed":
                item = (data.get("result") or {}).get("data") or []
                if not item or not item[0].get("url"):
                    raise RuntimeError(data)
                return {"url": item[0]["url"], "expires_at": data.get("expires_at")}
            if status == "failed":
                err = data.get("error") or {}
                raise RuntimeError(err.get("message") or data)
            time.sleep(interval + random.uniform(0, 1))
        raise TimeoutError(f"still running after {max_wait}s: {url}")
    
    
    def poll_video(task_id: str) -> dict:
        return poll_task(f"{BASE_URL}/v1/videos/generations/{task_id}")
    
    
    if __name__ == "__main__":
        product_url = upload_image("product-hero.jpg")
        # Optional: comment this out to use the original still unchanged.
        # product_url = optional_cleanup(
        #     product_url,
        #     "Keep the product identical. Replace the cluttered background with a clean studio sweep.",
        # )
    
        jobs = {
            "seedance_15s": submit_video(
                {
                    "model": "seedance-2-5",
                    "prompt": "The product stands on a clean studio sweep. Slow pedestal up, soft daylight, no new logos.",
                    "duration": 15,
                    "resolution": "1080p",
                    "aspect_ratio": "adaptive",
                    "generate_audio": True,
                    "image_with_roles": [{"url": product_url, "role": "first_frame"}],
                }
            ),
            "h3_8s": submit_video(
                {
                    "model": "MiniMax-H3",
                    "prompt": "The same product holds the frame as the camera slowly orbits, consistent identity, studio lighting.",
                    "duration": 8,
                    "resolution": "2K",
                    "image_with_roles": [{"url": product_url, "role": "first_frame"}],
                }
            ),
            "hailuo_6s": submit_video(
                {
                    "model": "MiniMax-Hailuo-2.3",
                    "prompt": "The product turns toward the camera [Push in], then holds [Static shot]",
                    "image_urls": [product_url],
                    "duration": 6,
                    "resolution": "1080P",
                }
            ),
        }
    
        for name, task_id in jobs.items():
            result = poll_video(task_id)
            print(name, result["url"], "expires_at=", result["expires_at"])
    

    A compact cURL submit for the 15-second Seedance branch:

    bash
    curl --request POST \
      --url https://toapis.com/v1/videos/generations \
      --header "Authorization: Bearer $TOAPIS_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
        "model": "seedance-2-5",
        "prompt": "The product stands on a clean studio sweep. Slow pedestal up, soft daylight, no new logos.",
        "duration": 15,
        "resolution": "1080p",
        "aspect_ratio": "adaptive",
        "generate_audio": true,
        "image_with_roles": [{"url": "https://files.toapis.com/uploads/example.jpg", "role": "first_frame"}]
      }'
    

    If you need a cut longer than a given model's official window, concatenate the downloaded MP4 files with a local tool such as FFmpeg. That step is not a ToAPIs parameter, and it does not change what each generation request is allowed to return.

    For push completion instead of a tight poll loop, configure Task Webhooks first and keep the poller as a fallback, as described in the webhook tutorial.

    4. Error Handling & Status Matrix

    SituationOfficial behaviorPipeline response
    Base64 or a local path in the generation bodyRejected on Seedance, MiniMax, Wan, and GPT Image 2 pagesUpload first; reuse data.url
    image_urls plus image_with_rolesAmbiguous on Seedance and MiniMax-H3Send only the documented preferred field
    Hailuo duration: 15 or 1080P + duration: 10Outside the documented 6 / 10 window (1080P is 6 s only)Use 6 or 10, or pick seedance-2-5 / MiniMax-H3 for 15 s
    Hailuo Fast without an imageFast is I2V onlyAlways pass image_urls
    MiniMax-H3 resolution: "4k"Not on the H3 page (2K / 768p only)Use 2K, or switch the 4k branch to seedance-2-5
    Poll queued / in_progressNot finalContinue the official 10 s loop
    Poll completedresult.data[0].urlDownload before expires_at (30-day official retention)
    Poll failederror.messageFail that branch only; do not assume other IDs failed
    400 webhook_not_configuredcallback_url sent without a TokenConfigure the Token, or omit the field

    5. Pricing & FinOps ROI

    Snapshot date: 2026-12-01. Source: the public pricing page (1 credit ≈ $0.005). Unauthenticated GET /api/v1/pricing returned 401. These figures are planning arithmetic, not a quote, and not the draft economics of "$150 per human-edited UGC clip down to $1.20 per AI-generated ad."

    StepOfficial IDCatalog unit (2026-12-01)Worked example (estimate only)
    Optional cleanupgpt-image-2$0.015 per request (about 3 credits)One still ≈ $0.015
    15 s vertical adseedance-2-5$2.90 / 1M usage.total_tokens; per-second figures are only budget estimatesBill the settled usage.total_tokens from the completed task, not a draft $0.030–$0.038 / s baseline
    8 s 2K first-frameMiniMax-H3$0.064 / s (about 12.8 credits / s)8 × $0.064 ≈ $0.512 (about 102 credits)
    6 s 1080P first-frameMiniMax-Hailuo-2.3$0.194 per request (about 38.8 credits)One clip ≈ $0.194
    Cheaper I2V variationMiniMax-Hailuo-2.3-Fast$0.136 per request (about 27.2 credits)One clip ≈ $0.136

    A bundle of one 15-second Seedance job, one 8-second H3 job, and one 6-second Hailuo job therefore has a known MiniMax subtotal of about $0.706 (about 141 credits) plus whatever seedance-2-5 settles in tokens, plus $0.015 if you run cleanup. Ten variations means ten such bundles (or a subset of branches), not a hidden batch discount on the official pages. Confirm live rates in the Billing Center before you commit a catalog.

    6. Frequently Asked Questions

    The frontmatter covers 15-second windows, why two families appear, variation pricing, GPT Image 2 cleanup, and async waiting. Two more pipeline notes:

    • Audio. seedance-2-5 documents generate_audio (default true). Hailuo and MiniMax-H3 generation pages do not list that same boolean; Hailuo exposes camera directives in the prompt instead. Adding a third-party voice-over is out of band.
    • Wan as an extra branch. wan2.6 officially accepts 5, 10, or 15 seconds at 720p / 1080p with image_urls, and wan3.0-video accepts 2–30 seconds with image_with_roles. They are valid first-frame IDs if you already use Wan; this article focuses on the scheduled Seedance + MiniMax pairing. See Wan 2.6 Image-to-Video Pipeline and Alibaba Wan 3 Video API Quickstart.

    7. Action Checklist

    • Stage the product still with POST /v1/uploads/images or a public HTTP(S) URL. Do not send Base64 in generation requests.
    • Pick official IDs that match the cut you need: seedance-2-5 for up to 30 s and 1080p/4k, MiniMax-H3 for up to 15 s at 2K, MiniMax-Hailuo-2.3 for 6 or 10 s.
    • Use image_with_roles / first_frame on Seedance and H3, and image_urls on Hailuo. Set Seedance first-frame aspect_ratio to adaptive.
    • Treat Shopify imports, ElevenLabs voice-over, captions, and FFmpeg concatenation as client-side or third-party steps.
    • Submit branches asynchronously; wait with Task Webhooks plus the official 5 / 10 / 600 poller.
    • Budget from the dated catalog in credits, and confirm the account price list before you multiply by SKU count.

    Official sources fetched on 2026-12-01: Seedance 2.5 generation, MiniMax H3 generation, Hailuo 2.3 generation, GPT Image 2 generation, Upload Image, Get Video Task Status, and toapis.com/pricing.

    Explora los modelos mencionados en este artículo

    ByteDanceVIDEO

    Seedance 2.5

    Tarifa actual: Input 2,000 credits/1M, Output 2,000 credits/1M
    Guía del modeloProbar en la consolaObtener clave de API
    MiniMaxVIDEO

    minimax-h3

    Tarifa actual: 13 credits /second, +4 credits /input image (first 5 free)
    Guía del modeloProbar en la consolaObtener clave de API
    MiniMaxVIDEO

    minimax-hailuo-2.3

    Tarifa actual: 38.8 credits /request
    Guía del modeloProbar en la consolaObtener clave de API

    Artículos relacionados

    tutorial2026-12-01T10:00:00+08:008 min de lectura

    Precise First-Frame Control in Video APIs: Base64 vs Image URLs Compared

    Official ToAPIs first-frame and image-to-video inputs accept public HTTP(S) URLs, not inlined Base64. This tutorial compares documented fields (image_with_roles vs image_urls), the Upload Image API, and URL constraints fetched on 2026-12-01.

    TO
    ToAPIs Engineering & Evaluation Team
    #First Frame
    tutorial2026-11-11T10:00:00+08:007 min de lectura

    Integración de la API de MiniMax Hailuo 2.3: generar movimiento humano complejo en vídeo con IA

    Guía para desarrolladores sobre la API de vídeo MiniMax Hailuo 2.3 en ToAPIs: patrones de prompt para movimiento humano, el contrato actual de solicitud para trabajos de 6 y 10 segundos en 768P y 1080P, y ejemplos en cURL y Python.

    TO
    ToAPIs Engineering & Evaluation Team
    #MiniMax Hailuo
    tutorial2026-11-30T10:00:00+08:007 min de lectura

    Handling Asynchronous AI Video Generation with Webhooks: End-to-End Implementation

    End-to-end ToAPIs tutorial for async video jobs: configure Task Webhooks, verify official HMAC-SHA256 signatures, handle generation.completed and generation.failed, and fall back to the documented poll path when delivery is delayed or exhausted.

    TO
    ToAPIs Engineering & Evaluation Team
    #Webhooks
    ToAPIs
    InicioToAPIs
    Pasarela empresarial de API de IA. Accede a GPT-5, Claude, Gemini y más de 200 modelos mediante una única API unificada.

    Modelos populares

    • Seedance 2.5 API
    • Seedance 2.0 API
    • Veo 3.1 Fast API
    • Kling 3.0 Turbo API
    Mostrar másMostrar menos
    • GPT Image 2 API
    • Claude Opus 4.8 API
    • Nano Banana 2 API
    • Seedance 2 Mini API
    • Todos los modelos

    Categorías de API

    • API de imagen con IA
    • API de vídeo con IA
    • API texto a vídeo
    • API imagen a vídeo
    Mostrar másMostrar menos
    • API de edición de imágenes con IA
    • API de LLM y razonamiento
    • Todas las herramientas API →

    Alternativas

    Alternativas
    • Alternativa a Kie.ai
    • Alternativa a Fal.ai
    • Alternativa a OpenRouter
    • Alternativa a Replicate
    • Alternativa a Wavespeed AI
    • Todas las comparativas →

    Guías destacadas

    Guías destacadas
    • Precios de Seedance 2.0 y 2.5
    • Guía de la API Seedance más económica
    • Guía de integración de MiniMax H3
    • Clave de API gratuita de Seedance 2
    • Inicio rápido de la API Seedance 2
    • Todos los artículos técnicos →

    Desarrolladores y plataforma

    Desarrolladores y plataforma
    • Documentación de API
    • MCP
    • Precios
    • Área de pruebas de modelos
    • LLMs.txt
    • Contactar con soporte
    • Directorio de guías de modelos
    Entidad operadora:
    鯨樞智能科技有限公司
    JINGSHU INTELLIGENT LIMITED
    Domicilio social:
    ROOM 5042, 5/F, YAU LEE CENTRE, NO.45, HOI YUEN ROAD, KWUN TONG, KOWLOON, HONG KONG
    PrivacidadTérminosUso aceptableEliminación de datosConservación de datosSubencargados y regionesFacturación y reembolsosPolítica de cookiesMapa del sitioAcerca de

    © 2026 ToAPIs. Todos los derechos reservados.