> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laozhang.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference (Custom API - Deprecated)

> Detailed API documentation for VEO video generation API - Legacy documentation

<Warning>
  **⚠️ This documentation is for legacy custom API, not recommended**

  The newer legacy-route entry is [Veo-3.1 Quick Start](/en/api-capabilities/veo/veo-31-quick-start), but the Veo-3.1 legacy route has been temporarily unavailable since May 14, 2026. Pause new production integrations based on the legacy VEO custom API. If you need a currently available Veo 3.1 video route, use [Veo 3.1 Official API Forwarding](/en/api-capabilities/veo/official-forward).
</Warning>

## Submit Video Task

<ParamField method="POST" path="/veo/v1/api/video/submit">
  Submit video generation task
</ParamField>

### Request Parameters

<ParamField body="prompt" type="string" required>
  Text description for video generation
</ParamField>

<ParamField body="model" type="string" default="veo3">
  Model name. Available values:

  * `veo3` - Standard version
  * `veo3-fast` - Fast version
  * `veo3-pro` - Professional version
  * `veo3-pro-frames` - Pro version + frame control
</ParamField>

<ParamField body="images" type="array">
  Array of reference image URLs, maximum 5
</ParamField>

<ParamField body="enhance_prompt" type="boolean" default={false}>
  Whether to enhance prompt
</ParamField>

### Request Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api2.laozhang.ai/veo/v1/api/video/submit" \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer your-api-key" \
    -d '{
      "prompt": "A cat walking in the rainy night, preparing to catch a mouse",
      "model": "veo3",
      "images": ["https://example.com/cat.png"],
      "enhance_prompt": true
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api2.laozhang.ai/veo/v1/api/video/submit"
  headers = {
      "Content-Type": "application/json",
      "Authorization": "Bearer your-api-key"
  }
  data = {
      "prompt": "A cat walking in the rainy night, preparing to catch a mouse",
      "model": "veo3",
      "images": ["https://example.com/cat.png"],
      "enhance_prompt": True
  }

  response = requests.post(url, json=data, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.laozhang.ai/veo/v1/api/video/submit', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer your-api-key'
    },
    body: JSON.stringify({
      prompt: 'A cat walking in the rainy night, preparing to catch a mouse',
      model: 'veo3',
      images: ['https://example.com/cat.png'],
      enhance_prompt: true
    })
  });

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

### Response Example

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "data": {
      "taskId": "veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
      "pollingUrl": "https://asyncdata.net/source/veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
      "status": "processing",
      "message": "Task submitted successfully"
    }
  }
  ```
</ResponseExample>

## Query Task Status

<ParamField method="GET" path="/veo/v1/api/video/status/{taskId}">
  Query video generation status
</ParamField>

### Path Parameters

<ParamField path="taskId" type="string" required>
  Task ID (returned from submit interface)
</ParamField>

### Request Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api2.laozhang.ai/veo/v1/api/video/status/veo3:b873872e-7358-4c2f-8d55-bd23f000e14e" \
    -H "Authorization: Bearer your-api-key"
  ```

  ```python Python theme={null}
  import requests

  task_id = "veo3:b873872e-7358-4c2f-8d55-bd23f000e14e"
  url = f"https://api2.laozhang.ai/veo/v1/api/video/status/{task_id}"
  headers = {
      "Authorization": "Bearer your-api-key"
  }

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const taskId = 'veo3:b873872e-7358-4c2f-8d55-bd23f000e14e';
  const response = await fetch(`https://api2.laozhang.ai/veo/v1/api/video/status/${taskId}`, {
    headers: {
      'Authorization': 'Bearer your-api-key'
    }
  });

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

### Response Status

<Tabs>
  <Tab title="Task Submitted">
    ```json theme={null}
    {
      "success": true,
      "data": {
        "taskId": "veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
        "pollingUrl": "https://asyncdata.net/source/veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
        "status": "processing",
        "message": "Task submitted successfully"
      }
    }
    ```
  </Tab>

  <Tab title="Image Downloading">
    ```json theme={null}
    {
      "success": true,
      "data": {
        "taskId": "veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
        "pollingUrl": "https://asyncdata.net/source/veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
        "upstreamData": {
          "created_at": 1751704074528,
          "enhanced_prompt": "A cat is walking on a rainy night, preparing to catch a mouse",
          "id": "veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
          "images": [
            {
              "status": "downloading",
              "url": "https://tokensceshi.oss-ap-southeast-1.aliyuncs.com/sora/81ecb724-9e01-4f0e-a2ac-0c85802b8841.png"
            }
          ],
          "status": "image_downloading"
        },
        "status": "processing",
        "progress": {
          "upstreamStatus": "image_downloading",
          "retryCount": 0,
          "maxRetries": 3
        }
      }
    }
    ```
  </Tab>

  <Tab title="Video Generating">
    ```json theme={null}
    {
      "success": true,
      "data": {
        "taskId": "veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
        "upstreamData": {
          "status": "video_generating",
          "video_generation_id": "f48aea86a9c27d4c8b15612b6c65d08e",
          "video_generation_status": "MEDIA_GENERATION_STATUS_ACTIVE"
        },
        "status": "processing"
      }
    }
    ```
  </Tab>

  <Tab title="Generation Completed">
    ```json theme={null}
    {
      "success": true,
      "data": {
        "taskId": "veo3:b873872e-7358-4c2f-8d55-bd23f000e14e",
        "status": "completed",
        "result": {
          "video_url": "https://filesystem.site/cdn/20250705/BFvep0SngrqIrN3yDSFChIXAz2mU0M.mp4",
          "video_media_id": "CAUSJGRlNzE5MzRhLTljMDgtNDE1Mi05NWVlLThjOTlhMTZlODUyYxokY2U4ZjNiYmUtNGFmZS00NTExLWI4ZDEtMGM1MTFkM2ZlNGIxIgNDQUUqJDJlNTY3OWUyLWQ2YmQtNGVlZS05ZTUwLWMyMWE0MWU3ZDYzNw"
        }
      }
    }
    ```
  </Tab>
</Tabs>

### Status Description

| Status       | Description          | Next Action             |
| ------------ | -------------------- | ----------------------- |
| `processing` | Task processing      | Continue polling status |
| `completed`  | Generation completed | Get video URL           |
| `failed`     | Generation failed    | Check error message     |

## HTTP Status Codes

<ResponseField name="200" type="Success">
  Request successful
</ResponseField>

<ResponseField name="400" type="Client Error">
  Invalid request parameters, check parameter format and required fields
</ResponseField>

<ResponseField name="401" type="Authentication Error">
  Authentication failed, check if API key is correct
</ResponseField>

<ResponseField name="500" type="Server Error">
  Internal server error, please retry later or contact support
</ResponseField>

## Error Response Format

```json theme={null}
{
  "success": false,
  "message": "Error description",
  "error_code": "ERROR_CODE",
  "details": {
    "field": "Specific error field",
    "reason": "Error reason"
  }
}
```

## Common Error Codes

| Error Code       | Description          | Solution                        |
| ---------------- | -------------------- | ------------------------------- |
| `INVALID_PROMPT` | Invalid prompt       | Check prompt length and content |
| `INVALID_MODEL`  | Model does not exist | Use supported model names       |
| `QUOTA_EXCEEDED` | Quota exceeded       | Contact to increase quota       |
| `TASK_NOT_FOUND` | Task does not exist  | Check task ID                   |
