Video Generation and Downloads
This page applies to models enabled for the OpenAI-compatible video protocol. First prepare your API Key and authentication, then check the durations, dimensions, and input formats the model supports.
1. Save the generation request
The following text-to-video example is for Sora-style models that support seconds and size. Create a UTF-8 file named video.json and replace the model ID. For other video models, follow their parameter requirements; changing only the model name is insufficient.
{
"model": "YOUR_VIDEO_MODEL_ID",
"prompt": "A fixed camera shot of a cat stretching in sunlight, with natural, steady framing.",
"seconds": "4",
"size": "1280x720"
}| Field | Description |
|---|---|
model | The full model ID, available to your account and compatible with this protocol |
prompt | Describe the scene, subject, action, and camera |
seconds | This example requests 4 seconds; use a value the target model supports |
size | This example requests landscape 1280×720; supported dimensions depend on the model |
2. Submit a task once
Run this in the directory containing the file, in a terminal where you have set your API Key:
curl -sS -X POST https://certaedge.com/v1/videos \
-H "Authorization: Bearer $CERTAEDGE_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @video.jsonA successful response typically includes these fields. The values below are examples:
{
"id": "task_EXAMPLE",
"object": "video",
"status": "queued",
"model": "YOUR_VIDEO_MODEL_ID",
"progress": 0
}Save the actual id. HTTP 200 and queued mean the task was accepted, not that the video is ready.
Models that accept reference images may require multipart file uploads or additional parameters. Use those fields only when the model explicitly supports them. Do not assume every video model accepts the same image or upload format.
3. Query the status
Replace task_EXAMPLE with the actual ID from your submission:
export CERTAEDGE_TASK_ID='task_EXAMPLE'
curl -sS "https://certaedge.com/v1/videos/$CERTAEDGE_TASK_ID" \
-H "Authorization: Bearer $CERTAEDGE_API_KEY"queuedorin_progress: keep waiting; query again after about 15 seconds.completed: proceed to the download step.failed: readerrorand other error details. Do not keep polling in the hope that it will succeed.
You can query the same ID repeatedly. Do not rerun the submission command before every query.
4. Download the result
Run this only after the status becomes completed. Use a separate test directory. If result.mp4 already exists, rename and save it first:
curl --fail -L "https://certaedge.com/v1/videos/$CERTAEDGE_TASK_ID/content" \
-H "Authorization: Bearer $CERTAEDGE_API_KEY" \
--output result.mp4The query response may not include an upstream video URL. Use the content endpoint above. Check that the downloaded file plays correctly; a JSON response from an unfinished task is not a video file.
Combine endpoints in your tools
n8n can poll at intervals and download successful results. Dify is useful for preparing a prompt before submission. The Python example supports polling within an application.
For 400 errors, check the model's parameters. For 401 errors, check the API Key. If the model or protocol is unavailable, follow the response's error details. See Polling and Billing for the full guidance.