Endpointy
Metoda Endpoint Opis POST /api/v1/generateTask/veo-3-1Utwórz zadanie generowania GET /api/v1/statusTask/veo-3-1Sprawdź status zadania
Uwierzytelnianie
Wszystkie żądania wymagają klucza API w nagłówku:
Authorization: Bearer YOUR_API_KEY
Treść żądania
{
"request_type" : "async" ,
"callback_url" : "https://..." ,
"provider" : "auto" ,
"input" : {
"mode" : "quality" ,
"prompt" : "..." ,
"generationType" : "TEXT_2_VIDEO" ,
"aspect_ratio" : "16:9" ,
"image_urls" : [ "..." ],
"watermark" : "" ,
"seed" : 1234
}
}
Parametry
async (polling) or callback (webhook)
Callback URL, required when request_type=callback (conditional)
Routing strategy: auto, value, or official
Model input parameters mode
string
domyślnie: "quality"
wymagane
quality (high quality) or fast (fast generation)
Text description, 1-10000 characters
generationType
string
domyślnie: "TEXT_2_VIDEO"
wymagane
Generation type (see options below)
9:16, 16:9, or auto (REFERENCE_2_VIDEO only supports 16:9)
Required for FIRST_AND_LAST_FRAMES_2_VIDEO and REFERENCE_2_VIDEO (conditional)
Random seed for reproducibility
Generation Types:
TEXT_2_VIDEO — Pure text-to-video
FIRST_AND_LAST_FRAMES_2_VIDEO — First/last frame to video, requires image_urls (max 2)
REFERENCE_2_VIDEO — Reference image to video, requires fast mode, image_urls (max 3), aspect_ratio must be 16:9
Mode Options:
quality — High quality mode
fast — Fast generation mode
Przykład
Text-to-Video (TEXT_2_VIDEO)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/veo-3-1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"input": {
"mode": "quality",
"prompt": "a cinematic flyover of a futuristic city at sunrise",
"generationType": "TEXT_2_VIDEO",
"aspect_ratio": "16:9"
}
}'
First/Last Frame to Video (FIRST_AND_LAST_FRAMES_2_VIDEO)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/veo-3-1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "callback",
"callback_url": "https://your-server.com/callback",
"input": {
"mode": "quality",
"prompt": "a calm ocean turning into a storm",
"generationType": "FIRST_AND_LAST_FRAMES_2_VIDEO",
"image_urls": [
"https://example.com/frame_start.jpg",
"https://example.com/frame_end.jpg"
],
"aspect_ratio": "9:16"
}
}'
Reference Image to Video (REFERENCE_2_VIDEO)
curl -X POST "https://api.apixo.ai/api/v1/generateTask/veo-3-1" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"input": {
"mode": "fast",
"prompt": "turn this sequence into a dynamic action shot",
"generationType": "REFERENCE_2_VIDEO",
"image_urls": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg"
],
"aspect_ratio": "16:9"
}
}'
Odpowiedź
POST /api/v1/generateTask/veo-3-1
Returns taskId on success for subsequent status queries.
Success:
{
"code" : 200 ,
"message" : "success" ,
"data" : {
"taskId" : "task_12345678"
}
}
Error:
{
"code" : 400 ,
"message" : "Insufficient credits" ,
"data" : null
}
GET /api/v1/statusTask/veo-3-1
Query task execution status and results via taskId.
curl -X GET "https://api.apixo.ai/api/v1/statusTask/veo-3-1?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
}
}
Failed:
{
"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 request error 401 Invalid or missing API Key 429 Rate limit exceeded
Fail Code Description CONTENT_VIOLATIONContent violates safety guidelines INVALID_IMAGE_URLCannot access provided image URL
Limity rate
Limit Value Requests 10000 / minute Concurrent tasks 1000
Exceeding limits returns 429 error. Wait and retry.
Wskazówki
Generation time : Average ~2 minutes. Submit task, wait 90 seconds, then poll every 5 seconds.
Callback mode : Video generation takes time, strongly recommend using callback mode.
Video expiration : Result URLs are valid for 15 days. Download promptly.
Content moderation : Prompts must comply with content safety guidelines.
REFERENCE_2_VIDEO constraints : This type only supports fast mode and aspect_ratio must be 16:9.
Image formats : image_urls supports JPG, PNG, WebP, max 10MB per image.
Video generation takes longer than images — use callback mode for production workloads. Result URLs expire after 15 days; download important outputs promptly.
Powiązane