Text to video
Pricing: MiniMax H3 video
A prompt in, one video with sound out (MiniMax H3). The same job as the Text only mode of www.happypony.io/minimax-h3. A video takes a few minutes; longer, higher-resolution and quality jobs take longer.
POST https://api.happypony.io/api/v1/jobs/text-to-video
GET https://api.happypony.io/api/v1/jobs/:requestId/status
GET https://api.happypony.io/api/v1/jobs/:requestId
PUT https://api.happypony.io/api/v1/jobs/:requestId/cancel
1) Create a request
POST https://api.happypony.io/api/v1/jobs/text-to-video with Content-Type: application/json.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
string | yes | — | The scene: who and where, what happens, camera, dialogue in quotes, sounds. At most 8000 characters. |
duration |
integer | no | 5 |
Seconds, from 5 to the canvas limit (Text-to-video duration limits). |
short_edge |
integer | no | 768 |
480, 768 or 1080: the shorter side in pixels. 768 is native; 1080 is rendered smaller and upscaled. |
aspect_ratio |
string | no | "16:9" |
"21:9", "16:9", "4:3", "1:1", "3:4" or "9:16". There is no "auto": without a frame there is nothing to follow. |
tier |
string | no | "turbo" |
"turbo" (fast) or "quality" (slower, more detail). |
Request body:
{
"prompt": "A street musician plays a slow tune on a violin in a rainy Paris alley at night. Neon reflects in the puddles; the camera slowly pushes in. Soft rain and distant traffic under the music.",
"duration": 10,
"short_edge": 768,
"aspect_ratio": "16:9",
"tier": "turbo"
}
curl -X POST https://api.happypony.io/api/v1/jobs/text-to-video \
-H "Authorization: Bearer $HP_KEY" -H "Content-Type: application/json" \
-d '{"prompt": "A street musician plays a slow tune on a violin in a rainy Paris alley at night. Neon reflects in the puddles; the camera slowly pushes in. Soft rain and distant traffic under the music.", "duration": 10, "short_edge": 768, "aspect_ratio": "16:9", "tier": "turbo"}'
Response 202 (fields: Create response):
{
"request_id": "48262",
"type": "text-to-video",
"status": "IN_QUEUE",
"credits": 40,
"status_url": "https://api.happypony.io/api/v1/jobs/48262/status",
"response_url": "https://api.happypony.io/api/v1/jobs/48262",
"cancel_url": "https://api.happypony.io/api/v1/jobs/48262/cancel"
}
Text-to-video duration limits
The longest clip depends on the canvas. A longer duration is a 400.
short_edge |
1:1 |
4:3, 3:4 |
16:9, 9:16 |
21:9 |
|---|---|---|---|---|
480 |
20 s | 20 s | 20 s | 20 s |
768 |
20 s | 20 s | 15 s | 10 s |
1080 |
20 s | 20 s | 20 s | 20 s |
Writing the prompt
The model writes the picture and the soundtrack from the prompt, with nothing else to go on, so describe the scene fully. In one paragraph: who or what is in it and where, what happens in order, how the camera moves, spoken lines in quotation marks (about 3 words per second of clip, and say who speaks), and the sounds and what makes them. There is no negative prompt: write "Ambient sound only." rather than "no music". Prompts under 3200 characters are expanded automatically (see Prompt enrichment); quoted dialogue is kept word for word.
2) Poll for status
Poll the status_url until status is COMPLETED, FAILED or CANCELLED (fields: Status response). A queued job can be cancelled with PUT on the cancel_url (Cancel a request).
curl https://api.happypony.io/api/v1/jobs/48262/status -H "Authorization: Bearer $HP_KEY"
{
"request_id": "48262",
"type": "text-to-video",
"status": "IN_PROGRESS",
"created_at": "2026-10-08T10:00:00.000Z",
"completed_at": null,
"credits": 40,
"eta_seconds": 180,
"status_url": "…", "response_url": "…", "cancel_url": "…"
}
3) Fetch the result
When status is COMPLETED, fetch the response_url (common fields: Result response):
curl https://api.happypony.io/api/v1/jobs/48262 -H "Authorization: Bearer $HP_KEY"
{
"request_id": "48262",
"type": "text-to-video",
"status": "COMPLETED",
"created_at": "2026-10-08T10:00:00.000Z",
"completed_at": "2026-10-08T10:04:05.000Z",
"credits": 40,
"videos": [{ "url": "https://…signed…", "format": "mp4" }],
"expires_in": 259200,
"parameters": { "prompt": "A street musician plays a slow tune on a violin in a rainy Paris alley at night. …",
"tier": "turbo", "duration": 10, "short_edge": 768, "aspect_ratio": "16:9" },
"status_url": "…", "response_url": "…", "cancel_url": "…"
}
| Field | Type | Description |
|---|---|---|
videos |
object[] | One mp4 with its soundtrack. |
parameters |
object | prompt, tier, duration, short_edge, aspect_ratio. |
Full example
Create, poll until done, download:
curl (bash)
# Needs curl and jq. Usage: HP_KEY=hp_… ./t2v.sh
JOB=$(curl -s -X POST https://api.happypony.io/api/v1/jobs/text-to-video \
-H "Authorization: Bearer $HP_KEY" -H "Content-Type: application/json" \
-d '{"prompt": "A street musician plays a slow tune on a violin in a rainy Paris alley at night. Neon reflects in the puddles; the camera slowly pushes in. Soft rain and distant traffic under the music.",
"duration": 10, "aspect_ratio": "16:9"}')
echo "$JOB" | jq .
STATUS_URL=$(echo "$JOB" | jq -r .status_url)
RESPONSE_URL=$(echo "$JOB" | jq -r .response_url)
while :; do
STATUS=$(curl -s "$STATUS_URL" -H "Authorization: Bearer $HP_KEY" | jq -r .status)
[ "$STATUS" = IN_QUEUE ] || [ "$STATUS" = IN_PROGRESS ] || break
sleep 10
done
echo "$STATUS"
curl -s "$RESPONSE_URL" -H "Authorization: Bearer $HP_KEY" | jq -r '.videos[] | "\(.format) \(.url)"' |
while read -r FORMAT URL; do curl -s -o "video-$((++i)).$FORMAT" "$URL"; done
Python
# pip install requests | HP_KEY=hp_… python t2v.py
import os, time, requests
BASE = "https://api.happypony.io/api/v1/jobs"
H = {"Authorization": f"Bearer {os.environ['HP_KEY']}"}
job = requests.post(f"{BASE}/text-to-video", headers=H, json={
"prompt": "A street musician plays a slow tune on a violin in a rainy Paris alley at night. "
"Neon reflects in the puddles; the camera slowly pushes in. "
"Soft rain and distant traffic under the music.",
"duration": 10,
"aspect_ratio": "16:9",
})
job.raise_for_status()
job = job.json()
print("job", job["request_id"], "costs", job["credits"], "credits")
while (s := requests.get(job["status_url"], headers=H).json())["status"] in ("IN_QUEUE", "IN_PROGRESS"):
time.sleep(10)
result = requests.get(job["response_url"], headers=H).json()
if result["status"] != "COMPLETED":
raise SystemExit(f"{result['status']}: {result.get('error', '')}")
for i, video in enumerate(result["videos"]):
with open(f"video-{job['request_id']}-{i}.{video['format']}", "wb") as f:
f.write(requests.get(video["url"]).content)
TypeScript
// Node 18+ (global fetch). HP_KEY=hp_… npx tsx t2v.ts
import { writeFile } from 'node:fs/promises';
const BASE = 'https://api.happypony.io/api/v1/jobs';
const H = { Authorization: `Bearer ${process.env.HP_KEY}`, 'Content-Type': 'application/json' };
const res = await fetch(`${BASE}/text-to-video`, {
method: 'POST', headers: H,
body: JSON.stringify({
prompt: 'A street musician plays a slow tune on a violin in a rainy Paris alley at night. ' +
'Neon reflects in the puddles; the camera slowly pushes in. Soft rain and distant traffic under the music.',
duration: 10,
aspect_ratio: '16:9',
}),
});
const job = await res.json();
if (!res.ok) throw new Error(`${res.status}: ${job.message}`);
let status = 'IN_QUEUE';
while (status === 'IN_QUEUE' || status === 'IN_PROGRESS') {
await new Promise((r) => setTimeout(r, 10_000));
status = (await (await fetch(job.status_url, { headers: H })).json()).status;
}
const result = await (await fetch(job.response_url, { headers: H })).json();
if (result.status !== 'COMPLETED') throw new Error(`${result.status}: ${result.error ?? ''}`);
for (const [i, video] of result.videos.entries()) {
await writeFile(`video-${job.request_id}-${i}.${video.format}`, Buffer.from(await (await fetch(video.url)).arrayBuffer()));
}