Skip to main content

Documentation Index

Fetch the complete documentation index at: https://doc.hitopen.com/llms.txt

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

Video generation is an asynchronous operation. You submit a job with POST /v1/videos, receive a task ID, and then poll GET /v1/videos/{task_id} until the job is complete. Generation typically takes between a few seconds and several minutes depending on the model and video length.
Video generation is billed at job submission. If a job fails, contact your admin for a refund.

Create a video

POST https://YOUR_NEWAPI_BASE_URL/v1/videos
Submit a video generation job. The request uses multipart/form-data.

Request parameters

model
string
The video model ID. Supported models include Sora, Kling, and Jimeng variants. Contact your admin for the available model IDs on your instance.
prompt
string
A text description of the video you want to generate. The more detailed your description, the better the result.
image
string
An optional reference image provided as a URL or a base64-encoded string. When supplied, the model uses it as the starting frame or visual reference for the generated video.
duration
number
Desired video duration in seconds. The exact supported range depends on the model.
width
integer
Output video width in pixels.
height
integer
Output video height in pixels.
fps
integer
Frames per second for the output video.
n
integer
Number of videos to generate. Defaults to 1.
seed
integer
Random seed for reproducibility. Using the same seed and parameters tends to produce similar results.
response_format
string
The format of the response data.
metadata
object
Additional model-specific parameters passed as a JSON object. Common keys include negative_prompt, style, and quality_level.
user
string
An optional end-user identifier for monitoring and abuse detection.

Response fields (job object)

id
string
The task ID. Use this to poll for status with GET /v1/videos/{task_id}.
object
string
The type of the returned object.
model
string
The model that is processing the request.
status
string
Current job status. Typical values: "queued", "processing", "completed", "failed".
progress
number
A value between 0 and 1 indicating how far along the job is.
created_at
integer
Unix timestamp when the job was created.
completed_at
integer
Unix timestamp when the job finished. null if still in progress.
expires_at
integer
Unix timestamp after which the result URLs will no longer be accessible.
seconds
string
Duration of the generated video.
size
string
File size information for the generated video.
error
object
Present when status is "failed". Contains message and code fields.

Example

cURL
curl -X POST "https://YOUR_NEWAPI_BASE_URL/v1/videos" \
  -H "Authorization: Bearer sk-your-token" \
  -F model="sora" \
  -F prompt="A golden retriever running through a field of sunflowers at midday" \
  -F duration="5" \
  -F width="1280" \
  -F height="720"

Get video task status

GET https://YOUR_NEWAPI_BASE_URL/v1/videos/{task_id}
Retrieve the current status of a video generation job.

Path parameters

task_id
string
required
The task ID returned by the POST /v1/videos request.

Response fields

id
string
The task ID.
object
string
The type of the returned object.
model
string
The model processing the request.
status
string
Current job status: "queued", "processing", "completed", or "failed".
progress
number
Completion fraction between 0 and 1.
created_at
integer
Unix timestamp when the job was created.
seconds
string
Duration of the video (available once complete).

Example

cURL
curl "https://YOUR_NEWAPI_BASE_URL/v1/videos/task_abc123" \
  -H "Authorization: Bearer sk-your-token"

Async workflow

1

Submit the job

Call POST /v1/videos with your prompt and settings. Save the id from the response.
2

Poll for status

Call GET /v1/videos/{task_id} every few seconds. Check the status field.
3

Download the result

When status is "completed", the response will contain the video URL or data. Download it before expires_at.
Python (polling example)
import time
import requests

BASE_URL = "https://YOUR_NEWAPI_BASE_URL"
HEADERS = {"Authorization": "Bearer sk-your-token"}

# Step 1: Submit
job = requests.post(
    f"{BASE_URL}/v1/videos",
    headers=HEADERS,
    data={
        "model": "sora",
        "prompt": "A golden retriever running through a field of sunflowers",
        "duration": "5",
    },
).json()

task_id = job["id"]
print(f"Job submitted: {task_id}")

# Step 2: Poll
while True:
    result = requests.get(
        f"{BASE_URL}/v1/videos/{task_id}",
        headers=HEADERS,
    ).json()

    status = result["status"]
    progress = result.get("progress", 0)
    print(f"Status: {status} ({progress * 100:.0f}%)")

    if status == "completed":
        print("Video ready!")
        break
    elif status == "failed":
        print(f"Job failed: {result.get('error')}")
        break

    time.sleep(5)