Skip to content

Create Video Generation Task

Submit a video generation task, supporting both text-to-video and image-to-video. Returns a Task ID, which can be used to query the status via the GET interface.

API Details

Endpoint: POST /v1/video/generations

Description: Submits a video generation request. This is an asynchronous interface. After receiving the Task ID, you need to call the corresponding query interface to get the progress and result.

Authentication: Bearer Token

http
Authorization: Bearer YOUR_API_TOKEN

Request Parameters

Body Parameters

ParameterTypeRequiredDescriptionExample
modelstringYesThe model ID to usekling-v1, gen-3-alpha
promptstringYesThe prompt for video generationA golden retriever running on the grass
imagestringNoImage URL or Base64 (for image-to-video)https://example.com/image.jpg
sizestringNoVideo dimensions1024x1024, 16:9
qualitystringNoVideo qualitystandard, hd
durationintegerNoDesired video duration in seconds5, 10

Response Parameters

ParameterTypeDescription
idstringUnique task identifier (Task ID)
objectstringObject type, always video.generation
createdintegerUnix timestamp of creation
statusstringInitial task status (pending, processing)

Code Examples

Python (OpenAI-style call)

python
import requests

url = "https://api.ezmodel.cloud/v1/video/generations"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "model": "kling-v1",
    "prompt": "A golden retriever running on the grass",
    "size": "1024x1024"
}

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

OpenAPI Specification

yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/video/generations:
    post:
      summary: Create Video Generation Task
      description: Submit a video generation task, supporting both text-to-video and image-to-video.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                prompt:
                  type: string
      responses:
        '200':
          description: Task submitted successfully

企业合作联系:service@ezmodel.cloud