Prompt expansion for image and video
Image and video models respond well to long, specific prompts, and most people write short ones. Prompt expansion closes that gap: with "prompt_expand": true, Hyperouter rewrites your prompt for the model before it renders. A picture gets a fuller description, and a video gets a second-by-second script.
It is off by default, so a prompt goes to the model as you wrote it.
Which models take it
Lumina and Qwen image and video models that list prompt_expand take it. Models are added over time, so check the list instead of a post: GET /v1/models returns supported_parameters for every model, and a model that takes the field lists prompt_expand there.
curl https://api.hyperouter.app/v1/models \
-H "Authorization: Bearer $HYPEROUTER_API_KEY"
The field works only to create an image or a video. On any other model, and on a video edit, extension or remix, it is refused with 400 unsupported_parameter. It cannot be combined with prompt_extend: true, which is refused with 400 invalid_body.
Turn it on in a request
prompt_expand is a top-level field of the image and video create calls. The OpenAI SDKs send it as an extra body field. Qwen Image 2.0 takes it:
curl https://api.hyperouter.app/v1/images/generations \ -H "Authorization: Bearer $HYPEROUTER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen/qwen-image-2.0", "prompt": "A lighthouse at dusk", "prompt_expand": true }'
img = client.images.generate(
model="qwen/qwen-image-2.0",
prompt="A lighthouse at dusk",
extra_body={"prompt_expand": True},
)
print(img.data[0].url)
For a video, use POST /v1/videos with the same field. A second field, locale, is a BCP 47 tag such as zh-CN. With prompt_expand it sets the language of spoken lines in a video, where the model speaks that language. Without it, spoken lines are in English.
See what rendered
The answer carries expanded_prompt, the prompt the model received. Your own prompt is unchanged. The field is on:
- the image answer;
- the Video object;
GET /v1/generations/{id}.
Hyperouter keeps expanded_prompt for 30 days after the request and answers null after that. It is also null when nothing was expanded.
Store expanded_prompt with your own records if you want it for longer than 30 days.
What it costs
The rewrite is billed on the same request, at x-ai/grok-4.6 token prices for the tokens it used. Hyperouter holds the most the rewrite can cost up front, together with the render, as it does for any request, and charges what was used. There is no second call.
A rewrite that fails, times out or cannot be used does not fail your request. The model renders your prompt as you sent it, the answer has expanded_prompt: null, and the rewrite costs nothing.
Getting access
Prompt expansion is available to an account once Hyperouter has enabled it. To request access, open a support ticket in the dashboard.
Until it is enabled, GET /v1/models does not list prompt_expand for any model. A request with prompt_expand: true on a model that offers it answers:
{
"error": {
"message": "...",
"type": "permission_error",
"code": "feature_not_enabled",
"param": "prompt_expand"
}
}
The status is 403. Nothing is held and nothing is sent to the provider, so the refused request costs nothing. Match on code, not on message.
What next
- Prompt expansion in the reference states the rules in full.
- Images and Videos list every field of the create calls.
- Every request has an ID you can quote shows how to look a request up later.