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. OpenAI Sora 2 API: Endpoints, Authentication Scopes, and Persona Creation
    Volver a todos los artículos
    tutorial2026-11-237 min de lectura

    OpenAI Sora 2 API: Endpoints, Authentication Scopes, and Persona Creation

    A production guide to ToAPIs Sora2 endpoints: the documented generation ID sora-2-vvip, character creation and status with sora-2 or sora-2-pro, remix, Bearer authentication, and the absence of a live model-guide price.

    ToAPIs Engineering & Evaluation Team
    Sora 2Video APITutorialCharacter APIOpenAI
    TL;DR - Puntos clave
    • The official Sora2 VVIP Video Generation reference documents the public generation ID sora-2-vvip, not sora-2 or sora2. Character creation and remix pages document sora-2 and sora-2-pro as separate model strings. Do not collapse these IDs. Planning drafts that send a single sora-2 generation ID, a persona_id field, or @persona_id are not the current contract.
    • Authentication is a Bearer API key on every official page checked on 2026-11-23. Those pages do not document OAuth-style authentication scopes. The schedule title mentions scopes; this article does not invent any.
    • Submit VVIP generation to POST /v1/videos/generations and poll GET /v1/videos/generations/{id}. Ordinary video tasks may also be queried with GET /v1/tasks/{id}. Create a character on the same generations path with sora-2 or sora-2-pro, then poll GET /v1/characters_tasks/{task_id}. Remix is POST /v1/videos/{video_id}/remix. Official examples use https://toapis.com (mainland China: https://toapis.cn).
    • VVIP generation duration is 4, 8, or 12 seconds; aspect ratio is 16:9 or 9:16. Remix documents different durations (sora-2: 10 or 15 seconds; sora-2-pro: 15 HD or 25 seconds) and also allows 1:1. Character timestamps use start_second,end_second with a 1–3 second span. The source video must contain audio and identifiable characters.
    • No live Sora model-guide page existed on 2026-11-23 (sora-2, sora2, openai-sora-2, and sora2-vvip all returned the title Model Guide Not Found). Official generation docs publish no credit or currency rate. Do not copy draft prices or latency claims. relatedModels is left empty so the article does not link to a missing guide.

    OpenAI Sora 2 API: Endpoints, Authentication Scopes, and Persona Creation

    Target Model: sora-2-vvip (character and remix IDs: sora-2, sora-2-pro)
    Inference Endpoint: https://toapis.com/v1/videos/generations
    Related: Wan 2.6 image-to-video and R2V pipeline · Sora2 VVIP generation · Sora2 Create Character · Sora2 Query Character Status · Sora2 Video Remix


    1. TL;DR & Performance Overview

    • Catalog first: Planning drafts often send sora-2 as a universal generation ID. A 2026-11-23 check of the official Sora2 VVIP Video Generation reference (HTTP 200) lists the generation model sora-2-vvip. The official Create Character and Video Remix pages (HTTP 200) list sora-2 and sora-2-pro for those jobs. The docs path uses sora2; /videos/sora-2/generation returned HTTP 404. There is no live model-guide page: /model-guide/sora-2, /sora2, /openai-sora-2, and /sora2-vvip all returned HTTP 200 with the title “Model Guide Not Found”, and none of those slugs appear in toapis.com/sitemap.xml.
    • “Persona” versus documented names: The docs path is create-persona / get-personas, but the English page titles are Sora2 Create Character and Sora2 Query Character Status. Official fields use character terminology (timestamps, url, from_task, result.data.characters, username). Draft persona_id and @persona_id tokens are not on those pages.
    • Authentication: Every official Sora2 page checked that day requires Authorization: Bearer <API_KEY>. They do not document OAuth-style authentication scopes. The article title keeps the schedule wording; this body does not invent scopes.
    • Contract: VVIP generation and character creation both POST to /v1/videos/generations, but they use different documented model strings and bodies. Poll a video task at GET /v1/videos/generations/{id} (ordinary tasks may also be queried with GET /v1/tasks/{id}). Poll a character-creation task at GET /v1/characters_tasks/{task_id}. Remix is POST /v1/videos/{video_id}/remix. Official examples use https://toapis.com (mainland China: https://toapis.cn). Earlier posts in this series sometimes used https://api.toapis.com. This article follows the official examples.
    • Unverified claims to drop: Draft prices such as $0.050/second, draft latency or SLA figures, a 5-second duration, native 1080p / 2.39:1 claims, and a “persona from 2–3 photos” flow are not in the official pages checked on 2026-11-23.

    2. Official Endpoints, Model IDs, and Character Fields

    Use the model string documented for the job you are running. Do not assume one ID covers generation, character extraction, and remix.

    JobOfficial pageHTTP method and pathDocumented model values
    VVIP video generationSora2 VVIP Video GenerationPOST /v1/videos/generationssora-2-vvip
    Create characterSora2 Create CharacterPOST /v1/videos/generationssora-2, sora-2-pro
    Query character statusSora2 Query Character StatusGET /v1/characters_tasks/{task_id}(path uses the character-creation task id)
    Video remixSora2 Video RemixPOST /v1/videos/{video_id}/remixsora-2, sora-2-pro

    VVIP generation documents prompt (required; you may mention previously created characters with @username, and multiple characters are supported), duration (4, 8, or 12 seconds), aspect_ratio (16:9 or 9:16), image_urls (public http(s) URLs only; base64 is not accepted — use the Upload Image API first), thumbnail, and metadata fields n (1–4 variants), watermark, private, style (thanksgiving, comic, news, selfie, nostalgic, anime), storyboard, character_url (described on that page as a reference video URL for character extraction; using it reduces generated duration by 1 second), character_timestamps (start_second,end_second, only 2-second segments; also reduces duration by 1 second), character_create, and character_from_task.

    Create Character documents a different body: timestamps is required (start_second,end_second, minimum difference 1 second, maximum 3 seconds). Either url or from_task is required. prompt is not required. The official overview states that the source video must contain audio and identifiable characters.

    Query Character Status returns a generation.task object. When status is completed, result.type is character and result.data.characters is an array of objects with id, display_name, profile_picture_url, and username. Official polling recommendations are a 5-second interval and a 5-minute maximum wait.

    The Query Character Status page then documents two ways to reuse a character in a later generation request:

    1. Put @username in the prompt, using characters[].username from the completed character task (for example "@duksvfkf.turbo_whis is dancing in the rain"). The VVIP generation page describes the same @username pattern and says the username can be obtained via the Query Character API.
    2. An example on the Query Character Status page posts model: "sora-2" with a top-level character_url set to a character-creation task id. That example is not identical to metadata.character_url on the VVIP generation reference, which is described as a reference video URL. This article does not merge the two descriptions. Follow the live generation reference for the body you submit.

    Remix takes the original video task id as video_id in the path, a required prompt, optional duration (different from VVIP generation: sora-2 supports 10 or 15 seconds; sora-2-pro supports 15 seconds HD or 25 seconds), and optional aspect_ratio (16:9, 9:16, or 1:1).

    Abstract flow: a generation request goes through a task node to an output frame, with a character-extraction branch and a remix return path

    Figure 1: VVIP generation and character creation both POST to /v1/videos/generations but use different documented model strings. Poll video tasks at GET /v1/videos/generations/{id} and character tasks at GET /v1/characters_tasks/{task_id}. Remix is POST /v1/videos/{video_id}/remix.


    3. Production Implementation: cURL & Python

    The snippets follow official examples on https://toapis.com. Replace the origin with https://toapis.cn if you are calling from mainland China.

    Step 1: cURL for VVIP generation, character creation, and remix

    VVIP generation with a character mention in the prompt:

    bash
    curl --request POST \
      --url https://toapis.com/v1/videos/generations \
      --header "Authorization: Bearer $TOAPIS_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
        "model": "sora-2-vvip",
        "prompt": "A cat and a dog driving a car together @duksvfkf.cruisingki @zdqwahgj.baronbarki",
        "duration": 8,
        "aspect_ratio": "16:9"
      }'
    

    Create a character from a public video URL (model is sora-2, not sora-2-vvip):

    bash
    curl --request POST \
      --url https://toapis.com/v1/videos/generations \
      --header "Authorization: Bearer $TOAPIS_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
        "model": "sora-2",
        "url": "https://example.com/character-video.mp4",
        "timestamps": "1,3"
      }'
    

    Poll the character task, then remix a completed video task:

    bash
    curl --request GET \
      --url "https://toapis.com/v1/characters_tasks/$CHARACTER_TASK_ID" \
      --header "Authorization: Bearer $TOAPIS_API_KEY"
    
    curl --request POST \
      --url "https://toapis.com/v1/videos/$VIDEO_TASK_ID/remix" \
      --header "Authorization: Bearer $TOAPIS_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
        "model": "sora-2",
        "prompt": "Keep the same character and move the scene to a rainy street at night",
        "duration": 15,
        "aspect_ratio": "16:9"
      }'
    

    Step 2: Python helpers and bounded pollers

    python
    import os
    import time
    import requests
    
    API_KEY = os.environ["TOAPIS_API_KEY"]
    BASE = "https://toapis.com"
    HEADERS = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json",
    }
    
    VVIP_ID = "sora-2-vvip"
    CHARACTER_AND_REMIX_IDS = {"sora-2", "sora-2-pro"}
    VVIP_DURATIONS = {4, 8, 12}
    REMIX_DURATION = {
        "sora-2": {10, 15},
        "sora-2-pro": {15, 25},
    }
    
    
    def dispatch_vvip(
        prompt: str,
        *,
        duration: int = 8,
        aspect_ratio: str = "16:9",
        image_urls: list[str] | None = None,
        thumbnail: bool | None = None,
        metadata: dict | None = None,
    ) -> str:
        if duration not in VVIP_DURATIONS:
            raise ValueError("sora-2-vvip duration must be 4, 8, or 12")
        if aspect_ratio not in {"16:9", "9:16"}:
            raise ValueError("sora-2-vvip aspect_ratio must be 16:9 or 9:16")
        payload: dict = {
            "model": VVIP_ID,
            "prompt": prompt,
            "duration": duration,
            "aspect_ratio": aspect_ratio,
        }
        if image_urls:
            payload["image_urls"] = image_urls
        if thumbnail is not None:
            payload["thumbnail"] = thumbnail
        if metadata:
            payload["metadata"] = metadata
        res = requests.post(f"{BASE}/v1/videos/generations", headers=HEADERS, json=payload, timeout=30)
        res.raise_for_status()
        data = res.json()
        task_id = data.get("id") or data.get("task_id")
        if not task_id:
            raise RuntimeError(f"Unexpected submission envelope: {data}")
        return task_id
    
    
    def create_character(
        *,
        timestamps: str,
        url: str | None = None,
        from_task: str | None = None,
        model: str = "sora-2",
    ) -> str:
        if model not in CHARACTER_AND_REMIX_IDS:
            raise ValueError("Create Character documents sora-2 and sora-2-pro")
        if not url and not from_task:
            raise ValueError("either url or from_task is required")
        if url and from_task:
            raise ValueError("send url or from_task, not both, unless a later official page says otherwise")
        payload: dict = {"model": model, "timestamps": timestamps}
        if url:
            payload["url"] = url
        if from_task:
            payload["from_task"] = from_task
        res = requests.post(f"{BASE}/v1/videos/generations", headers=HEADERS, json=payload, timeout=30)
        res.raise_for_status()
        data = res.json()
        task_id = data.get("id") or data.get("task_id")
        if not task_id:
            raise RuntimeError(f"Unexpected submission envelope: {data}")
        return task_id
    
    
    def poll_video(task_id: str, deadline_s: int = 900) -> str:
        poll_url = f"{BASE}/v1/videos/generations/{task_id}"
        interval = 10.0
        start = time.time()
        time.sleep(5)
        while time.time() - start < deadline_s:
            poll = requests.get(poll_url, headers=HEADERS, timeout=15)
            if poll.status_code == 429:
                retry_after = poll.headers.get("Retry-After")
                time.sleep(float(retry_after) if retry_after else min(interval * 2, 120))
                continue
            poll.raise_for_status()
            data = poll.json()
            status = data.get("status")
            if status == "completed":
                return data["result"]["data"][0]["url"]
            if status == "failed":
                raise RuntimeError(f"Generation failed: {data.get('error')}")
            time.sleep(interval)
            interval = min(interval * 1.5, 30.0)
        raise TimeoutError(f"Task {task_id} exceeded {deadline_s}s; check status before retrying")
    
    
    def poll_character(task_id: str, deadline_s: int = 300, interval: int = 5) -> list[dict]:
        # Official Query Character Status recommendation: 5s interval, 5-minute max wait.
        poll_url = f"{BASE}/v1/characters_tasks/{task_id}"
        start = time.time()
        while time.time() - start < deadline_s:
            poll = requests.get(poll_url, headers=HEADERS, timeout=15)
            if poll.status_code == 429:
                retry_after = poll.headers.get("Retry-After")
                time.sleep(float(retry_after) if retry_after else interval * 2)
                continue
            poll.raise_for_status()
            data = poll.json()
            status = data.get("status")
            if status == "completed":
                return data["result"]["data"]["characters"]
            if status == "failed":
                raise RuntimeError(f"Character creation failed: {data.get('error')}")
            time.sleep(interval)
        raise TimeoutError(f"Character task {task_id} exceeded {deadline_s}s; check status before retrying")
    
    
    def remix_video(
        video_id: str,
        prompt: str,
        *,
        model: str = "sora-2",
        duration: int = 15,
        aspect_ratio: str = "16:9",
    ) -> str:
        if model not in CHARACTER_AND_REMIX_IDS:
            raise ValueError("Remix documents sora-2 and sora-2-pro")
        if duration not in REMIX_DURATION[model]:
            raise ValueError(f"{model} remix duration is not in the documented set {sorted(REMIX_DURATION[model])}")
        if aspect_ratio not in {"16:9", "9:16", "1:1"}:
            raise ValueError("remix aspect_ratio must be 16:9, 9:16, or 1:1")
        payload = {
            "model": model,
            "prompt": prompt,
            "duration": duration,
            "aspect_ratio": aspect_ratio,
        }
        res = requests.post(f"{BASE}/v1/videos/{video_id}/remix", headers=HEADERS, json=payload, timeout=30)
        res.raise_for_status()
        data = res.json()
        task_id = data.get("id") or data.get("task_id")
        if not task_id:
            raise RuntimeError(f"Unexpected submission envelope: {data}")
        return task_id
    
    
    if __name__ == "__main__":
        character_task = create_character(
            url="https://example.com/character-video.mp4",
            timestamps="1,3",
        )
        characters = poll_character(character_task)
        username = characters[0]["username"]
        video_task = dispatch_vvip(
            f"@{username} walks through a sunlit courtyard, cinematic camera",
            duration=8,
        )
        print("Character task:", character_task, "username:", username)
        print("Video:", poll_video(video_task))
    

    The official Create Character page notes that url and from_task are alternative sources. The helper above refuses to send both; if a later official page documents a combined form, follow that page. Download finished videos before expires_at; the video task status reference documents a 30-day retention window.


    4. Error Handling & Status Matrix

    The categories below are diagnostic starting points, not a guarantee of exact ToAPIs error codes. A successful HTTP query still requires you to read task status. See the error reference. Official character examples include 400 invalid request and 401 authentication failed envelopes.

    HTTP or task stateCommon categoryRecommended action
    400Wrong model string for the job, missing timestamps, both or neither of url / from_task, or an unsupported durationSend sora-2-vvip for VVIP generation; send sora-2 or sora-2-pro for character or remix; confirm duration against that page
    401Missing or invalid API keyRotate the key in the ToAPIs dashboard and confirm the Authorization: Bearer header. No additional documented scope header is required
    429Rate or concurrency limitHonor Retry-After when present; back off with jitter; retry only when safe
    5xx or client timeoutTemporary gateway or upstream issueQuery the existing task id (video or character path) before resubmitting
    status: queued or in_progressNot an errorWait and poll again on the correct path
    status: failedGeneration or character creation did not succeedRead error.code and error.message. Do not retry an unchanged policy-rejected payload

    WaitTime=min⁡(MaxWait,BaseInterval×2attempt)+Uniform(0,1)\text{WaitTime} = \min(\text{MaxWait}, \text{BaseInterval} \times 2^{\text{attempt}}) + \text{Uniform}(0, 1)WaitTime=min(MaxWait,BaseInterval×2attempt)+Uniform(0,1)


    5. Pricing & FinOps ROI

    The official Sora2 generation, Create Character, Query Character Status, and Remix references do not publish a credits/second or currency table. On 2026-11-23 there was also no live model-guide page to snapshot. Do not copy planning-draft dollar rates, and do not invent a unit price from another model family.

    Use your account catalog as the source of truth. When a task completes, the video task status reference documents usage and billing fields on that query path, and it states that examples illustrate fields rather than current model prices. Prefer the amounts returned for the actual task, together with the live quote, over any figure in a blog post.

    • Match the ID to the job before you forecast cost. sora-2-vvip generation and sora-2 / sora-2-pro character or remix jobs are documented as different catalog strings.
    • Duration sets are not interchangeable. A 4/8/12-second VVIP clip is not the same contract as a 10/15-second or 15/25-second remix.
    • A missing model-guide page is not a reason to invent a rate. Re-check the catalog on the day you budget a batch.

    6. Frequently Asked Questions

    See the FAQ block in frontmatter. Summary: generate with sora-2-vvip; create and remix with sora-2 or sora-2-pro; authentication is a Bearer key with no documented OAuth scopes; use @username from the completed character task, not a draft @persona_id; poll video and character tasks on their documented paths; there is no official public unit price as of 2026-11-23.


    7. Action Checklist

    • Send sora-2-vvip for VVIP generation, and sora-2 or sora-2-pro for character creation and remix — not a single draft alias for every job.
    • Authenticate with Authorization: Bearer <API_KEY> only; do not invent scope headers.
    • Create characters with timestamps plus url or from_task, then poll GET /v1/characters_tasks/{task_id}.
    • Reuse a completed character via @username from result.data.characters[], and follow the live generation reference if you also send character URL fields.
    • Use only documented durations and aspect ratios for the specific endpoint.
    • Persist task ids, poll the correct status path, and read result.data[0].url only after a video task is completed.
    • Price from the live account catalog; do not reuse draft dollar or latency figures.
    • Download finished videos before expires_at (documented 30-day retention).

    Artículos relacionados

    tutorial2026-11-23T10:00:00+08:008 min de lectura

    Building Precision Image-to-Video Pipelines with Wan 2.6 R2V API

    A production guide to Wan 2.6 image-to-video and reference-video (R2V) on ToAPIs: documented public IDs wan2.6 and wan2.6-flash, routing rules, exclusive media fields, polling, and dated pricing snapshots.

    TO
    ToAPIs Engineering & Evaluation Team
    #Wan 2.6
    tutorial2026-11-20T10:00:00+08:008 min de lectura

    Alibaba Wan 3.0 Video API: Getting Started with Next-Gen Video Generation

    A production quickstart for wan3.0-video and wan3.0-video-prime on ToAPIs: one All-in-One endpoint, first and last frames versus reference media, file or link references, video editing constraints, and the documented polling path.

    TO
    ToAPIs Engineering & Evaluation Team
    #Wan 3.0
    tutorial2026-11-18T10:00:00+08:007 min de lectura

    Kling 3.0 Turbo API: Architecting High-Volume Short-Form Video Automation

    A production guide to kling-3.0-turbo on ToAPIs: documented duration and resolution ranges, first-frame-only image input, a bounded poll loop, and high-volume short-form automation without unverified draft prices.

    TO
    ToAPIs Engineering & Evaluation Team
    #Kling Turbo
    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.