Prompt enrichment
Pricing: Prompt enrichment
Every video prompt (text to video, image to video, reference to video) is rewritten on its way to the render queue, as on the website: a vision model looks at your images and video, keeps every fact, name, media label and quoted line, and expands the prompt into the production prose the model renders best from, with shots, framing, lighting, synchronized sound and the dialogue as a performance. Text to image prompts are rewritten too, always, by the Qwen-Image prompt rewriter (nothing turns it off). The other image jobs (image edit, multi-angle, face swap, human portrait) render the prompt as you send it.
Two kinds of prompt are passed through unchanged, because they are taken as written by a professional or a tool:
- a prompt of 3200 characters or more;
- a prompt in MiniMax H3's official structure (
integrated_multimodal_description:for text and frame prompts,subject_definitions:…detailed_description:for reference prompts).
Nothing turns the rewrite off for a shorter prompt. The rewrite is dropped, and your prompt rendered as sent, only when it comes back empty or unchanged, 30 characters or shorter, or over the render model's length cap. To see what the rewrite makes of a prompt, enrich it first.
x-pipelet-force-enrichment
Send the header x-pipelet-force-enrichment: 1 on a video create request to have the prompt enriched whatever its length or structure:
curl -X POST https://api.happypony.io/api/v1/jobs/text-to-video \
-H "Authorization: Bearer $HP_KEY" -H "Content-Type: application/json" \
-H "x-pipelet-force-enrichment: 1" \
-d '{ "prompt": "…a 3200-character scene you still want expanded…" }'
| Value | Effect |
|---|---|
1, true or any other value |
The prompt is always rewritten before rendering, long or structured prompts included. |
0, false, no, off, or no header |
The default above: short prompts are rewritten, long or structured ones are rendered as sent. |
Only the three video endpoints read the header, and a request with keyframes or <Picture N> labels in the prompt ignores it (those prompts follow the default rule above, so the labels survive). Text to image is always rewritten, and the other image endpoints and the video agent set their own value, so the header changes nothing there.
Enrich a prompt
POST /api/v1/jobs/enrich-prompt
The same rewrite a video job gets, on its own: send the prompt and the media the job would use, get the enriched prompt back. The call blocks, usually for a few seconds and rarely past a minute, and creates no job. Use it to see what a job would render from, to build your own prompt tooling, or to tell whether a prompt would be rewritten at all.
curl -X POST https://api.happypony.io/api/v1/jobs/enrich-prompt \
-H "Authorization: Bearer $HP_KEY" -H "Content-Type: application/json" \
-d '{
"type": "image-to-video",
"prompt": "she looks up and laughs",
"first_frame_url": "https://cdn.example.com/me.png",
"duration": 10
}'
{
"type": "image-to-video",
"original_prompt": "she looks up and laughs",
"enriched_prompt": "Medium close-up of a woman in her late twenties at a sunlit café table, …",
"enriched": true
}
| Field | Type | Notes |
|---|---|---|
type |
text-to-video | image-to-video | reference-to-video, required |
The job the prompt is for. It decides which media fields are accepted and the roles the rewrite gives them (frames to hit, references to draw from). |
prompt |
string, required | Up to 8000 characters. Written in any language; the rewrite keeps the prompt's language. |
duration |
int 5–20 | The clip length you will render, in seconds. Sets how much speech the rewrite allows. Default 5. |
nsfw |
bool | true for adult content, so the prompt goes to the model that accepts it. Default false. |
first_frame_url, last_frame_url |
string | image-to-video only. The same image inputs rules as the job. |
reference_image_urls |
string[] ≤ 9 | reference-to-video only. |
reference_video_url |
string | reference-to-video only. |
reference_audio_urls |
string[] ≤ 3 | reference-to-video only. Audio is not shown to the vision model, but telling it a voice exists changes how dialogue is written. |
Unknown fields are a 400, and a media field on a type that does not take it (a frame on text-to-video, a reference on image-to-video) is one too. The media is downloaded and copied into your storage before the call, exactly as for a job, so a bad URL is a 400 invalid_media naming the field.
| Field | Type | Description |
|---|---|---|
original_prompt |
string | Your prompt, trimmed. |
enriched_prompt |
string | The rewritten prompt, or original_prompt when nothing was changed. |
enriched |
bool | false when the original prompt came back. |
reason |
string | Only when enriched is false: unchanged (the model returned nothing new), too_short (the rewrite was 30 characters or shorter and was discarded) or over_length_cap (the rewrite would have exceeded the render model's prompt limit). |
Errors use the usual shape. Besides invalid_request, invalid_media and unauthorized: 502 media_failed when the media could not be stored, 502 enrich_failed when the enrichment service failed for any reason other than being switched off (retry), 503 enrich_unavailable when enrichment is switched off.
The job's own rewrite runs on whatever you submit. A prompt returned here and submitted unchanged is rewritten again unless it is 3200 characters or longer or in the official structure (see Prompt enrichment), so use this endpoint to preview and to build prompts, not to pin the exact text a job renders from.