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-2as a universal generation ID. A 2026-11-23 check of the official Sora2 VVIP Video Generation reference (HTTP 200) lists the generation modelsora-2-vvip. The official Create Character and Video Remix pages (HTTP 200) listsora-2andsora-2-profor those jobs. The docs path usessora2;/videos/sora-2/generationreturned HTTP 404. There is no live model-guide page:/model-guide/sora-2,/sora2,/openai-sora-2, and/sora2-vvipall returned HTTP 200 with the title “Model Guide Not Found”, and none of those slugs appear intoapis.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). Draftpersona_idand@persona_idtokens 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 documentedmodelstrings and bodies. Poll a video task atGET /v1/videos/generations/{id}(ordinary tasks may also be queried withGET /v1/tasks/{id}). Poll a character-creation task atGET /v1/characters_tasks/{task_id}. Remix isPOST /v1/videos/{video_id}/remix. Official examples usehttps://toapis.com(mainland China:https://toapis.cn). Earlier posts in this series sometimes usedhttps://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.
| Job | Official page | HTTP method and path | Documented model values |
|---|---|---|---|
| VVIP video generation | Sora2 VVIP Video Generation | POST /v1/videos/generations | sora-2-vvip |
| Create character | Sora2 Create Character | POST /v1/videos/generations | sora-2, sora-2-pro |
| Query character status | Sora2 Query Character Status | GET /v1/characters_tasks/{task_id} | (path uses the character-creation task id) |
| Video remix | Sora2 Video Remix | POST /v1/videos/{video_id}/remix | sora-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:
- Put
@usernamein the prompt, usingcharacters[].usernamefrom the completed character task (for example"@duksvfkf.turbo_whis is dancing in the rain"). The VVIP generation page describes the same@usernamepattern and says the username can be obtained via the Query Character API. - An example on the Query Character Status page posts
model: "sora-2"with a top-levelcharacter_urlset to a character-creation task id. That example is not identical tometadata.character_urlon 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).

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:
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):
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:
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
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 state | Common category | Recommended action |
|---|---|---|
400 | Wrong model string for the job, missing timestamps, both or neither of url / from_task, or an unsupported duration | Send sora-2-vvip for VVIP generation; send sora-2 or sora-2-pro for character or remix; confirm duration against that page |
401 | Missing or invalid API key | Rotate the key in the ToAPIs dashboard and confirm the Authorization: Bearer header. No additional documented scope header is required |
429 | Rate or concurrency limit | Honor Retry-After when present; back off with jitter; retry only when safe |
5xx or client timeout | Temporary gateway or upstream issue | Query the existing task id (video or character path) before resubmitting |
status: queued or in_progress | Not an error | Wait and poll again on the correct path |
status: failed | Generation or character creation did not succeed | Read error.code and error.message. Do not retry an unchanged policy-rejected payload |
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-vvipgeneration andsora-2/sora-2-procharacter 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-vvipfor VVIP generation, andsora-2orsora-2-profor 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
timestampsplusurlorfrom_task, then pollGET /v1/characters_tasks/{task_id}. - Reuse a completed character via
@usernamefromresult.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].urlonly after a video task iscompleted. - Price from the live account catalog; do not reuse draft dollar or latency figures.
- Download finished videos before
expires_at(documented 30-day retention).