Video Generation
Text-to-video and image-to-video generation
Supports text-to-video (t2v) and image-to-video (i2v).
Request:
POST /v2/extend/video/generationsParameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model name: seedance-2.0, seedance-2.0-fast, kling-v3.0-pro, kling-v3.0, veo-3.1, veo-3.1-fast |
| prompt | string | Yes | Video description |
| image | string | No | First-frame image URL (if provided, generates image-to-video) |
| duration | number | No | Video duration in seconds |
| aspect_ratio | string | No | Aspect ratio: 16:9, 9:16, 1:1 |
| sound | boolean | No | Whether to generate sound |
| negative_prompt | string | No | Negative prompt |
Example (text-to-video):
curl https://tokenhub.piegateway.me/v2/extend/video/generations \
-H "X-API-Key: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"model": "seedance-2.0",
"prompt": "a cat running on a grass field",
"duration": 5
}'Example (image-to-video):
curl https://tokenhub.piegateway.me/v2/extend/video/generations \
-H "X-API-Key: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3.0-pro",
"prompt": "make the person smile and turn their head",
"image": "https://example.com/photo.jpg",
"duration": 5
}'Check video generation result:
GET /v2/extend/video/tasks/{task_id}Example:
curl https://tokenhub.piegateway.me/v2/extend/video/tasks/<task_id> \
-H "X-API-Key: <your-api-key>"