POST request to https://api.qhaigc.net/v1/chat/completions to generate a video using OpenAI’s Sora 2 model. Describe the scene you want in a chat message, choose between standard (sora-2) or high-definition (sora-2-hd) quality, and enable streaming to receive real-time progress updates. When generation is complete, the response includes a link to your video.
Video generation is computationally intensive and typically takes 120 seconds or more. Enable streaming (
"stream": true) so you can monitor progress rather than waiting for a single blocking response.Request
Parameters
The video generation model. Use
"sora-2" for standard quality or "sora-2-hd" for high definition.A list of chat-style message objects describing the video content. Set
"role" to "user" and provide your scene description in "content".Whether to stream progress updates. Set to
true (recommended) to receive incremental status messages as the video is generated.Response
Whenstream is true, the endpoint returns a sequence of server-sent events (SSE) that report progress and, on completion, provide the video download URL. The streaming response follows this pattern:
⌛️ 任务正在队列中,请耐心等待...— Task queued🏃 进度:36.0%— Generation in progress✅ 视频生成成功,[点击这里](...) 查看视频~~~— Complete with video link
Code examples
Models
| Model | Description |
|---|---|
sora-2 | Standard quality. Faster generation, lower cost. |
sora-2-hd | High definition. Higher resolution output. |
Related
- Model list — Full list of available video generation models and pricing