WorldRouter

Skip to Content

Generate Videos with PixVerse

What you can do

Use WorldRouter’s native PixVerse-compatible routes to create videos with the official PixVerse pixverse-c1 and pixverse-v6 models.

Before you start

PixVerse generation is asynchronous. Create a video task first, then poll the result route until the generated video URL is ready.

Task routes

  • POST /openapi/v2/video/text/generate
  • POST /openapi/v2/image/upload
  • POST /openapi/v2/media/upload
  • POST /openapi/v2/video/img/generate
  • POST /openapi/v2/video/transition/generate
  • POST /openapi/v2/video/fusion/generate
  • POST /openapi/v2/video/extend/generate
  • GET /openapi/v2/video/result/{video_id}
Tip:

Start from Quickstart if you still need an API key or the base URL. Use the same origin shown there: https://inference-api-pre-d80ca3.worldrouter.ai. PixVerse routes append /openapi/v2/... and are not part of the OpenAI-compatible /v1/videos surface.

Quick start flow

  1. 1Create a PixVerse task with POST /openapi/v2/video/text/generate.
  2. 2Save the returned Resp.video_id.
  3. 3Check the result with GET /openapi/v2/video/result/{video_id} until Resp.status is 1.
  4. 4Read Resp.url from the result response and download the generated video from that URL.

Supported request models

These are the request model names you should send in the model field:

ModelBest for
pixverse-c1PixVerse C1 generation with higher-quality creative video output.
pixverse-v6PixVerse V6 generation for faster standard video creation workflows.

Text-to-video

Start here if you want the simplest PixVerse workflow.

This example uses a conservative smoke-test payload that is accepted by the PixVerse upstream API.

curl
curl -X POST "https://inference-api-pre-d80ca3.worldrouter.ai/openapi/v2/video/text/generate" \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-H "Ai-trace-id: pixverse-c1-smoke-001" \
-d '{
  "model": "pixverse-c1",
  "prompt": "A small blue cube rotating on a white desk, clean studio lighting",
  "duration": 1,
  "quality": "360p",
  "aspect_ratio": "16:9",
  "generate_audio_switch": false
}'

You can start with this example as-is, then adjust the parts that matter most for your use case:

  • model: choose pixverse-c1 or pixverse-v6.
  • prompt: describe the subject, style, setting, and motion you want.
  • duration: choose the generated video duration supported by PixVerse.
  • quality: choose the output quality supported by PixVerse, such as 360p or 720p.
  • aspect_ratio: include an explicit aspect ratio such as 16:9.
  • generate_audio_switch: set whether PixVerse should generate audio when the selected model and account support it.

Typical create response:

200 OK
{
"ErrCode": 0,
"ErrMsg": "success",
"Resp": {
  "video_id": 407432230962212,
  "credits": 3,
  "credits_unit": "worldrouter"
}
}

This response confirms that the task was created successfully. Your video is not ready yet. WorldRouter returns Resp.credits in WorldRouter Credits.

Save the returned Resp.video_id, then continue to Check video result.

Check video result

Use the video_id returned from the create response to check whether the video is still running, has succeeded, or has failed.

curl
curl "https://inference-api-pre-d80ca3.worldrouter.ai/openapi/v2/video/result/407432230962212" \
-H "Authorization: Bearer your_api_key" \
-H "Ai-trace-id: pixverse-c1-result-407432230962212"

Typical running response:

200 OK
{
"ErrCode": 0,
"ErrMsg": "Success",
"Resp": {
  "id": 407432230962212,
  "status": 5
}
}

When Resp.status becomes 1, use Resp.url to download the final video:

200 OK
{
"ErrCode": 0,
"ErrMsg": "Success",
"Resp": {
  "id": 407432230962212,
  "status": 1,
  "url": "https://media.pixverse.ai/pixverse/mp4/example.mp4",
  "outputWidth": 640,
  "outputHeight": 360,
  "has_audio": false,
  "credits": 3,
  "credits_unit": "worldrouter"
}
}

PixVerse status values are provider-native. The most common values are:

StatusMeaning
5The task is still running.
1The task succeeded.
6The task was deleted.
7The task was moderated.
8The task failed.

Download the video

After the result response includes Resp.url, download the video from that URL:

curl
curl -L "https://media.pixverse.ai/pixverse/mp4/example.mp4" \
-o pixverse-output.mp4

You can also extract and download the URL in one shell flow:

curl + jq
VIDEO_URL="$(curl -s "https://inference-api-pre-d80ca3.worldrouter.ai/openapi/v2/video/result/407432230962212" \
-H "Authorization: Bearer your_api_key" | jq -r '.Resp.url')"

curl -L "$VIDEO_URL" -o pixverse-output.mp4

Image and transition routes

PixVerse also supports image-guided and multi-input video routes. They use the same authentication, ownership, polling, and result flow:

RouteUse case
POST /openapi/v2/image/uploadUpload an image and receive the img_id PixVerse expects.
POST /openapi/v2/media/uploadUpload a video/audio file and receive media_id.
POST /openapi/v2/video/img/generateGenerate video from an image prompt.
POST /openapi/v2/video/transition/generateGenerate a transition between images.
POST /openapi/v2/video/fusion/generateFuse multiple visual inputs into a video.
POST /openapi/v2/video/extend/generateExtend an existing PixVerse video.

Send the PixVerse-compatible JSON body for the route you are using, then poll GET /openapi/v2/video/result/{video_id} the same way as text-to-video.

Upload an image

Use this request before image-to-video, transition, or fusion workflows. The returned Resp.img_id is the value to send in later video requests. WorldRouter accepts multipart image upload bodies up to 20 MiB by default. Larger requests return 413 before they are forwarded to PixVerse.

curl
curl -X POST "https://inference-api-pre-d80ca3.worldrouter.ai/openapi/v2/image/upload" \
-H "Authorization: Bearer your_api_key" \
-H "Ai-trace-id: pixverse-image-upload-001" \
-F "image=@/absolute/path/to/reference.png"

Typical upload response:

200 OK
{
"ErrCode": 0,
"ErrMsg": "success",
"Resp": {
  "img_id": 123456789,
  "img_url": "https://media.pixverse.ai/pixverse/image/example.png"
}
}

Upload video or audio media

Use this request before extending an uploaded external video. The returned Resp.media_id is the value to send as video_media_id in an extend request. WorldRouter accepts multipart media upload bodies up to 200 MiB by default. Larger requests return 413 before they are forwarded to PixVerse.

curl
curl -X POST "https://inference-api-pre-d80ca3.worldrouter.ai/openapi/v2/media/upload" \
-H "Authorization: Bearer your_api_key" \
-H "Ai-trace-id: pixverse-media-upload-001" \
-F "file=@/absolute/path/to/input.mp4"

Typical media upload response:

200 OK
{
"ErrCode": 0,
"ErrMsg": "success",
"Resp": {
  "media_id": 987654321,
  "media_type": "video",
  "url": "https://media.pixverse.ai/pixverse/mp4/example.mp4"
}
}

Image-to-video request

Use img_id from a PixVerse image upload. Do not send a raw image URL in this field.

POST /openapi/v2/video/img/generate
{
"model": "pixverse-v6",
"img_id": 123456789,
"prompt": "The product photo slowly rotates on a glossy tabletop",
"duration": 5,
"quality": "540p",
"aspect_ratio": "16:9",
"motion_mode": "normal",
"generate_audio_switch": false
}

Transition request

Upload both images first, then use the returned image IDs for the first and last frames.

POST /openapi/v2/video/transition/generate
{
"model": "pixverse-v6",
"first_frame_img": 123456789,
"last_frame_img": 987654321,
"prompt": "A smooth cinematic transition from morning to evening",
"duration": 5,
"quality": "540p",
"aspect_ratio": "16:9",
"motion_mode": "normal",
"generate_audio_switch": false
}

Fusion request

Use image_references to bind uploaded images to names you mention in the prompt.

POST /openapi/v2/video/fusion/generate
{
"model": "pixverse-v6",
"image_references": [
  {
    "type": "subject",
    "img_id": 123456789,
    "ref_name": "product"
  },
  {
    "type": "background",
    "img_id": 987654321,
    "ref_name": "studio"
  }
],
"prompt": "Place @product on @studio with a slow dolly-in camera move",
"duration": 5,
"quality": "540p",
"aspect_ratio": "16:9",
"generate_audio_switch": false
}

Extend request

Use source_video_id from an earlier PixVerse generation response, or upload an external video first and use the returned media_id as video_media_id.

Extend a generated PixVerse video
{
"model": "pixverse-v6",
"source_video_id": 407432230962212,
"prompt": "Continue the same camera motion for a few more seconds",
"duration": 5,
"quality": "540p",
"generate_audio_switch": false
}
Extend an uploaded video
{
"model": "pixverse-v6",
"video_media_id": 987654321,
"prompt": "Continue the same camera motion for a few more seconds",
"duration": 5,
"quality": "540p",
"generate_audio_switch": false
}

Notes and limits

  • PixVerse requires a team-scoped key with enough available credits. Low balance returns 402 with a PixVerse balance error.
  • Pending PixVerse jobs per user are capped. Too many running tasks return 429.
  • Result reads are owner-scoped. You can only poll videos created by the same authorized owner context.
  • WorldRouter records successful terminal PixVerse results for usage billing when Resp.status is 1.
  • Keep aspect_ratio explicit in create requests. Missing or unsupported PixVerse fields may return 400013 Invalid field type or value from the upstream API.

Troubleshooting

SymptomLikely causeWhat to do
400 unsupported_modelYou sent the wrong model or hit the wrong endpointUse pixverse-c1 or pixverse-v6 on one of the /openapi/v2/video/... PixVerse routes.
400013 Invalid field type or valueThe PixVerse upstream rejected the request payloadStart with duration: 1, quality: "360p", aspect_ratio: "16:9", then adjust fields.
402 pixverse_balance_too_lowThe scoped team does not have enough available creditsRecharge on Credits and retry.
403 media_resource_access_deniedThe video belongs to another owner contextReuse the same account/team/API key that created the video task.
413 / 413001The upload body is larger than the gateway limitCompress the image/video or use a smaller file, then upload it again.
429 pixverse_too_many_pending_tasksToo many of your PixVerse tasks are still runningWait for active tasks to finish before creating more.

See also

Last updated on