state. These models also accept media:
Text-only Decisions requests, including every request to Jev, work the same as before.
Quickstart
Encode an image as base64 and put it in thestate array as an image_url part, next to any text:
Image part format
An image is an item of thestate array with this shape, the same image part Chat Completions uses in message content:
urlmust be a base64 data URL with the typeimage/png,image/jpeg, orimage/webp. Remotehttp(s)URLs are not fetched.detail(auto,low, orhigh) is accepted, but Clef, Clef Flash, Clef Omni, and Mercury Decide ignore it.- Put image parts directly in the top-level
statearray. Images nested inside other objects instateare not read as images. - Send at most 4 images per request to Clef, Clef Flash, and Clef Omni, at most 16 to Mercury Decide, and at most 128 to GPT-6 Luna Decisions.
- Text items in the array are plain strings, not
{ "type": "text" }parts.
- A top-level
imagesfield. The API rejects it with a400. - The Responses API
input_imagepart ({ "type": "input_image", "image_url": "data:..." }). - A raw base64 string without the
data:image/...;base64,prefix.
Audio and video parts (Clef Omni)
cloudflare/clef-omni also takes audio and video items in the top-level state array, using the same part shapes Chat Completions uses in message content:
input_audio.datais raw base64 (nodata:prefix).formatmust be one ofwav,mp3,mpeg,m4a,mp4,aac,aiff,aif,flac,ogg,opus, orwebm.video_url.urlmust be a base64data:video/...URL. Remotehttp(s)URLs are not fetched.processingis accepted but ignored. Clef Omni samples every video at 2 frames per second regardless.- Send at most 4 audio clips and 2 videos per request. Each audio clip can be up to 8 MiB or 300 seconds, each video up to 16 MiB or 60 seconds, and all audio and video together up to 16 MiB decoded.
- Audio costs about 780 input tokens per minute; audio, video, and image tokens all count toward the 65,536-token context window.
- Only Clef Omni reads audio and video. Clef and Clef Flash reject requests that contain them; other Decisions models see these parts as plain JSON text.
Limits
- Image size on Clef and Clef Flash. Workers AI estimates a request’s tokens from the base64 length before it processes the image, at about 4 base64 characters per token, and rejects the request with a
413once that estimate passes its 65,536-token window. Keep each image under about 300 KB before encoding, and resize or recompress larger images. Billing uses the tokens the model actually processes. - Text length on Clef and Clef Flash. Workers AI reads roughly the first 2,000 tokens of text in
stateand drops the rest without an error. Images are counted separately. - Image size on Mercury Decide. A 7 MB JPEG (a 10 MB request body) is accepted and billed as about 1,000 input tokens. A 12 MB image fails with a
422, and a 16 MB image with a413, so keep each image under a few MB. - Provider errors on Mercury Decide. Image parts pass through to Inception as sent, so an image it can’t read (a remote URL, a raw base64 string) or more than 16 images fails with a
422from the provider rather than a400from OpenRouter. - See each model page for the current context length and pricing.
Related
- Jev Documentation covers the Decisions primitives (Choice, Noul, Score) in depth.
- Decisions API reference has the full request and response schema.