Skip to content

Video API

SDKMAX supports video generation as a unified capability, aggregating channels like Sora, Kling, Jimeng, Hailuo, and Vidu. Because video generation typically takes a while, the API is asynchronous: submit a job, then poll for the result — it doesn't return synchronously.

Submit a generation job

POST /v1/videos
bash
curl https://api.sdkmax.com/v1/videos \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "prompt": "A drone timelapse of sunrise over snow-capped mountains"
  }'

The response is a task object with an ID and initial status (queued / processing):

json
{
  "id": "video_xxx",
  "status": "queued",
  "model": "sora-2"
}

Compatible path

POST /v1/video/generations is an equivalent path with identical behavior to POST /v1/videos.

Poll for status

GET /v1/videos/{task_id}
bash
curl https://api.sdkmax.com/v1/videos/video_xxx \
  -H "Authorization: Bearer sk-your-key"

Poll until status becomes completed or failed. Use increasing intervals (e.g. 2s, 4s, 8s...) rather than tight polling.

Fetch the result

Once complete, download the video content:

GET /v1/videos/{task_id}/content

This endpoint accepts either Authorization: Bearer or console session auth.

Remix a video

POST /v1/videos/{video_id}/remix

Submits a follow-up edit/remix job against an already-generated video, returning a new task object — same submit → poll → fetch flow.

Typical flow

python
import time

task = client.post("/videos", body={"model": "sora-2", "prompt": "..."})
task_id = task["id"]

while True:
    status = client.get(f"/videos/{task_id}")
    if status["status"] in ("completed", "failed"):
        break
    time.sleep(4)

if status["status"] == "completed":
    video = client.get(f"/videos/{task_id}/content")

(Illustrative pseudocode — actual field names follow the live response. Official OpenAI SDKs vary in how well they wrap the video endpoints today; calling the HTTP API directly is sometimes the more reliable option.)

Model availability

The exact model values available (e.g. sora-2, Kling, Jimeng variants) are whatever the console's model page or /v1/models currently lists — supported duration, resolution, and parameters vary significantly by model.

Error handling

Common issues include unsupported parameters for the chosen model (400), a failed job (status: failed, with details in the task object's error field), and content-moderation blocks — full list in Error Codes.

SDKMAX — Enterprise AI Gateway, Aggregating Global AI Resources