Endpointy
Metoda Endpoint Opis POST /api/v1/generateTask/vidu-q3Create a generation task GET /api/v1/statusTask/vidu-q3Sprawdź status zadania
Uwierzytelnianie
Wszystkie żądania muszą zawierać klucz API w nagłówkach:
Authorization : Bearer YOUR_API_KEY
Treść żądania
{
"request_type" : "async" ,
"callback_url" : "https://..." ,
"provider" : "auto" ,
"input" : {
"mode" : "text-to-video" ,
"prompt" : "a cinematic shot of a futuristic city at sunrise" ,
"resolution" : "720p" ,
"duration" : 8 ,
"style" : "general" ,
"aspect_ratio" : "4:3" ,
"movement" : "auto" ,
"sound" : true ,
"bgm" : true ,
"seed" : 1234
}
}
Parametry
Execution mode: async (polling) or callback
Callback URL. Required when request_type=callback. (conditional)
Routing strategy: auto, value, official, or a specific provider channel
Model input parameters text-to-video / image-to-video / turbo-text-to-video / turbo-image-to-video (image modes support 1 or 2 images via image_urls)
Text prompt, 1-5000 characters
Output resolution: 540p, 720p, or 1080p
Video duration in seconds, from 1 to 16. Billing is charged per second.
Style preset for text modes only: general or anime
Aspect ratio for text modes only: 16:9, 9:16, 4:3, 3:4, or 1:1
Reference image URLs. Required for image modes. Up to 2 images are supported: 1 image for single-image animation, 2 images for first-and-last-frame generation. (conditional)
Motion strength: auto, small, medium, or large
Whether to generate sound effects (maps to the upstream generate_audio capability)
Whether to generate background music
Random seed, from -1 to 2147483647
Mode Reference:
text-to-video - Generate a video from text only
image-to-video - Generate a video from 1 or 2 images
turbo-text-to-video - Turbo text-to-video mode
turbo-image-to-video - Turbo image-to-video mode with 1 or 2 images
Przykłady
Text-to-video (text-to-video)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/vidu-q3" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"input": {
"mode": "text-to-video",
"prompt": "a cinematic flyover of a futuristic city at sunrise",
"resolution": "720p",
"duration": 8,
"style": "general",
"aspect_ratio": "16:9",
"movement": "auto",
"sound": true,
"bgm": true
}
}'
Single-image animation (image-to-video, 1 image)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/vidu-q3" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "callback",
"callback_url": "https://your-server.com/callback",
"input": {
"mode": "image-to-video",
"prompt": "make this image come alive with subtle motion",
"resolution": "1080p",
"duration": 4,
"image_urls": [
"https://example.com/start.jpg"
]
}
}'
First-and-last-frame generation (image-to-video, 2 images)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/vidu-q3" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"input": {
"mode": "image-to-video",
"prompt": "transition from start to end smoothly",
"resolution": "720p",
"duration": 8,
"image_urls": [
"https://example.com/start.jpg",
"https://example.com/end.jpg"
]
}
}'
Odpowiedź
POST /api/v1/generateTask/vidu-q3
On success, the API returns a taskId that you can use to query task status later.
Success:
{
"code" : 200 ,
"message" : "success" ,
"data" : {
"taskId" : "task_12345678"
}
}
Failure:
{
"code" : 400 ,
"message" : "Insufficient credits" ,
"data" : null
}
GET /api/v1/statusTask/vidu-q3
Use taskId to query the execution status and final result.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/vidu-q3?taskId=task_12345678" \
-H "Authorization: Bearer YOUR_API_KEY"
Success:
{
"code" : 200 ,
"message" : "success" ,
"data" : {
"taskId" : "task_12345678" ,
"state" : "success" ,
"resultJson" : "{ \" resultUrls \" :[ \" https://r2.apixo.ai/video.mp4 \" ]}" ,
"createTime" : 1767965610929 ,
"completeTime" : 1767965730929 ,
"costTime" : 120000
}
}
Failure:
{
"code" : 200 ,
"message" : "success" ,
"data" : {
"taskId" : "task_12345678" ,
"state" : "failed" ,
"failCode" : "CONTENT_VIOLATION" ,
"failMsg" : "Content does not meet safety guidelines"
}
}
Pola odpowiedzi statusu
Current task state: pending, processing, success, or failed.
JSON string containing resultUrls array. Only present on success. Parse with JSON.parse().
Error code. Only present when state is failed. See Kody błędów .
Human-readable error message. Only present when state is failed.
Task creation timestamp (Unix milliseconds).
Task completion timestamp (Unix milliseconds).
Processing duration in milliseconds.
Kody błędów
Code Description 400 Invalid parameters or malformed request 401 Missing or invalid API key 402 Insufficient balance 429 Rate limit exceeded
Fail Code Description CONTENT_VIOLATIONThe request violates safety guidelines INVALID_IMAGE_URLThe provided image URL could not be fetched
Limity rate
Limit Value Request rate 60 requests per minute Concurrent tasks 10
If you exceed the limit, the API returns a 429 error. Retry later.
Video generation takes longer than images — use callback mode for production workloads. Result URLs expire after 15 days; download important outputs promptly.
Wskazówki
Image count by mode : For image-to-video and turbo-image-to-video, the number of image_urls determines the workflow. 1 image creates a single-image animation. 2 images create a first-and-last-frame transition, where the first image is the start frame and the second image is the end frame.
Billing : Charges are calculated per second, and billed seconds are equal to duration. For pricing by resolution, see Pricing .
Polling recommendation : After submitting a task, wait about 60-90 seconds before polling, then poll every 5 seconds. For higher concurrency, prefer callback mode.
Result URL lifetime : Output URLs may expire. Download and store results as soon as possible.