Skip to content

Images (vision)

Models with a Vision badge in the model catalog accept images in chat requests, using the standard OpenAI content-parts shape, existing OpenAI SDK code works unchanged:

{
  "model": "moonshotai/kimi-k2.7-code",
  "messages": [
    {
      "role": "user",
      "content": [
        { "type": "image_url", "image_url": { "url": "data:image/png;base64,..." } },
        { "type": "text", "text": "What is in this image?" }
      ]
    }
  ]
}

Both data: URIs (base64-inline) and https: URLs are accepted. The API accepts request bodies up to 32 MB; keep individual images to around 2 MB. (The playground takes up to four images per message, 2 MB apiece.)

Vision is verified per route

Vision is a per-deployment property, not a per-model one: the same model can see on one provider and be blind on another. Routes that serve image traffic pass a mechanical vision check, a generated test image the deployment has to actually describe, and are re-checked continuously; a route that fails loses image routing.

Two consequences:

  • Image requests go to capacity that has passed the vision check.
  • If no verified vision route currently exists for a model, you get 400 modality_not_supported, "Image input is not available for this model."

PDFs and other files

Keln does not parse files: sending a file, input_audio, or other non-image part returns 400 modality_not_supported naming the part type.

To use a PDF with a Vision model, render its pages to PNG/JPEG client-side (pdf.js, pdfium, ImageMagick) and attach them as image_url parts.

Notes

  • GET /v1/models reports each model's accepted inputs in input_modalities (["text"] or ["text", "image"]).
  • Switching a conversation to a text-only model drops the images from the replayed history, the playground shows this explicitly; over the API, replaying image parts at a text-only model returns the modality 400.
  • Image tokens are billed as input tokens exactly as the serving provider counts them, the same pass-through accounting as text.
  • Audio and video inputs are not offered.