Skip to documentation
DEVELOPER DOCS / HASHBIDXMODEL ACCESS. ONE INTEGRATION.

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/videos

Key request parameters

ParameterTypeDescription
modelstring · RequiredVideo model ID from GET /v1/models, e.g. example-video-5s
promptstring · RequiredText prompt
secondsstringOptional. Duration in seconds, within what the model offers at the chosen resolution; omitted, the model's default
sizestringDon't send it: any size returns 400. Choose the resolution with metadata.resolution
input_referencestringFirst-frame image: an image address, a data:image/ data URL or base64; see the section below for the accepted forms
metadataobjectExtra options such as metadata.ratio (aspect ratio, e.g. 16:9) and metadata.resolution; see the section below for limits
userstringEnd-user identifier for abuse tracking

Key response parameters

ParameterTypeDescription
idstringTask ID; pass to GET /v1/videos/{id} to poll
objectstringAlways video
modelstringEchoes the model used
statusenumqueued | in_progress | completed | failed
progressinteger0–100
created_atintegerUnix timestamp (seconds)
secondsstringEchoes the requested duration
errorobjectError 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
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
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
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
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
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/videos with model and prompt in the body; optionally input_reference as the first frame (an image URL or base64) and metadata.ratio for 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 from GET /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") or metadata.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 returns 400.
  • Resolution: metadata.resolution, e.g. 720p or 1080P (case-insensitive); omitted, the model's default is used. Don't send size; any size returns 400. Use metadata.resolution with metadata.ratio instead.
  • Audio: metadata.generate_audio (true or false); 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 returns 400 unsupported_video_spec before anything is charged, and the message lists what the model offers.
  • metadata with frames, draft: true, tools or callback_url, or a service_tier other than default, returns 400.
  • metadata.content takes only text and image_url items; video, audio or any other kind returns 400.
  • input_reference accepts three forms only; anything else returns 400: an http(s) image address whose last path segment ends in png, jpg, jpeg, webp, gif or bmp, or has no extension; a data URL starting with data:image/; or a PNG, JPEG, GIF, WEBP or BMP image in base64.
  • Reference images go in metadata.content: items without the first_frame or last_frame role, of type image_url. They can't be mixed with first or last frames.
  • input_reference is sent as the first frame: giving a first frame in metadata.content as well, or sending reference images with it, returns 400.

Example request body (the model name and image URL are placeholders):

Video request · 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" }
}

If the response includes X-Request-Id, include it when troubleshooting an issue.

All API endpoints
BUILD WITH HASHBIDX

Find your model. Make your first call.

Models & pricing