Kimi AI Context Window: Limits by Model

Last verified: September 13, 2026.

The Kimi context window depends on both the model and the product. In Kimi Code, K2.8 Preview runs through kimi-for-coding with up to 1,048,576 tokens. Through the direct Kimi API, Kimi K3 supports 1,048,576 tokens, while Kimi K2.7 Code, K2.7 Code HighSpeed, and Kimi K2.6 support 262,144 tokens. Kimi Chat and Deep Research have their own product-level limits.

The published context number is not an input-only allowance. System instructions, conversation history, files, supported media, tool definitions, tool results, preserved reasoning, and the next generated response can all use the available working space.

Context planning rule: identify the model, product surface, plan entitlement, client configuration, and required output reserve before deciding how much content fits.

Kimi context window limits at a glance

The official Kimi API model list and individual model guides publish the following limits for direct Open Platform API models. This table is separate from Kimi Code:

Kimi direct API model list with model-specific context-window information
Kimi direct API model documentation at the time of capture. Screenshot captured September 8, 2026. This is not the Kimi Code model list.
Direct API Model IDContext WindowPrimary Role
kimi-k31M / 1,048,576 tokensFlagship model for long-horizon coding, knowledge work, reasoning, and multimodal tasks
kimi-k2.7-code256K / 262,144 tokensCoding-specialized model with thinking enabled
kimi-k2.7-code-highspeed256K / 262,144 tokensFaster serving route for the same K2.7 Code model
kimi-k2.6256K / 262,144 tokensGeneral-purpose multimodal model with optional thinking

These are model-level direct API limits. They should not be copied automatically into Kimi Chat, Kimi Code, a third-party inference provider, or a specialized Kimi feature. In particular, upgrading kimi-for-coding to K2.8 Preview does not change kimi-k2.7-code into a 1M API model. For a broader comparison, use the Kimi API models guide.

Identify the Kimi product before applying a token limit

The same Kimi brand appears across several products. Each product can expose a model through a different endpoint, plan, Model ID, context policy, or history-management system.

SurfaceWhat controls the effective limit?Common mistake
Direct Kimi APIAPI Model ID, request size, and completion reserveApplying a consumer Chat limit to an API request
Kimi ChatSelected model, conversation state, and membership entitlementAssuming every K3 chat receives the complete 1M window
Kimi CodeKimi Code Model ID, membership tier, and coding-client configurationUsing a direct API ID or retaining an outdated client-side context limit
Deep ResearchThe feature-specific Kimi-Researcher workflowAssuming it automatically inherits K3’s 1M context
Third-party providerThe provider’s deployed checkpoint, endpoint, and service limitsTreating the provider’s limit as Moonshot’s direct product limit
Self-hosted modelCheckpoint, inference engine, configuration, and available hardwareAssuming the model card’s maximum is enabled by default

Start every context calculation by recording the exact endpoint and model ID. K3 has both 1M-capable and 256K Kimi Code routes, while the unchanged kimi-for-coding ID now identifies K2.8 Preview. A familiar display name or a saved configuration is not enough to identify the effective limit.

Direct Kimi API context windows by model

Kimi K3: 1,048,576 tokens

Kimi K3 has the largest context window in the current direct API catalog. The official K3 documentation specifies a 1M-token window for long-horizon coding, knowledge work, reasoning, and native multimodal input.

A one-million-token context does not mean the application can send 1,048,576 input tokens and still request a long answer. Input and output must fit within the same model ceiling.

K3 also keeps thinking enabled. Its reasoning effort can be set to low, high, or max. A context budget should therefore leave room for reasoning, tool calls, and final-answer tokens rather than allocating nearly the entire window to source material.

Kimi K2.7 Code: 262,144 tokens

Through the direct API, Kimi K2.7 Code supports a 256K context window. The official K2.7 Code guide describes its coding, tool-use, and multimodal capabilities. Its API ID is kimi-k2.7-code, not the Kimi Code alias kimi-for-coding.

K2.7 Code HighSpeed has the same 256K context because it is a faster serving route for the same underlying model. It changes output speed, not the amount of context available.

K2.7 Code keeps thinking enabled. When an application preserves full assistant messages, reasoning content, tool calls, and tool results across turns, that history can occupy a significant portion of the next request.

Kimi K2.6: 262,144 tokens through the API

Kimi K2.6 supports 256K through the Direct API. According to the official K2.6 guide, the model accepts text, images, and video and can run with thinking enabled or disabled.

The 256K figure applies to the API model. The consumer Kimi Chat product publishes a smaller approximate limit for a K2.6 conversation, which is why different official Kimi pages can show different numbers without necessarily contradicting each other.

Kimi Chat context limits

Consumer Kimi Chat applies product and membership rules in addition to the technical capabilities of the underlying model.

Chat ConfigurationPublished CapacityImportant Qualification
K2.6 single conversationApproximately 128K tokensConsumer Chat limit, not the K2.6 Direct API ceiling
K3 Extra-Long ChatUp to 1M tokensCurrently listed for Allegro and Vivace members
K3 without Extra-Long Chat entitlementDo not assume the complete 1M windowThe model may be available while the largest Chat capacity remains plan-dependent

The Kimi Chat troubleshooting page describes K2.6’s single-conversation context as approximately 128K tokens. Once that conversation fills, Kimi may no longer accept additional usable content.

Kimi recommends summarizing the conclusions, creating a handoff document, and starting a new conversation. Deleting earlier messages inside the same conversation does not release the accumulated context according to the current Help Center guidance.

For K3, the official membership comparison lists Extra-Long Chat capacity of up to 1M tokens for Allegro and Vivace. See the internal Kimi AI pricing guide for the broader distinction between consumer membership, credits, and API billing.

Kimi Code context windows and plan access

Kimi Code has its own endpoint, Model IDs, membership rules, and context-management behavior. Its Model IDs should not be confused with Direct Open Platform IDs such as kimi-k3.

The September 11, 2026 release notice confirms that kimi-for-coding was upgraded in place to K2.8 Preview. The ID stayed the same; the underlying model changed, and its context increased from 256K to up to 1M.

Kimi Code model IDUnderlying modelContext windowAccess rule
k3Kimi K3Up to 1,048,576 tokensModerato: up to 262,144; Allegretto and higher: up to 1,048,576
k3-256kKimi K3Fixed 262,144 tokensModerato and higher
kimi-for-codingKimi K2.8 PreviewUp to 1,048,576 tokensAll Kimi Code members
kimi-for-coding-highspeedKimi K2.7 Code HighSpeed262,144 tokensAllegretto and higher

The Kimi Code model configuration reference lists these limits and notes that the 1M K3 route consumes approximately twice the quota of k3-256k. That comparison concerns the two K3 routes; it is not a universal cost ratio for K2.8 Preview.

K2.8 Preview’s 1M access is not subject to K3’s higher-tier rule. The release notice makes it available across Kimi Code membership tiers. Membership access still has usage limits; it does not mean unlimited free API calls or identical capacity in consumer Chat.

A third-party coding client may expose less than 1M

A coding client can impose a smaller context limit than the selected model supports. This matters for both k3 and kimi-for-coding: a saved 262,144-token setting should not be treated as proof that K2.8 Preview is still a 256K model.

Check the client’s configured context length and displayed capacity. For a supported 1M route, the model ceiling is 1048576; the field name and configuration steps depend on the client. Kimi’s Hermes integration guide, for example, uses context_length. Do not add that field blindly to a different client’s configuration.

A model ID does not override a client-side cap or grant additional plan access. Keep k3-256k and kimi-for-coding-highspeed at their 262,144-token limits, and do not assume a Moderato account unlocks K3 at 1M. For K2.8 Preview, check the selected ID and client configuration rather than applying K3’s plan restriction.

Switching from 1M to 256K can trigger compaction

When a Kimi Code session already exceeds 256K and the user switches from k3 to k3-256k, supported tools may compact the history. Kimi recommends running a manual compact first so the summary can prioritize the requirements, decisions, and unfinished work that matter most.

The official Kimi Code session documentation explains automatic history compression near the limit and manual compression with /compact. You can add a hint about what the summary should preserve.

Apply the same planning precaution before moving a long K2.8 Preview session to a 256K-only route: preserve the objective, constraints, verified findings, and unfinished work before switching. Do not assume every third-party client handles an oversized history automatically.

Thinking effort and cache after the upgrade

K2.8 Preview supports low, high, and max thinking effort, with max as its default. These settings do not create additional context beyond the model’s ceiling.

Kimi’s model reference warns that changing models or thinking effort can invalidate cached context and require it to be processed again. Keep effort consistent within a session; when moving to the upgraded model, Kimi recommends starting a new session. Cache reuse affects processing and usage, not the published context limit.

Special workflows and historical Kimi context lengths

Search results can include older models or special products whose context windows should not be applied to the current Direct API catalog.

Model or WorkflowContextHow to Interpret It
Kimi Deep Research128KFeature-specific Kimi-Researcher workflow
Original Kimi K2 Base and Instruct128KHistorical open-weight checkpoints
Kimi K2 Instruct 0905256KLater historical Instruct checkpoint
Kimi K2 Thinking256KHistorical reasoning model
Moonshot V1 family8K, 32K, or 128KHistorical limits; the direct API series was retired on August 31, 2026

The official Deep Research FAQ currently specifies 128K for a research task. A user selecting Deep Research should therefore plan around its feature-specific capacity rather than assuming the task receives K3’s 1M window.

For the difference between original K2 checkpoints and retired K2 API routes, see the internal Kimi K2 historical model guide.

The API catalog’s retirement notice confirms that the direct moonshot-v1 series is no longer available. Historical model context specifications should not be read as a list of callable API endpoints.

What counts toward the Kimi context window?

The active context is the complete package sent to or retained for the current generation. The latest visible prompt may be only a small part of it.

  • System instructions: roles, policies, output constraints, and application rules.
  • Conversation history: earlier user, assistant, and tool messages sent again with the request.
  • Current user input: the latest question, instructions, and pasted text.
  • Documents: text extracted from PDF, Word, spreadsheet, Markdown, or plain-text files.
  • Images and video: visual content converted into model-consumable tokens.
  • Tool definitions: names, descriptions, and JSON schemas available to the model.
  • Tool results: search output, terminal logs, database results, code execution, and other returned content.
  • Preserved reasoning: reasoning fields resent in supported multi-turn thinking workflows.
  • The next completion: reasoning and final-answer tokens generated for the current response.

A short visible question can therefore create a large request when it sits behind a long system prompt, hundreds of prior messages, several tool schemas, and multiple attached documents.

Context window and Kimi token limit are not the same as every other limit

LimitWhat It ControlsWhat It Does Not Do
Context windowTotal input and output available to the modelDoes not guarantee equal attention to every detail
Completion limitMaximum tokens allowed for the current generated responseDoes not increase the total model context
Rate limitConcurrency, requests, or tokens allowed over a periodDoes not describe the maximum size of one request
File upload limitAccepted file size, count, format, or request-body sizeDoes not guarantee all extracted content fits in context
Membership creditsAmount of paid product usage availableDoes not represent a context-window size
Context cachingCost and processing benefits when a prefix is reusedDoes not expand the published context ceiling
Memory or ProjectsStores or reintroduces useful information between workflowsDoes not create unlimited active model context

For example, a 429 token-rate error can occur even when an individual request fits inside the model window. Conversely, a single oversized request can fail with a context-related 400 error even when the account is below its rate limits.

Kimi output token limits

The Kimi Chat Completions reference defines max_completion_tokens as the maximum number of tokens the current response may generate. The following table concerns direct API models, not Kimi Code’s kimi-for-coding alias.

ModelTotal ContextDocumented Default Completion SettingPlanning Meaning
kimi-k31,048,576131,072Input plus requested completion must remain within 1,048,576
kimi-k2.7-code262,14432,768Leave room for thinking, tools, and the final response
kimi-k2.7-code-highspeed262,14432,768Same context behavior as standard K2.7 Code
kimi-k2.6262,14432,768Thinking mode can use more of the shared context budget

K3 allows max_completion_tokens to be configured as high as 1,048,576, but this is not an additional million tokens on top of the prompt. If the input plus requested completion exceeds the context window, the API returns invalid_request_error.

If generation reaches the configured completion ceiling, the response normally returns finish_reason="length". Increasing the value helps only when unused model context remains.

The general Chat Completions reference marks max_tokens as deprecated in favor of max_completion_tokens. The individual K2.6 and K2.7 Code guides still describe their 32,768-token defaults under max_tokens. Check the selected model’s parameter guide rather than assuming every example uses the same field.

A 1M context window is not a documented 1M output allowance for K2.8 Preview. Do not copy K3’s direct API completion settings into a Kimi Code configuration solely because both routes can have a 1M context.

Token budget lab: calculate a safer working limit

A practical request should reserve space before filling the model with source material.

estimated input tokens
+ reserved completion tokens
+ operational safety margin
≤ model context window

The safety margin is a planning recommendation, not an additional official Kimi restriction. It protects against message wrappers, tool definitions, media-token estimates, reasoning history, and changes introduced by a framework.

Kimi context budget planner showing estimated input, reserved completion, safety margin, and example budgets for K3 and 256K models.
Illustrative context budgets for K3 and 256K models. The safety margin is a planning choice, not an additional platform restriction.
Planning ExampleModel CeilingCompletion Reserve10% Safety MarginApproximate Input Target
Large K3 knowledge project1,048,57665,536104,858About 878,000 tokens
K2.6 or K2.7 Code direct API workflow262,14432,76826,214About 203,000 tokens
K2.6 Chat planning exampleApproximately 131,07216,38413,107About 101,000 tokens

These are conservative examples, not new platform limits. The Chat example is a planning illustration, not a user-configurable output setting. A short classification task may need a smaller response reserve, while a reasoning-heavy report or tool loop may need more headroom.

The same budgeting principle applies to a K2.8 Preview session at its 1M ceiling. Choose a task-appropriate reserve rather than treating the K3 example as a published K2.8 output specification.

Estimate Kimi tokens before sending the request

Kimi provides an official Estimate Tokens endpoint. Its input structure is close to a Chat Completions request, making it more reliable than estimating from pages or words.

curl --request POST \
  --url https://api.moonshot.ai/v1/tokenizers/estimate-token-count \
  --header "Authorization: Bearer $MOONSHOT_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "kimi-k3",
    "messages": [
      {
        "role": "system",
        "content": "Analyze the supplied material and cite the relevant sections."
      },
      {
        "role": "user",
        "content": "Insert the long source material or request here."
      }
    ]
  }'

A successful response includes data.total_tokens. The following count is illustrative; it is not a measured result from running the sample request:

{
  "data": {
    "total_tokens": 80421
  }
}

Use that value in the budget formula:

  1. Confirm the exact model and its context window.
  2. Estimate the complete request, including history and tools.
  3. Subtract the estimated input from the model ceiling.
  4. Subtract an operational safety margin.
  5. Set a completion budget that fits inside the remaining capacity.
  6. Reduce or split the input when the remaining response space is too small.

This token-estimation example uses the direct Open Platform API. Do not replace kimi-k3 with kimi-for-coding or assume it measures a Kimi Code client’s complete internal session. For direct API setup, see how to use the OpenAI-compatible Kimi API.

Why file size does not reveal how much Kimi context it uses

Upload systems measure bytes and file counts. Models process a tokenized representation of the extracted content. A file that uploads successfully can still create too much context for a useful request.

  • PDFs: OCR layers, repeated headers, footers, tables, and scanned pages can expand the processed representation.
  • Spreadsheets: formulas, hidden sheets, repetitive cells, and large ranges can consume substantial context.
  • Code repositories: generated files, dependencies, minified assets, lockfiles, logs, and build output may add tokens without helping the task.
  • Images: token use depends partly on resolution and visual processing.
  • Videos: keyframes, duration, and frame resolution affect token consumption.
  • Multiple files: each file may satisfy the upload rule while their combined extracted content exceeds the model window.

The official K2.6 and K2.7 documentation recommends using the Token Estimation API for multimodal requests because image and video token consumption is calculated dynamically.

What happens when the Kimi context window fills?

SymptomLikely CauseRecommended Action
invalid_request_error on a large requestInput plus requested completion exceeds model contextEstimate tokens, lower the completion reserve, or reduce the input
finish_reason="length"The current completion reached its generation ceilingIncrease it only when unused context remains, or continue in a controlled follow-up
Kimi Chat will not accept more useful contentThe conversation has accumulated approximately its available contextCreate a handoff and start a new conversation
Earlier instructions appear missingHistory was compressed, omitted, or diluted by unrelated contentRestate critical constraints and use a structured summary
Kimi Code compacts after a model switchThe current session exceeds the destination model’s 256K limitRun a manual compact before switching
401 when requesting K3 1M in Kimi CodeThe account lacks the required plan entitlementUse 256K or verify the current membership requirement
429 token-related errorTPM, TPD, concurrency, or quota rather than context sizeInspect the error type before reducing the prompt
K2.8 Preview appears limited to 256K in a coding clientA stale model label or a smaller client-side context settingConfirm kimi-for-coding, update the client, and inspect its configured context limit

For complete error-code handling, use the internal Kimi API errors and troubleshooting guide.

A practical Kimi context-management workflow

  1. Name the surface. Write down whether the task runs in Chat, Code, Deep Research, the Direct API, or another provider.
  2. Verify the Model ID. Do not rely only on the display name shown by an interface.
  3. Confirm the plan or account entitlement. A model may support 1M technically while the current product plan exposes only 256K.
  4. Reserve the response first. Decide whether the workflow needs a brief answer, a detailed report, thinking, or several tool calls.
  5. Estimate the complete request. Include system instructions, history, schemas, files, and tool results.
  6. Remove irrelevant content. Exclude duplicate documents, generated code, old logs, and unrelated conversation turns.
  7. Use stable document boundaries. Label each source and preserve headings so Kimi can locate relevant evidence.
  8. Keep a safety margin. Do not intentionally plan to exactly 100% of the published ceiling.
  9. Compact before a forced switch. Create a deliberate summary before moving from a 1M route to a 256K route.
  10. Start a new session when the task changes. Unrelated topics consume context and can interfere with active instructions.
  11. Keep tool results concise. Return the useful result rather than thousands of raw log lines.
  12. Monitor usage and finish state. Record prompt tokens, completion tokens, model ID, actual model version, client version, test date, and finish_reason where available. An unchanged alias does not guarantee an unchanged underlying model.

Which Kimi model or product should you choose?

WorkloadSuggested Starting PointContext Reason
Large API knowledge base or repositoryKimi K3Current Direct API option with a 1M ceiling
Direct API coding task within 256KKimi K2.7 CodeCoding-specialized context without using the full K3 window
General multimodal API task within 256KKimi K2.6Text, image, and video support with optional thinking
Routine Kimi Code editsk3-256kFixed 256K; lower documented quota use than the 1M K3 route
Repository-scale Kimi Code sessionkimi-for-coding (K2.8 Preview) or k3 with eligible 1M accessUp to 1M for K2.8 Preview; K3 remains plan-dependent
Very long consumer conversationK3 Extra-Long Chat on an eligible planConsumer Chat capacity of up to 1M
Focused sourced research taskKimi Deep ResearchSeparate 128K research workflow
Historical K2 reproductionMatching open-weight checkpointUse that checkpoint’s documented 128K or 256K limit

The largest available context is not automatically the best option. A focused request can be easier to validate and require less processing than an unstructured one-million-token prompt. Use the additional capacity in K3 or K2.8 Preview when the source material genuinely requires it, not simply because it is available.

Frequently asked questions

What is the Kimi context window?

The Kimi context window is the maximum combined token capacity available to a model for the current request or conversation state. It includes supplied input and generated output. The number depends on the model and product surface.

How many tokens can Kimi K3 process?

Kimi K3 supports a maximum context of 1,048,576 tokens through the Direct API. Full 1M access in Kimi Chat or Kimi Code can depend on the product and membership plan.

What is the Kimi K2.8 Preview context window?

K2.8 Preview supports up to 1,048,576 tokens through Kimi Code’s kimi-for-coding ID. The Kimi Code overview lists this route as available to all Kimi Code members. A coding client’s own configuration can still impose a smaller usable limit.

Did the kimi-for-coding model ID change?

No. Kimi upgraded the existing ID in place to K2.8 Preview. Older guides that label it K2.7 Code with 256K describe its previous configuration. The direct API model kimi-k2.7-code is separate.

What is the Kimi K2.7 Code context window?

Through the direct API, kimi-k2.7-code and kimi-k2.7-code-highspeed both support 262,144 tokens. Kimi Code’s kimi-for-coding-highspeed also remains K2.7 Code HighSpeed at 256K. The standard Code ID kimi-for-coding instead runs K2.8 Preview at up to 1M.

Why is Kimi K2.6 listed as both 128K and 256K?

The Direct K2.6 API model supports 256K. The consumer Kimi Chat Help Center currently describes a K2.6 single-conversation context of approximately 128K. The numbers refer to different product surfaces.

Does Kimi support a 2M-token context window?

The official direct API catalog reviewed for this guide lists K3 at 1M and K2.7 Code and K2.6 at 256K. Kimi Code lists K2.8 Preview at up to 1M. Neither catalog establishes a 2M-token limit for these routes. Check the unit, model, product, and date behind any “2 million” claim.

Does output count toward the Kimi token limit?

Yes. Input and generated output share the model context. If the supplied input plus requested max_completion_tokens exceeds the model window, the Direct API returns an invalid-request error.

Can Kimi K3 produce a one-million-token answer?

The API permits a high completion ceiling, but the response must share the 1,048,576-token context with the input. A large prompt leaves less room for output, and the model may finish naturally before reaching the configured maximum.

Does context caching increase the context window?

No. Caching can reduce the cost and repeated processing associated with an unchanged prefix, but the cached content still occupies space inside the model’s published context window.

Why does my coding tool show only 256K for K3 or K2.8?

For K3, check whether the selected ID is k3-256k, the plan limits k3 to 256K, or the client has a smaller configured window. For K2.8 Preview, confirm kimi-for-coding and check for an outdated 256K client setting. The K3-specific plan restriction should not be applied to K2.8.

What should I do when a Kimi conversation becomes too long?

Create a structured handoff containing the objective, decisions, constraints, important evidence, unresolved questions, and next actions. Start a new conversation with the handoff and only the files needed for the next stage.

Official sources and update methodology

This guide’s documentation review was updated on September 13, 2026. Direct API limits were checked against the model catalog, model guides, and API reference. Kimi Code changes were checked separately against its model configuration, release notice, and session documentation. Consumer Chat and Deep Research limits were checked against their Help Center pages.

The token-budget calculations and sample token count are illustrative, not measured maximum-capacity tests. The retained API screenshot keeps its original September 8, 2026 capture date.

Context windows, plan entitlements, Model IDs, and product behavior can change. Recheck the official model and product documentation before configuring a production workflow.

Related resources: compare the direct Kimi API models, review Kimi membership plans, configure the OpenAI-compatible Kimi API, or troubleshoot failures with the Kimi API errors guide.

Mohamed Hossam El-Din
Mohamed Hossam El-Din

Mohamed Hossam El-Din is a content editor at Thinkly for Digital Business, responsible for kimi-ai.free. He is a social work student at Helwan University, and he came to Kimi the way most of its users do: with long PDFs to read, research to gather, and reports to write. That is the angle he writes from — long-context work, document analysis, and research, tested on a live account before it is written about. He writes in English and Arabic. Every feature covered here was used first; error messages published on this site are errors that actually appeared. When a claim cannot be verified against Moonshot AI's official documentation, the article says so.

Articles: 49