Video / Veo

Veo 3.1 Video Generation

Overview

Google Veo 3.1 Video Generationendpoint, supported Text-to-Video (text-to-video), Image-to-Video (image-to-video), Reference image-to-Video (reference-to-video)and video (extend) four modes.

Base URL: https://mm-internal-cn.leonecloud.com


Authentication

All endpoints require a token in the request header for authentication:

Authorization: Bearer {YOUR_AUTH_TOKEN}

Quick Start

cURL Example

Create Text-to-Video task

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/veo-3.1" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": "A dog playing in a park with sunshine",
 "genType": "t2v",
 "model": "fast",
 "resolution": "1080p",
 "aspectRatio": "16:9"
 }'

Create Image-to-Video task

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/veo-3.1" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": "The scene comes alive with gentle motion",
 "genType": "i2v",
 "imageUrls": ["https://example.com/image1.jpg"],
 "model": "quality",
 "resolution": "4k",
 "aspectRatio": "16:9"
 }'

create last frame videotask (2 images image)

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/veo-3.1" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": "Smooth transition between the two scenes",
 "genType": "i2v",
 "imageUrls": ["https://example.com/first_frame.jpg", "https://example.com/last_frame.jpg"],
 "model": "fast",
 "resolution": "720p"
 }'

create Reference image-to-Videotask

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/veo-3.1" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": "Generate a video based on this reference material",
 "genType": "r2v",
 "imageUrls": ["https://example.com/reference.jpg"],
 "model": "fast",
 "resolution": "720p"
 }'

create videotask

curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/veo-3.1" \
 -H "Authorization: Bearer your_auth_token_here" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": "The dog continues running and jumping over obstacles",
 "genType": "extend",
 "sourceTaskId": "veo_task_abc123",
 "model": "fast"
 }'

Query Task Status

curl -X GET "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/task_abc123" \
 -H "Authorization: Bearer your_auth_token_here"

Endpoints

1. create Veo 3.1 Video Generationtask

POST /api/v2/open/aigc/veo-3.1

Create a Veo 3.1 Video Generationtask.

Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
promptstringYesvideoPrompt
genTypestringNoGeneration type:t2v(Text-to-Video,default) / i2v(Image-to-Video) / r2v(Reference image-to-Video) / extend(video)
imageUrlsstring[]ConditionimageURLlist.i2v: 1-2images (1 images=, 2 images=last frame ); r2v: 1-3 images
modelstringNoModel:quality(height ) /fast(height,default) /lite()
resolutionstringNoOutput resolution:720p(default) / 1080p / 4k
aspectRatiostringNoAspect ratio:16:9(default) / 9:16 / auto
watermarkstringNowatermark(Optional)
enableTranslationbooleanNoPrompt as, defaulttrue
sourceTaskIdstringConditionTask ID (extend when Required, must Veo 3.1 task)
seedsintNorandom seed (extendwhen Optional, range10000-99999)
callbackUrlstringNoCallback notification URL after the task is complete
Description:
- r2v only supportedfast Model
- i2v 1 images image:Image Generationvideo; 2 images image: first frame→last frame video> - extend Veo 3.1 video> - with videodefaultaudio> - A pre-authorization charge is applied on task creation; insufficient balance returns an error

Response Parameters

ParameterTypeDescription
codeintStatus Code, 0 indicates success
msgstringMessage
data.taskIdstringTask ID, used to query task status
data.statusstringTask Status, fixed to processing
data.createdAtstringCreated Time

Response Example

Success

{
 "code": 0,
 "msg": "success",
 "data": {
 "taskId": "task_20260506150000_abc12345",
 "status": "processing",
 "createdAt": "2026-05-06 15:00:00"
 }
}

Insufficient balance

{
 "code": 40001,
 "msg": "Insufficient balance: first 0.0100, 0.1500",
 "data": null
}

2. Query Task Status

GET /api/v2/open/aigc/{taskId}

query task execute Status.

Response Example

Success

{
 "code": 0,
 "msg": "success",
 "data": {
 "taskId": "task_20260506150000_abc12345",
 "status": "success",
 "result": [
 "https://fc-gw-sh.oss-accelerate.aliyuncs.com/videos/2026/05/06/output_001.mp4"
 ],
 "createdAt": "2026-05-06 15:00:00",
 "updatedAt": "2026-05-06 15:02:30"
 }
}

3. Batch Query Task Status

POST /api/v2/open/aigc/batch

query task execute Status (up to 100 ).


4. Query Account Balance

GET /api/v2/open/balance


Callback Notification

task complete (Success or Failure) when, if Create Task when providecallbackUrl, was provided when creating the task, the system sends a POST request to that URL.

Callback Request

Headers

Content-Type: application/json
X-Funcloud-Event: task.completed
X-Funcloud-Signature: {localized example text}

Body

{
 "event": "task.completed",
 "taskId": "task_20260506150000_abc12345",
 "status": "success",
 "result": ["https://fc-gw-sh.oss-accelerate.aliyuncs.com/videos/output_001.mp4"],
 "errorMsg": "",
 "timestamp": "2026-05-06T15:02:30+08:00",
 "signature": "a1b2c3d4e5f6..."
}

Error Codes

codeDescription
0Success
10002Parametermissing or malformed
10005API Key invalid or missing
30003Task not found
40001Insufficient balance
90003Internal server error

Modellocalized example text| Model | localized example text| Scenario| |------|------|----------| | Quality | height, when|, height quality| | Fast | height,| use,| | Lite |,|,|


Best Practices

1. Polling Strategy

recommendedPolling:
- first 60 seconds:query every 5 seconds
- 60 seconds after:query every 10 seconds### 2. Use Callback

recommended use Callback NotificationPolling.

3. Processing Time Reference

  • Quality:Usually 2~ 5 minutes
  • Fast:Usually 30 seconds~ 2 minutes
  • Lite:Usually 20 seconds~ 1 minutes
  • video:Usually 1~ 3 minutes

4. Prompt Tips

  • recommendeduse Prompt (default will )
  • -, Scenario,
  • i2v when image move
  • extend when### 5. Balance Management
  • Create Taskfirst recommended query
  • taskSuccessdeducts from the frozen balance after success
  • taskFailure after the frozen amount is automatically returnedto available balance
Updated 2026-09-02