Skip to navigation

Kimi K3.1 Pro

View as Markdown

Kimi K3.1 Pro is a general-purpose open-weight model served on Sarvam infrastructure. It accepts text, images, and video and has a 1,048,576-token context window.

Kimi K3.1 Pro is available on Provisioned Throughput: capacity is set up for your workload and enabled for your organisation. Without access, requests return 404 not_found_error and the model isn’t listed in GET /v2/models. Contact us to request access. See Provisioned Throughput.

At a glance

Model IDkimi-k3.1-pro
Best forAgentic workflows and reasoning over images and video
Context window1,048,576 tokens
Input → outputText + image + video → text
ReasoningAlways on: low, medium, high, or max (default). See Reasoning
Tool callingSupported, including parallel tool calls
APIsPOST /v2/chat/completions and POST /v2/responses
Pricing₹200 input · ₹20 cached input · ₹950 output per 1M tokens; reasoning is billed as output (Pricing)

Key capabilities

Long context

Process up to 1,048,576 tokens across the prompt, reasoning, and generated output.

Image and video input

Send base64 images and base64 video clips alongside text.

Reasoning

Receive reasoning in reasoning_content separately from the final answer in content.

Tool calling

Use OpenAI-compatible tools and tool_choice for agentic workflows.

Structured output

Constrain answers with response_format JSON schemas.

Streaming

Receive reasoning and answer deltas as server-sent events.

Moving from OpenRouter, Fireworks AI, or Together AI? The migration guides map model IDs and request fields to Sarvam.

Quickstart

from sarvamai import SarvamAI
client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY")
response = client.chat.completions_v2(
model="kimi-k3.1-pro",
messages=[
{
"role": "user",
"content": "Plan a three-step approach to migrate a monolith to microservices.",
}
],
max_tokens=4000,
)
print(response.choices[0].message.content)

Supported parameters

model: "kimi-k3.1-pro" on Chat Completion V2 and Responses. Full request/response schemas live on those API reference pages; this table covers what’s actually accepted for this model.

ParameterChat Completion V2Responses
Streaming (stream)
Image input (base64) image_url input_image
Video input (base64) video_url 400
Audio input 400 400
Tool calling (tools, tool_choice)
parallel_tool_calls: false enforced
Structured output (response_format / text.format)
Log probabilities (logprobs, top_logprobs) 400 400
Multiple choices (n > 1) 400N/A — Responses has no n
seed 400; outputs are not reproducible 400
top_k, min_p 400 400
Reasoning controlreasoning_effort: low, medium, high, or max (default)reasoning.effort: same values
Turn reasoning off always thinks always thinks

Reasoning

Thinking is always on and can’t be turned off. Effort levels: low, medium, high, max (default max); medium runs as high. Set them with reasoning_effort on chat or reasoning.effort on Responses. "none", "minimal", and "xhigh" return 400, and so does turning thinking off with thinking or chat_template_kwargs.

Read the reasoning trace from choices[].message.reasoning_content on chat. On Responses, output starts with a reasoning item; read its content[0].text. Its summary is empty unless you set reasoning.summary. Reasoning tokens are billed as output tokens and count against max_tokens / max_output_tokens.

On Responses, when the model calls tools, output has one reasoning item followed by the function_call items for that turn (sometimes with a message item between them).

Image input

Send images inline as base64 data URIs in an image_url content part on chat, or an input_image part on Responses. Supported formats are PNG, JPEG, WebP, GIF, BMP, and TIFF. Images sent by file_id are not supported.

import base64
with open("chart.png", "rb") as f:
data_uri = "data:image/png;base64," + base64.b64encode(f.read()).decode()
response = client.chat.completions_v2(
model="kimi-k3.1-pro",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Summarise this chart."},
{"type": "image_url", "image_url": {"url": data_uri}},
],
}
],
max_tokens=2000,
)

Images are resized to about 12.8 megapixels, so any image at or above that size costs about 16,700 input tokens. Images above about 179 megapixels are rejected.

Video input

Send a video inline as a base64 data URI in a video_url content part on Chat Completion V2. Remote video URLs return 400, and the Responses API doesn’t accept video.

The model follows what happens across the clip, in order. A 40-second clip with four scenes was described correctly in tests; for long videos, keep the request under the request size limit or sample key frames and send them as images.

import base64
with open("clip.mp4", "rb") as f:
video_uri = "data:video/mp4;base64," + base64.b64encode(f.read()).decode()
response = client.chat.completions_v2(
model="kimi-k3.1-pro",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe what happens in this clip."},
{"type": "video_url", "video_url": {"url": video_uri}},
],
}
],
max_tokens=2000,
)

Audio input is not supported and returns 400.

Tool calling

Pass OpenAI-compatible tools. tool_choice accepts "auto", "none", "required", or a named function ({"type": "function", "function": {"name": "..."}}). The model can return several tool calls in one turn; set parallel_tool_calls: false to get at most one.

Known limitations

  • Reasoning and the final answer share the max_tokens / max_output_tokens budget.
  • Log probabilities, n > 1, and seed are not supported.
  • Set max_tokens explicitly to bound cost and latency.

Limits and errors

AreaLimit or conditionAPI responseRecommended action
Outputmax_tokens exceeds 1,048,576400 invalid_request_errorSet max_tokens within the context window.
Request sizeRequest body exceeds 40 MiB (41,943,040 bytes)413 invalid_request_error, with the limit in the messageSend smaller or fewer media files. Base64 adds about 33%, so about 30 MB of raw media fits.
Media URLAn image, audio, or video part uses an http(s) URL400 invalid_request_errorSend the file inline as a base64 data URI.
Media countMore than 999 images or 999 videos in one request400 invalid_request_errorSplit the request.
Image sizeImage above about 179 megapixels400 invalid_request_errorDownscale the image.
ModalityRequest includes audio input400 invalid_request_errorSend text, image, or video input.
Choicesn > 1400 invalid_request_errorSend one request per completion.
Unsupported fieldseed, logprobs, top_k, min_p, or a reasoning_effort other than low, medium, high, max400 invalid_request_error, naming the fieldRemove the field or use a supported value.
ReasoningReasoning consumes the full max_tokens budget200 with finish_reason: "length"Raise max_tokens or lower the reasoning effort.
AuthenticationAPI key is missing or invalid403 invalid_api_key_errorCheck the api-subscription-key header.
ModelModel ID is unknown or unavailable404 not_found_errorCheck the spelling; model IDs are case-sensitive.
QuotaNo credits remain402 insufficient_quota_errorAdd credits in the dashboard.
Rate limitRequest or concurrency limit is exceeded429 rate_limit_exceeded_errorBack off and retry.
AvailabilityModel remains overloaded after retries503 model_overloadedRetry later.