Skip to main content

Documentation Index

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

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

Overview

Veo 3.1 is a Google video generation model for text-to-video, first/last-frame animation, and reference-guided video creation. Use this page when you are ready to call the API after trying the model in the APIXO playground.
CapabilityValue
Model IDveo-3-1
Modesquality, fast
Generation typesTEXT_2_VIDEO, FIRST_AND_LAST_FRAMES_2_VIDEO, REFERENCE_2_VIDEO
Prompt length1-10000 characters
Aspect ratios16:9, 9:16, auto
First/last frame inputsUp to 2 image URLs
Reference inputsUp to 3 image URLs; fast mode and 16:9 only
OutputVideo URLs in resultJson.resultUrls

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/veo-3-1Submit a generation task
GET/statusTask/veo-3-1?taskId={taskId}Poll task status and retrieve results
All requests require your APIXO API key:
Authorization: Bearer YOUR_API_KEY
Submit requests also require:
Content-Type: application/json

Copy-paste async quickstart

This minimal request submits a text-to-video task and returns a taskId.
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"
    }
  }'
Successful response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Save the taskId; you need it to poll for the final result.

Poll for result

curl -X GET "https://api.apixo.ai/api/v1/statusTask/veo-3-1?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Processing response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
Success response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/xxx.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965730929,
    "costTime": 120000
  }
}
Failed response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "SensitiveContent",
    "failMsg": "Content violates safety policy, please adjust the prompt",
    "createTime": 1767965610929,
    "completeTime": 1767965620132,
    "costTime": 9203
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;

Request body

Text-to-video

{
  "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

{
  "request_type": "async",
  "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-to-video

{
  "request_type": "async",
  "input": {
    "mode": "fast",
    "prompt": "turn these references 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"
  }
}

Parameters

request_type
string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
callback_url
string
Required when request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.
input
object
required
Veo 3.1 input parameters.
REFERENCE_2_VIDEO requires mode: "fast" and aspect_ratio: "16:9". Other combinations are rejected.
Use public, directly reachable image URLs. JPG, JPEG, and PNG inputs up to 10 MB are recommended for image-guided workflows.

Response format

Submit task response

POST /generateTask/veo-3-1 returns a task ID when the task is accepted:
code
integer
API status code. 200 means the task was accepted.
message
string
Human-readable status message.
data.taskId
string
Unique task identifier used with the status endpoint.

Status response fields

taskId
string
Unique task identifier.
state
string
Current task state: pending, processing, success, or failed.
resultJson
string
JSON string containing the generated video URLs. Present when state is success.
failCode
string
Machine-readable failure code. Present when state is failed.
failMsg
string
Human-readable failure message. Present when state is failed.
createTime
integer
Task creation timestamp in Unix milliseconds.
completeTime
integer
Task completion timestamp in Unix milliseconds. Present after completion.
costTime
integer
Processing duration in milliseconds. Present after successful or failed completion when available.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
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/webhooks/apixo",
    "input": {
      "mode": "fast",
      "prompt": "a product reveal shot with smooth camera motion and dramatic lighting",
      "generationType": "TEXT_2_VIDEO",
      "aspect_ratio": "16:9"
    }
  }'
See Webhooks for delivery requirements and retry behavior.

Billing

Veo 3.1 is billed per generated video. The selected mode determines the unit price.
ModeAPIXO price
fast$0.20 / video
quality$1.50 / video
For current route and market comparison pricing, see Pricing.

Latency and polling

Actual latency may vary by prompt complexity, image inputs, selected route, and current queue load.
ModeTypical generation timeRecommended first pollPoll interval
fast1-3 minutes60-90s after task creation5-10s
quality1-3 minutes90s after task creation5-10s
For production video workloads, use callback mode to avoid frequent polling.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

CodeMeaningWhat to do
400Invalid request body, missing parameter, unsupported mode, unsupported generation type, or invalid image inputFix the request before retrying
401Missing or invalid API keyCheck the Authorization header
402Insufficient balance or quotaAdd balance or switch account/key
403Key or route cannot access the modelCheck permissions and route strategy
429Rate limit or concurrency limit reachedRetry with exponential backoff
500Server errorRetry with backoff
502Upstream service errorRetry with backoff
504Upstream timeoutRetry or use callback mode for long-running jobs

Task failure codes

Fail codeMeaningWhat to do
SensitiveContentPrompt or image input was rejected by safety checksChange the prompt or input image
PromptInvalidPrompt is invalid or rejected upstreamRewrite the prompt and retry
ImageFormatIncorrectInput image format is not acceptedUse a public JPG, JPEG, or PNG URL
MissingParameterA required parameter is missingCheck mode, prompt, generationType, and conditional image_urls
RateLimitedUpstream rate limit reachedRetry with exponential backoff
TimeoutUpstream service timed outRetry, reduce input complexity, or use callback mode
Unknown errorUpstream service returned an unmapped failureRetry later or contact support with the taskId

Common validation issues

IssueFix
Missing modeSet mode to quality or fast
Missing generationTypeSet one of the supported generation type values
REFERENCE_2_VIDEO with qualityUse mode: "fast"
REFERENCE_2_VIDEO with 9:16 or autoUse aspect_ratio: "16:9"
Too many imagesUse up to 2 images for first/last-frame generation or up to 3 images for reference generation
Empty image URLProvide non-empty, publicly reachable image URLs
See Error Codes for the full error reference.