Quickstart
You need a HalationLab.ai account with tokens in it and a terminal with curl.
1. Create an API key
Section titled “1. Create an API key”- In the HalationLab.ai app, open Account → Developers and create a key.
- Choose the projects it can use (all by default) and its spending limit (on by default, resets monthly).
- Copy the key. It starts with
hl_live_and is shown only once.
Put it in an environment variable for the commands below:
export HALATIONLAB_API_KEY="hl_live_..."2. Generate a video
Section titled “2. Generate a video”# Generates a 5-second video and waits up to 60 seconds for it. Spends at most 400 tokens.set -euo pipefailAPI="${HL_API_BASE:-https://api.halationlab.ai/v1}"
curl -sS --fail-with-body "$API/generations" \ -H "Authorization: Bearer $HALATIONLAB_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Prefer: wait=60" \ -H "Content-Type: application/json" \ -d '{ "model": "seedance-2.5", "input": { "prompt": "A red fox running through snow", "duration": 5, "aspect_ratio": "16:9" }, "max_cost": 400 }'What this request does:
modelandinputsay what to make.inputfollows the model’s parameters; see Seedance 2.5.max_costis the most you will pay, in tokens. If the quoted price is higher, nothing is created or charged and the answer is402 max_cost_exceededwith the quote.Idempotency-Keymakes a retry safe: sending the same request again with the same key never starts a second video. See Idempotency.Prefer: wait=60holds the response for up to 60 seconds until the video is ready.
The answer is a generation (201). When it has finished, status is completed and outputs[0].url is the video:
{ "id": "gen_01JD3Y5RJ6M3XW6J8K2N4P7Q9T", "object": "generation", "status": "completed", "model": "seedance-2.5", "cost": { "quoted_max": 380, "charged": 372, "final": true }, "outputs": [ { "asset": "asset_01JD3Y7M2K8P4W6R0T3V5X9Z1B", "type": "video", "url": "https://app.halationlab.ai/media/d/…", "url_expires_at": "2026-11-28T11:41:12Z" } ], "poll_after_seconds": null}If the video is not ready within 60 seconds, status is still queued or processing: read the generation again with GET /v1/generations/{id} (it accepts Prefer: wait=60 too), waiting poll_after_seconds between reads. See Waiting and polling.
The download URL needs no credentials and expires after an hour; read the generation again for a fresh one.
3. The same with an SDK
Section titled “3. The same with an SDK”TypeScript (npm install @halationlab/sdk):
// Generates a 5-second video with the TypeScript SDK and prints its download URL. Spends at most 400 tokens.import { HalationLab } from '@halationlab/sdk';
const hl = new HalationLab({ apiKey: process.env.HALATIONLAB_API_KEY });
// run() starts the generation and waits until it is completed, failed or canceled.const generation = await hl.generations.run({ model: 'seedance-2.5', input: { prompt: 'A red fox running through snow', duration: 5, aspect_ratio: '16:9' }, max_cost: 400,});
console.log(generation.status, generation.cost.charged, generation.outputs[0]?.url);Python (pip install halationlab):
# Generates a 5-second video with the Python SDK and prints its download URL. Spends at most 400 tokens.import os
from halationlab import HalationLab
client = HalationLab(api_key=os.environ["HALATIONLAB_API_KEY"])
# run() starts the generation and waits until it is completed, failed or canceled.generation = client.generations.run( model="seedance-2.5", input={"prompt": "A red fox running through snow", "duration": 5, "aspect_ratio": "16:9"}, max_cost=400,)
print(generation["status"], generation["cost"]["charged"], generation["outputs"][0]["url"] if generation["outputs"] else None)run() starts the generation and waits for a final status, so you do not write the polling loop yourself.
- Authentication: what a key can do and how long it lasts.
- Generating video and images: images, image to video from a URL, and your own files.
- Webhooks: be told when work finishes instead of waiting.
- Go-live checklist before you ship.