Skip to main content
Veo-3.1 legacy route incident noticeThe veo-3.1 series legacy route began experiencing failures on May 14, 2026 and is temporarily unavailable. Pause new async video tasks from the examples on this page until recovery is announced on this site or in the console.
Async Endpoint: https://api2.laozhang.ai/v1/videosWorkflow: Three steps (Create Task → Query Status → Get Video)Advantages: More Stable | Task Queue | Long Tasks Support | No Charge on Failure

Why Choose Async API?

Higher Stability

Based on task queue, avoids long connection timeout issues

No Charge on Failure ⭐

Major Advantage: No charge for any failure
  • ✓ Content violation → No charge
  • ✓ Queue timeout → No charge
  • ✓ Generation failed → No charge
Sync API charges as long as request succeeds (HTTP 200), even if generation fails!

Flexible Polling

Query task status and progress anytime

Batch Processing

Suitable for batch generation and background tasks

Sync vs Async Comparison

Recommend using Async API, especially in production environments or when batch generating videos for better stability.

Quick Start

Async workflow consists of three steps:
1

Create Video Task

POST request to create task, get task ID
2

Query Task Status

Periodically poll for generation progress
3

Download Video

Get video file after task completes

Complete Example

API Endpoints

1. Create Video Task

POST https://api2.laozhang.ai/v1/videosCreate a new video generation task

Request Parameters

Available Models

Model Naming Convention:
  • landscape = Landscape (16:9)
  • fast = Fast version
  • fl = Supports frame-to-video (image-to-video)
First/Last Frame FeatureImage-to-video models (with -fl suffix) support uploading 2 images:
  • First image: Video start frame
  • Second image: Video end frame
The API will automatically generate a smooth transition animation from start frame to end frame.

Response Fields

2. Query Task Status

GET https://api2.laozhang.ai/v1/videos/{video_id}Query the current status of a video generation task

Path Parameters

Response Fields

Task Status Description

3. Get Video Content

GET https://api2.laozhang.ai/v1/videos/{video_id}/contentGet the actual content of a completed video

Path Parameters

Response Fields

ImportantVideo URLs are typically valid for 24 hours. Please download and save locally promptly!

Complete Code Examples

Python Example (with Polling Logic)

JavaScript/Node.js Example

Best Practices

Recommended polling interval: 5-10 seconds
Reasons:
  • Video generation typically takes 2-5 minutes
  • 5-10 seconds provides timely feedback
  • Avoids excessive requests
Recommended timeout: 10 minutes (600 seconds)
Note:
  • Task timeout doesn’t auto-cancel
  • Can continue querying the same video_id later
  • Tasks are valid for 24 hours
Recommended retry logic:
Retry scenarios:
  • ✓ Network error → Retry
  • ✓ Service busy (503) → Retry
  • ✗ Content violation → Don’t retry, modify prompt
  • ✗ Insufficient balance → Don’t retry, confirm account credit first
Concurrency control suggestions:
Suggestions:
  • Task creation: Can be highly concurrent (10-30)
  • Status query: Recommend concurrency ≤ 10
  • Video download: Recommend concurrency ≤ 5

Pricing

Async API has same pricing as Sync API, charged per request.
Billing Rules:
  • ✓ Only charge when video successfully generates (status = “completed”)
  • ✗ Failure, timeout, and cancellation billing follows console order status
  • ✗ Content safety failure billing follows console order status (major difference from sync API ⭐)
  • ✗ Status queries are free
Major advantage of Async API: No charge for failures of any kind, including content safety review failures. Sync API charges as long as request succeeds, even if generation ultimately fails.

FAQ

Task validity: 24 hours
  • Can query task status anytime within 24 hours after creation
  • Video files are stored for 24 hours after generation completes
  • Tasks and videos are automatically cleaned up after 24 hours
Recommendations:
  • Download immediately after video generation completes
  • Don’t rely on server for long-term storage
Possible reasons:
  1. Incorrect video_id - Check if copied completely
  2. Task expired - Over 24 hours
  3. Network issue - Retry the request
Solution:
Yes, they’re completely independentThe two API systems are completely separate:
  • Different endpoints
  • Different workflows
  • Same pricing
  • Share the same API Key and balance
Usage recommendations:
  • Quick testing → Use Sync API
  • Production → Use Async API (more stable)
  • Batch generation → Use Async API
Choose based on needs:

Error Handling

Common Error Codes

Error Response Format

Technical Support

Need Help?

If you have questions, feel free to contact us:

Next Steps

Sync API

View sync calling method (OpenAI compatible)

Code Examples

View more application examples

Model Overview

Learn about Veo-3.1 model details

Troubleshooting

View more Q&A