الجواب المباشر
تشرح هذه الصفحة كيف تستخدم الفرق بوابة NextModel المتوافقة مع OpenAI. Submit a video job, poll it, and pass reference images as URLs or inline data URIs. وتضيف الخطوات العملية، وملاحظات الإعداد، والأسئلة الشائعة.
Submit and poll
POST /v1/video/generations returns 202 with a job id; poll GET /v1/video/jobs/{id} until the status is succeeded or failed. Failed jobs are refunded in full.
curl https://modelxing.com/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NEXTMODEL_API_KEY" \
-d '{"model":"wan2.6-i2v","prompt":"A cat walking","duration_seconds":2,"resolution":"720P","image_url":"https://example.com/reference.png"}'
# Poll the job id from the response until status is succeeded/failed:
curl https://modelxing.com/v1/video/jobs/<JOB_ID> -H "Authorization: Bearer $NEXTMODEL_API_KEY"# pip install requests
import os, time, requests
BASE = "https://modelxing.com"
HEADERS = {"Authorization": "Bearer " + os.environ["NEXTMODEL_API_KEY"]}
job = requests.post(f"{BASE}/v1/video/generations", headers=HEADERS, json={
"model": "wan2.6-i2v", "prompt": "A cat walking",
"duration_seconds": 2, "resolution": "720P",
"image_url": "https://example.com/reference.png",
}).json()
job_id = job["id"]
while True:
job = requests.get(f"{BASE}/v1/video/jobs/{job_id}", headers=HEADERS).json()
if job["status"] in ("succeeded", "failed"):
break
time.sleep(10)
print(job.get("video", {}).get("url") or job.get("error"))Reference images: URL or data URI
image_url accepts an http(s) URL (reachability is the caller's responsibility) or a data:image/*;base64,<payload> data URI forwarded verbatim. Caps: 10MB per image, 10MB per request; oversize returns inline_image_too_large. Inline images need no fetching at all.
Resolution and billing
Video SKUs bill per second of output at the resolution tier you pass; only the tiers listed on the model's catalog page are billable, and unlisted tiers are rejected before any spend.