Skip to main content
POST
/
v1
/
videos
/
generations
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "pixverse-v6",
    "prompt": "A cinematic shot of a corgi running through a sunflower field at golden hour",
    "size": "16:9",
    "resolution": "540p",
    "duration": 5
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01JWXXXXXXXXXXXX"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "pixverse-v6",
    "prompt": "A cinematic shot of a corgi running through a sunflower field at golden hour",
    "size": "16:9",
    "resolution": "540p",
    "duration": 5
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01JWXXXXXXXXXXXX"
    }
  ]
}

Authentication

Authorization
string
required
All endpoints require authentication using a Bearer Token.Get an API Key:Visit the API Key management page to obtain your API Key.Add the following header in your request:
Authorization: Bearer YOUR_API_KEY

Request Parameters

model
string
required
Video generation model name. Fixed to pixverse-v6.
prompt
string
required
Video content description, up to 5000 characters. Required for all modes.
resolution
string
default:"540p"
Video resolution tier; directly affects pricing.
  • 360p: SD
  • 540p: Standard (default)
  • 720p: HD
  • 1080p: Full HD
Other resolution values will return a parameter error.
duration
integer
default:"5"
Video duration in seconds, range 1-15.
First/last frame transition mode only supports 5 or 8 seconds.
size
string
default:"16:9"
Video aspect ratio. Only effective in text-to-video and multi-reference fusion modes.
  • 16:9: Landscape widescreen (default)
  • 4:3: Landscape 4:3
  • 1:1: Square
  • 3:4: Portrait 3:4
  • 9:16: Portrait vertical
  • 2:3: Portrait 2:3
  • 3:2: Landscape 3:2
  • 21:9: Cinematic widescreen
seed
integer
default:"0"
Random seed, range 0-2147483647. Same prompt and seed can reproduce similar results.
negative_prompt
string
Negative prompt used to exclude unwanted content, up to 2048 characters.
audio
boolean
default:"false"
Whether to generate an audio track.
  • true: Generate audio (increases pricing)
  • false: No audio (default)
watermark
boolean
default:"false"
Whether to add a watermark in the bottom-right corner of the video.
  • true: Add watermark
  • false: No watermark (default)
motion_mode
string
Motion mode.
  • normal: Standard mode (pixverse-v6 only supports this value)
fast only applies to legacy models and will be rejected by the upstream when used with pixverse-v6.
generate_multi_clip_switch
boolean
default:"false"
Whether to generate a multi-clip continuous video. Only supported in text-to-video and image-to-video modes.
  • true: Generate multi-clip continuous video
  • false: Single clip (default)
image_urls
array<url>
Input image URL array for image-to-video; only the first image is used.Images must be publicly accessible HTTP/HTTPS URLs.
first_frame_image
url
First frame image URL for transition mode. Must be provided together with last_frame_image.
last_frame_image
url
Last frame image URL for transition mode. Must be provided together with first_frame_image.
img_references
array<url>
Reference image URL array for multi-reference fusion mode; supports 1-7 images.Providing this field triggers multi-reference fusion mode.
extend_from_task_id
string
Source task ID for video extension. Providing this field triggers video extension mode.The source task must belong to the current user, use model pixverse-v6, and have status completed.

Generation Modes

The adapter automatically dispatches to the corresponding generation mode based on request fields. Matching is done in priority order; the first match wins.
ModeTriggerDescription
Text-to-videoNo image or extension fieldsGenerate video based on prompt
Image-to-videoimage_urls with one imageUse the first image as input
First/last frame transitionBoth first_frame_image and last_frame_image providedGenerate a smooth transition between two frames
Multi-reference fusionimg_references array providedFuse 1-7 reference images into a video
Video extensionextend_from_task_id providedContinue generation from a completed Pixverse task
All image inputs only accept publicly accessible HTTP/HTTPS URLs. base64 and Data URI are not supported. If you only have local images, upload them to object storage first and pass the URL.

Parameter Rules

ConstraintDescription
Duration1 ≤ duration ≤ 15 seconds; transition mode only supports 5 or 8 seconds
ResolutionOnly 360p, 540p, 720p, 1080p are supported
Aspect ratiosize is only effective in text-to-video and multi-reference fusion modes
Prompt lengthprompt up to 5000 chars, negative_prompt up to 2048 chars
Image-to-videoimage_urls only uses the first image
Transitionfirst_frame_image and last_frame_image must be provided together
Motion modepixverse-v6 only supports normal
Multi-reference fusionimg_references supports 1-7 images
Video extensionextend_from_task_id must point to a completed pixverse-v6 task owned by the current user

Response

code
integer
Response status code. 200 on success.
data
array
Returned task array.

Querying Task Results

Video generation is an asynchronous task. After submission, a task_id is returned. Use the Get Task Status endpoint to query progress and results.
cURL
curl --request GET \
  --url https://api.apimart.ai/v1/tasks/task_01JWXXXXXXXXXXXX \
  --header 'Authorization: Bearer <token>'
It is recommended to poll every 5 seconds until the status becomes completed or failed.

Successful Result Example

{
  "code": 200,
  "data": {
    "id": "task_01KSPX48B8V1M6C2ZN0D0T4BKB",
    "status": "completed",
    "progress": 100,
    "cost": 0.2,
    "created": 1779958948,
    "completed": 1779958999,
    "estimated_time": 100,
    "actual_time": 51,
    "result": {
      "videos": [
        {
          "url": ["https://upload.apimart.ai/f/video/xxxx.mp4"],
          "expires_at": 1780045399
        }
      ]
    }
  }
}
The video URL is at data.result.videos[0].url[0]. The url field is itself an array. Video links typically expire after 24 hours; download or transfer them in time.

Failed Result Example

{
  "code": 200,
  "data": {
    "id": "task_01KSPX48B8V1M6C2ZN0D0T4BKB",
    "status": "failed",
    "progress": 100,
    "cost": 0,
    "created": 1779958948,
    "completed": 1779958960,
    "error": {
      "code": "task_failed",
      "message": "pixverse error 400063: moderation failed",
      "type": "task_failed"
    }
  }
}
On failure, cost is typically 0. Read the error reason from data.error.message.

Use Cases

Case 1: Text-to-video

{
  "model": "pixverse-v6",
  "prompt": "A neon-lit alley in Tokyo at night, light rain, anamorphic lens flare",
  "size": "21:9",
  "resolution": "720p",
  "duration": 8,
  "seed": 42,
  "audio": true
}

Case 2: Image-to-video

{
  "model": "pixverse-v6",
  "prompt": "Camera slowly zooms in, gentle wind moves the leaves",
  "image_urls": ["https://example.com/first-frame.jpg"],
  "resolution": "540p",
  "duration": 5
}

Case 3: First/Last Frame Transition

{
  "model": "pixverse-v6",
  "prompt": "transform smoothly from a puppy to a cat",
  "first_frame_image": "https://example.com/puppy.jpg",
  "last_frame_image": "https://example.com/cat.jpg",
  "resolution": "540p",
  "duration": 5,
  "motion_mode": "normal"
}

Case 4: Multi-Reference Fusion

{
  "model": "pixverse-v6",
  "prompt": "A girl wearing the outfit from image 2, holding the cat from image 3",
  "img_references": [
    "https://example.com/character.jpg",
    "https://example.com/outfit.jpg",
    "https://example.com/cat.jpg"
  ],
  "size": "9:16",
  "resolution": "720p",
  "duration": 5
}

Case 5: Video Extension

{
  "model": "pixverse-v6",
  "prompt": "the character now walks into a forest",
  "extend_from_task_id": "task_01JWXXXXXXXXXXXX",
  "resolution": "540p",
  "duration": 5
}