Generative Model Prompt Parameters, Multimodal Inputs, and Output Formats
How Cloudflare Workers AI and AI Gateway document prompt, text, and media inputs, limits, safety options, and what each model returns.
This page summarizes how Cloudflare documents request fields for generative models exposed through Workers AI and the AI Gateway model catalog. Almost every image, video, speech, and music model takes a natural-language prompt or text string; many also accept reference images, masks, or audio URLs with explicit size and format limits. Outputs are usually a hosted URL, base64 data, or a stream, often with a short retention window.
prompt and text: what to send for each modality
Section titled “prompt and text: what to send for each modality”The main text field name depends on the task. Image and video models typically use prompt as the required instruction. Text-to-speech and many transcription helpers use text instead. Speech-to-text models take audio_url, file, or binary audio rather than a generation prompt.
For GPT Image 2, the gateway describes generation or editing like this:
Text prompt describing the image to generate or edit
— Cloudflare, GPT Image 2
Video models follow the same pattern. FLUX 3 Video text-to-video mode requires:
Free-form prompt describing the video.
— Cloudflare, FLUX 3 Video
For speech, TTS-1 uses text with a hard cap:
The text to generate audio for. Maximum length is 4096 characters.
— Cloudflare, TTS-1
Grok TTS allows a longer script and documents inline control tags in the same field:
Text to convert to speech. Maximum 15,000 characters. Supports inline speech tags: [pause], [laugh], <whisper>…</whisper>, etc.
— Cloudflare, Grok TTS
Common conclusion: treat the model’s parameter page as the source of truth for the field name (prompt vs text), whether it is required, and the maximum length. Do not assume one limit applies across providers; compare the specific model you call.
Practical length and mutual-exclusion limits
Section titled “Practical length and mutual-exclusion limits”| Concern | Example from the catalog |
|---|---|
| Short TTS | TTS-1: text max 4096 |
| Long TTS | Eleven Flash v2.5: text max 10,000 |
| Video prompt | Kling 4.0: up to 26,000 characters |
| Conflicting STT options | AssemblyAI Universal-3 Pro: prompt cannot be used with keyterms_prompt; audio_url cannot be used with websocket: true |
| Conflicting TTS modes | Grok TTS: text is required for REST and mutually exclusive with websocket: true |
Image prompt parameters: size, steps, and structured prompts
Section titled “Image prompt parameters: size, steps, and structured prompts”Text-to-image models on Workers AI share a familiar shape: required prompt, optional negative_prompt, pixel height/width or aspect_ratio, and tuning knobs such as guidance, seed, and num_steps.
Dreamshaper 8 LCM documents:
A text description of the image you want to generate
— Cloudflare, dreamshaper-8-lcm
For img2img and inpainting, the same family of models accepts image_b64 or an integer image array plus a mask, with strength controlling how much the output drifts from the source (default 1; lower values keep the input closer).
Some catalog models add structured prompts. FIBO Generate 1.5 lets you send structured_prompt as a JSON string returned from a previous run so you can recreate or refine with the same seed; it cannot be combined with a reference images array in the same request.
JSON prompting on multipart image models
Section titled “JSON prompting on multipart image models”Changelog entries for Workers AI describe JSON control for certain image models when the HTTP body is multipart form data:
The model supports prompting in JSON to get more granular control over images. You would pass the JSON as the value of the ‘prompt’ field in the multipart form data.
— Cloudflare, Launching FLUX.2 [dev] on Workers AI
The documented schema requires scene and subjects (each subject needs type, description, pose, and position in foreground | midground | background). Optional fields include style, a three-color color_palette, lighting, mood, composition, camera, and effects. The same JSON prompting text appears in Workers AI changelog and related product changelog pages.
FLUX.2 [flex] on the gateway uses plain prompt text but adds provider-side expansion: prompt_upsampling defaults to true on flex, with guidance between 1.5 and 10 and steps between 1 and 50.
Video prompt parameters: duration, keyframes, and multimodal refs
Section titled “Video prompt parameters: duration, keyframes, and multimodal refs”Video models extend the image pattern with duration, resolution, aspect_ratio, and often generate_audio. Text-only generation usually requires prompt; image-to-video adds image, image_input, or first_frame URLs or base64 data URIs.
Seedance 2.5 supports rich conditioning: up to 30 reference_images, 10 reference_videos (total reference video length capped at 30 seconds), and 10 reference_audios—including audio-only input when no image or video is supplied. Duration can be 4–30 seconds or -1 for automatic selection; when editing a reference video, only -1 is supported and output length tracks the input.
FLUX 3 Video defines three modes: t2v, i2v (with flexible keyframes), and v2v (start_video up to 50 MB and 15 seconds). safety_tolerance runs from 0 (strictest) to 4, with documented caps for sexual and hate content and stricter limits when conditioning media is present.
Signed output URLs for generated MP4 are short-lived—for example FLUX 3 Video notes the URL expires about two hours after the job is ready, so clients should download promptly.
Speech, music, and transcription inputs (not always named prompt)
Section titled “Speech, music, and transcription inputs (not always named prompt)”Transcription models expect audio, not a creative prompt. GPT-4o Transcribe requires file as a data URI or HTTPS URL (flac, mp3, mp4, and other listed formats). An optional prompt there guides style or continues a prior segment and should match the audio language—not the same role as an image prompt.
Whisper Large V3 Turbo accepts binary or structured audio, with optional initial_prompt for context and many decoding thresholds (no_speech_threshold, compression_ratio_threshold, etc.) to reduce hallucinations.
Real-time STT: Deepgram flux streams linear16 PCM with turn events (StartOfTurn, EndOfTurn, EagerEndOfTurn) and documents keyterm query parameters to boost specialized terms.
Music uses descriptive prompts: ElevenLabs Music v2 takes a prompt for style and mood plus optional lyrics (up to 3500 characters) or a composition_plan with chunked timings and styles.
Reference images, masks, and edit instructions
Section titled “Reference images, masks, and edit instructions”Editing models combine language with visual inputs:
- FIBO Edit 1.5: one to four
images, natural-languageinstructionorstructured_instruction, optional black-and-whitemask(white = edit region); mask only with a single input image. - GPT Image 2: up to 16 base64 or data-URI entries in
images, plusbackground(transparent|opaque|auto) andoutput_format. - Remove Background:
imagerequired;preserve_alphacontrols partial transparency in the cutout.
Ad Delayer is a specialized case: required flat image (PNG/JPEG/WEBP, up to 10 MB and 1350 px per side) returns a layer_document URL; Bria hosts the document and assets for 30 days.
aspect_ratio, quality, safety, and moderation
Section titled “aspect_ratio, quality, safety, and moderation”Gateway models expose generation layout and policy knobs under predictable names:
| Parameter family | Typical use |
|---|---|
aspect_ratio / size / resolution |
Layout and pixel budget (Nano Banana Pro, Recraft V4) |
quality |
Speed vs fidelity (Grok Imagine Image: low, medium, high) |
safety_tolerance |
Moderation strictness (FLUX.1 Kontext [max]: 0 strictest, 6 most permissive) |
*_content_moderation |
Reject or fail on failed checks (FIBO Generate 1.5, default true on prompt and visual I/O) |
ip_signal |
Optional warning when text may reference IP-protected content (Bria FIBO models) |
Cloudflare Images background is unrelated to GPT Image’s background enum—it fills transparent pixels when resizing (default %23FFFFFF), using HEX, CSS names, or rgb() / rgba().
Model output formats: URLs, base64, and streams
Section titled “Model output formats: URLs, base64, and streams”Responses are not uniform. Check each model’s output schema on its catalog page:
- Hosted URL: FIBO Generate 1.5 returns
imageas a URI; Bria hosts for 3 days by default. - Base64 in JSON: flux-1-schnell returns
imageas Base64; Gemini 3.8 Flash TTS returnsaudioas Base64 WAV. - ReadableStream: aura-2-en notes the binding returns a
ReadableStreamwith audio in MPEG format. - Presigned object storage: Grok TTS returns
audioas a presigned R2 URL whose MIME type reflects the requested codec.
Stream video transforms are a separate product: .output() mode can be video, frame, spritesheet, or audio, with time and duration for clipping—not a generative prompt, but part of the same media pipeline on Cloudflare.
Related image tooling outside the model catalog
Section titled “Related image tooling outside the model catalog”Chrome extensionTypes documents format (default jpeg) and quality for extension-generated images—quality affects artifacts and byte size for JPEG only.
The Images binding .text() method rasterizes up to 1,000 characters of styled text into an image up to 4096×4096 px, with optional overlay via .draw()—useful for watermarks and captions without calling a generative model.
Common mistakes when filling prompt and inputs
Section titled “Common mistakes when filling prompt and inputs”- Using
prompton a TTS model that expectstext, or exceeding that model’s character cap (Inworld TTS 2: 2,000 characters). - Sending reference
imagestogether withstructured_prompton FIBO Generate 1.5 where the schema forbids the combination. - Assuming
seedguarantees reproducibility everywhere (Seedance 2.5 states reproducibility is not guaranteed by the provider). - Relying on long-lived output URLs without downloading (FLUX video ~2 hours; Bria images ~3 days; Ad Delayer layers 30 days).
- Enabling
Transparentbackground on Video Remove Background 3.0 withoutmov_proresksoutput preset—documentation says other presets fall back to black and return awarning. - Omitting
domainorlanguagewhen enabling normalization features on STT APIs that require them (Grok STTformat: trueneedslanguage).
How to check this on your site
Section titled “How to check this on your site”-
Open the exact model page you invoke (for example GPT Image 2.5 Flare or Universal-3.5 Pro) and confirm whether the primary string field is
prompt,text, or an audio/file input. -
Compare your request JSON or multipart body against required fields,
maxLengthvalues, and mutually exclusive flags (websocket,structured_prompt+images, etc.). -
Issue a minimal test call through your Workers AI or AI Gateway integration and inspect the response field documented on that page (
image,video,audio,text, or stream). -
If the response is a signed URL, download immediately and verify format and retention match the model doc (FLUX 3 Video, Remove Background).
-
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page does not match the current Cloudflare model catalog, email yimasynthetic@gmail.com with the page URL and the sentence you think is wrong so it can be corrected.