kimi-k3 / moonshot-v1-8k-vision-preview / moonshot-v1-32k-vision-preview / moonshot-v1-128k-vision-preview / kimi-k2.5/ kimi-k2.6 / kimi-k2.7-code / kimi-k2.7-code-highspeed and so on) can understand visual content, including text in the image, colors, and the shapes of objects. The kimi-k3, kimi-k2.6, kimi-k2.7-code and kimi-k2.7-code-highspeed models can also understand video content. When you need the model to recognize images or videos, build multimodal requests as described on this page.
Upload images directly with base64
The following example encodes a local image as base64, passes it to Kimi as animage_url message part, and asks a question about the image:
message.content must be an array[object] (that is, a JSON array). Do not serialize the JSON array and put it into message.content as a string. This is a non-standard format and is not guaranteed to be processed as visual input; behavior may vary across models or versions. Always use the array format shown below.
The correct format — content is a JSON array of multiple parts:
Reference uploaded images or videos by file ID
Since video files are often larger, you can first upload images or videos to Moonshot and then reference them via file ID — see Image Understanding Upload for the upload API. The following example uploads a video file and asks the model to describe it through avideo_url using the ms:// protocol:
video_url.url is ms://<file-id>, where ms is short for moonshot storage — Moonshot’s internal protocol for referencing files.
Supported image and video formats
Images
Images support the following formats (MIME types):- image/jpeg
- image/png
- image/gif
- image/webp
- image/bmp
- image/heic
- image/heif
image_url, but the underlying system may decode them as videos, and token consumption is calculated as video accordingly.
SVG
SVG is not supported as image input: uploading an SVG withpurpose="image", or passing one through image_url (including base64-encoded), will be rejected. To have the model interpret SVG content, include the SVG source (XML text) directly as text in messages.
Videos
Videos support the following formats (MIME types):- video/mp4
- video/mpeg
- video/mov
- video/avi
- video/x-flv
- video/mpg
- video/webm
- video/wmv
- video/3gpp
Estimate token usage and costs
- Images and videos use dynamic token calculation: you can obtain the token consumption of a request containing images or videos through the estimate tokens API before starting the understanding process;
- Generally speaking, the higher the image resolution, the more tokens it consumes. Videos are composed of several key frames — the more key frames and the higher the resolution, the more tokens are consumed;
- The Vision model follows the same pricing model as the
moonshot-v1series, with costs based on the total tokens used for model inference. For token pricing, see Model Inference Pricing.
Keep image and video resolution within limits
We recommend that image resolution does not exceed 4k (4096×2160), and video resolution does not exceed FHD (1920×1080). Resolutions higher than recommended will only cost more time processing the input without improving model understanding performance.Choose between base64 and file upload
- Due to our overall request body size limitations, very large videos must be processed using the file upload method for visual understanding;
- For images or videos that need to be referenced multiple times, we recommend using the file upload method for visual understanding;
- Regarding file upload limitations, please refer to the File Upload documentation.
Feature support and limitations
The Vision model supports the following features:- Multi-turn conversations
- Streaming output
- Tool invocation
- JSON Mode
- Partial Mode
- URL-formatted images: Not supported, currently only supports base64-encoded image content and images/videos uploaded via file ID
- Image quantity: The Vision model has no limit on the number of images, but ensure that the request body size does not exceed 100M.
temperature, top_p, and n; we recommend using the defaults instead of setting them manually. See Model Parameter Differences for details.