Videos
Video generation
OpenAI-compatible video generation, run asynchronously. The create call waits up to about 60 seconds: if generation finishes in that time the result comes back directly; otherwise it returns the current status, and you poll GET /v1/videos/{id}, then download the video from GET /v1/videos/{id}/content once it completes. Only application/json bodies are accepted for now; unlisted fields are ignored.
POST
/v1/videosKey request parameters
| Parameter | Type | Description |
|---|---|---|
model | string · Required | Video model ID from GET /v1/models, e.g. example-video-5s |
prompt | string · Required | Text prompt |
seconds | string | Optional. Duration in seconds, within what the model offers at the chosen resolution; omitted, the model's default |
size | string | Don't send it: any size returns 400. Choose the resolution with metadata.resolution |
input_reference | string | First-frame image: an image address, a data:image/ data URL or base64; see the section below for the accepted forms |
metadata | object | Extra options such as metadata.ratio (aspect ratio, e.g. 16:9) and metadata.resolution; see the section below for limits |
user | string | End-user identifier for abuse tracking |
Key response parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Task ID; pass to GET /v1/videos/{id} to poll |
object | string | Always video |
model | string | Echoes the model used |
status | enum | queued | in_progress | completed | failed |
progress | integer | 0–100 |
created_at | integer | Unix timestamp (seconds) |
seconds | string | Echoes the requested duration |
error | object | Error details when the task fails, with code and message |
Integration examples
Replace the API key and model ID in these examples with your values.
cURL
curl https://hashbidx.ai/v1/videos \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "example-video-5s",
"prompt": "a cat dancing on a piano, slow dolly in",
"input_reference": "https://example.com/first-frame.png",
"metadata": {"ratio": "16:9"}
}'Python
import httpx
resp = httpx.post(
"https://hashbidx.ai/v1/videos",
headers={"Authorization": "Bearer <YOUR_API_KEY>"},
json={
"model": "example-video-5s",
"prompt": "a cat dancing on a piano, slow dolly in",
"input_reference": "https://example.com/first-frame.png",
"metadata": {"ratio": "16:9"},
},
)
resp.raise_for_status()
task = resp.json()
print("task id:", task["id"], "status:", task["status"])Node.js
const resp = await fetch("https://hashbidx.ai/v1/videos", {
method: "POST",
headers: {
"Authorization": "Bearer <YOUR_API_KEY>",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "example-video-5s",
prompt: "a cat dancing on a piano, slow dolly in",
input_reference: "https://example.com/first-frame.png",
metadata: { ratio: "16:9" },
}),
});
const task = await resp.json();
console.log("task id:", task.id, "status:", task.status);Go
body, _ := json.Marshal(map[string]any{
"model": "example-video-5s",
"prompt": "a cat dancing on a piano, slow dolly in",
"input_reference": "https://example.com/first-frame.png",
"metadata": map[string]any{"ratio": "16:9"},
})
req, _ := http.NewRequest("POST",
"https://hashbidx.ai/v1/videos", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer <YOUR_API_KEY>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)Rust
let body = serde_json::json!({
"model": "example-video-5s",
"prompt": "a cat dancing on a piano, slow dolly in",
"input_reference": "https://example.com/first-frame.png",
"metadata": { "ratio": "16:9" },
});
let resp = reqwest::Client::new()
.post("https://hashbidx.ai/v1/videos")
.bearer_auth("<YOUR_API_KEY>")
.json(&body)
.send().await?;Video generation (/v1/videos)
- Create:
POST /v1/videoswithmodelandpromptin the body; optionallyinput_referenceas the first frame (an image URL orbase64) andmetadata.ratiofor the aspect ratio (e.g.16:9). - Retrieve:
GET /v1/videos/{id}returns the task status (queued,in_progress,completed,failed); once completed, download the video fromGET /v1/videos/{id}/content. - Billing: most video models charge per second: seconds × the per-second price of the chosen resolution and audio; some charge by the video tokens the upstream reports: tokens × the price per million tokens ÷ 1,000,000, which may differ when a reference video is given; a model that makes one video only charges one per-request price. Some models also charge per input image (first and last frames and reference images all count), for example after a few free ones. Failed generations are not charged. See the Models page for each model's prices.
- Duration:
seconds(a string such as"8") ormetadata.duration(an integer); if you send both they must agree. Omitted, the model's default duration is used. A duration the chosen resolution doesn't offer returns400. - Resolution:
metadata.resolution, e.g.720por1080P(case-insensitive); omitted, the model's default is used. Don't sendsize; any size returns400. Usemetadata.resolutionwithmetadata.ratioinstead. - Audio:
metadata.generate_audio(trueorfalse); omitted, the model's default is used. Each model lists its resolutions and, for each, the durations and audio it offers on the Models page; a value outside them returns400unsupported_video_specbefore anything is charged, and the message lists what the model offers. metadatawithframes,draft: true,toolsorcallback_url, or aservice_tierother thandefault, returns400.metadata.contenttakes onlytextandimage_urlitems; video, audio or any other kind returns400.input_referenceaccepts three forms only; anything else returns400: anhttp(s)image address whose last path segment ends inpng,jpg,jpeg,webp,giforbmp, or has no extension; a data URL starting withdata:image/; or aPNG,JPEG,GIF,WEBPorBMPimage inbase64.- Reference images go in
metadata.content: items without thefirst_frameorlast_framerole, of typeimage_url. They can't be mixed with first or last frames. input_referenceis sent as the first frame: giving a first frame inmetadata.contentas well, or sending reference images with it, returns400.
Example request body (the model name and image URL are placeholders):
{
"model": "example-video-5s",
"prompt": "a cat dancing on a piano, slow dolly in",
"input_reference": "https://example.com/first-frame.png",
"metadata": { "ratio": "16:9" }
}If the response includes X-Request-Id, include it when troubleshooting an issue.