Skip to main content
This feature is in Public Preview.
Vision-capable models can process objects, diagrams, screenshots, and text within images alongside a text prompt. Send images through the Chat Completions API as base64-encoded data URIs in the messages array. See Limitations for known constraints.
Image inputs are available for qwen-3.8-27b on the public shared tier. gemma-4-31b and other image-capable models are available through Dedicated Endpoints. kimi-k2.7-code supports image inputs on customer-trial endpoints but is not available on the public shared tier.

Usage

To send an image, add an image_url object to the content array in a user message. The image must be base64-encoded and passed as a data URI.
Use the encoder in the Token Usage section to convert your image to a base64 data URI. It also shows the estimated token count and encoded payload size.

Input requirements

1 These limits apply to the shared tier during Public Preview. Higher image limits may be available with Dedicated Endpoints or explicit organization configurations.
qwen-3.8-27b currently accepts image content only in user messages. Images in tool messages aren’t supported.

Token usage

Image token usage depends on the selected model and its processed image dimensions, not the uploaded file size alone. The estimator below implements the current preprocessing behavior for the listed models and shows both processed resolution and estimated image tokens.

Estimate token count

Select a model and upload an image below to copy its base64 data URI, check the encoded size, and view an estimate. The estimator defaults to qwen-3.8-27b.

Model preprocessing

For each model, estimate tokens from the processed dimensions:
To validate image token usage, inspect usage.image_tokens in the API response. This field reports the total number of image tokens used by the request. usage.prompt_tokens includes text tokens, image tokens, and message-formatting tokens. The difference between image and text-only prompt_tokens can include message-formatting tokens and might not match usage.image_tokens. Keep the following in mind:
  • The estimator is an approximation based on the current model preprocessing configuration.
  • Compressed file size does not directly determine token count. Processed image dimensions matter more than PNG or JPEG byte size.
  • Image tokens are included in usage.prompt_tokens and are also reported in usage.image_tokens.
  • Image tokens occupy part of the model context window, just like text prompt tokens.

Limitations

  • Medical images: Not suitable for interpreting specialized medical images such as CT scans or MRIs. Do not use for medical diagnosis or advice.
  • Small text: May have difficulty reading small or low-resolution text. Enlarging text within the image before sending can improve results.
  • Rotated content: May misinterpret text or images that are rotated or upside-down.
  • Graphs and charts: May struggle to distinguish visual elements that differ only in color or line style, such as solid versus dashed lines.
  • Spatial reasoning: Not reliable for tasks requiring precise spatial localization, such as identifying positions on a map or board game.
  • Object counting: The model may give approximate counts for objects in images.
  • Image shape: May perform less accurately on panoramic or fisheye images.
  • Preprocessing: The model cannot access original filenames or metadata. Images may be resized before analysis. See Token usage for details.
  • Accuracy: The model may generate inaccurate descriptions or captions in some scenarios. Verify outputs for high-stakes use cases.
  • CAPTCHAs: CAPTCHA images are not supported.
  • Indirect prompt injection: Text embedded in an image is included in the model’s prompt context alongside the user’s text. If an image contains adversarial instructions (for example, text that says “ignore all previous instructions”) and the user prompt asks the model to answer based on the image, the model may follow those embedded instructions. Treat image content from untrusted sources as untrusted input, and use a system prompt to constrain the model’s behavior when processing images you don’t control.
  • Untrusted output: The model may transcribe or describe text from an image verbatim, including HTML, script tags, URLs, or control characters. The API returns this content unmodified. Treat it the same as any other untrusted input before rendering, logging, or executing it in your application.

FAQs

Yes. Cerebras Chat Completions is stateless. If a follow-up request depends on an earlier image, include that image-bearing turn in the conversation history you send with the new request. Continue to include that turn for as long as the model needs the visual context.
No, only image input is supported. The model returns text only and does not generate images.
Yes. Prompt caching can help with repeated images and repeated multimodal context within your organization. Prompt caches are never shared between organizations and remain ephemeral. See Prompt Caching.
No. Image support uses the same rate limit framework as text. The same request and token limits still apply based on your organization and tier. For current details, see Rate Limits.
Image inputs are processed as soon as they are received, and the original image payloads are not persisted. After preprocessing, image tokens and image embeddings may be cached ephemerally within your organization to support prompt caching.