LLMmoonshotai

MoonshotAI: Kimi K2.7 Code

MoonshotAI: Kimi K2.7 Code is a coding-focused model in Moonshot AI's Kimi K2 family, built to complete end-to-end programming tasks reliably over long contexts. It uses a native multimodal mixture-of-experts...

Anyone in the Project can @-mention MoonshotAI: Kimi K2.7 Code with the team's shared context - pooled credits, one chat, one memory.

All models

Starter is free forever - 1 Project, 100 credits/month, 1 MCP. No card.

Verdict

Kimi K2.7 Code is a specialized coding model from MoonshotAI with a 262K token context window and competitive pricing at $0.66 input per Mtok. It handles long codebases and multi-file refactoring tasks well, though public benchmark data remains sparse. The model supports both text and image inputs, useful for debugging screenshots or architecture diagrams. Reach for this when you need extended context for code analysis at a lower price point than GPT-4 class models, but verify performance on your specific language stack before committing to production workflows.

Best for

  • Multi-file codebase analysis and refactoring
  • Cost-sensitive code generation tasks
  • Debugging with screenshot context
  • Long-context code documentation review
  • Architecture diagram interpretation

Strengths

The 262K context window handles entire repositories or lengthy API documentation in a single pass, reducing the need for chunking strategies. Input pricing at $0.66 per Mtok undercuts many Western alternatives while maintaining code-focused training. Vision support adds practical utility for interpreting error screenshots, UI mockups, or system architecture diagrams during development workflows. The model processes both implementation and visual context without switching tools.

Trade-offs

Public benchmark data is essentially nonexistent, making it difficult to assess performance against established models like GPT-4o or Claude Sonnet on standard coding tasks. The $3.30 output pricing is higher than input, which penalizes verbose code generation. Without published results on HumanEval, MBPP, or SWE-bench, teams must run their own evaluations before trusting it for production code. Language-specific performance across Python, JavaScript, Rust, or Go remains unverified in public datasets.

Specifications

Provider
moonshotai
Category
llm
Context length
262,144 tokens
Max output
235,929 tokens
Modalities
text, image
License
proprietary
Released
2026-06-12

Pricing

Input
$0.67/Mtok
Output
$3.35/Mtok
Model ID
moonshotai/kimi-k2.7-code

Per-token prices show what the model costs upstream. On Switchy your team draws from one shared org credit pool - one plan, one balance for everyone.

Team cost calculator

Estimated monthly spend
$25.96
17.6M tokens / month
5 seats · 80 msgs/day

Switchy meters this against your org's shared credit pool - one plan, one balance for everyone.

Providers

ProviderContextInputOutputP50 latencyThroughput30d uptime
moonshotai262k$0.67/Mtok$3.35/Mtok———

Performance

Performance snapshots are collected daily. Check back after the next ingestion run.

Benchmarks

Public benchmark scores are not available yet for this model. Check back after the next ingestion run.

Works well with

Top MCPs

Compatibility data comes from first-party telemetry; once we have enough co-usage signal, top MCPs for this model will appear here.

How Switchy teams use it

Not enough Projects have used this model yet to share anonymised team stats. We wait for at least 50 distinct Projects per week before publishing any aggregate.

Starter prompts

Refactor Legacy Module

Review this legacy authentication module across all files. Identify security vulnerabilities, suggest modern patterns, and propose a refactoring plan that maintains backward compatibility.

Debug from Screenshot

Analyze this error screenshot from my terminal. Explain what's failing, trace the likely root cause in the codebase, and provide a fix with explanation.

Document API Endpoints

Generate OpenAPI documentation for all endpoints in this codebase. Include request/response schemas, error codes, and usage examples for each route.

Explain Architecture Diagram

Examine this system architecture diagram. Explain each component's role, identify potential bottlenecks, and recommend implementation technologies for each service.

Cross-File Dependency Analysis

Analyze all import statements across this repository. Map the dependency graph, flag circular dependencies, and suggest restructuring to improve modularity.

Example outputs

Illustrative - representative of the model's voice and quality, not literal recordings.

Prompt

Refactor this Python function to use list comprehension and type hints. It currently loops through a dict to build a filtered list of active users with valid emails.

Output

The refactored version would replace the explicit for-loop with a concise list comprehension, add proper type annotations (Dict[str, Any] for input, List[Dict[str, Any]] for output), and potentially extract the validation logic into a separate predicate function for clarity. The comprehension would filter in a single pass: `[user for user in users.values() if user.get('active') and '@' in user.get('email', '')]`. Type hints improve IDE support and catch errors early, while the comprehension reduces boilerplate without sacrificing readability.

Notes

This example highlights Kimi K2.7 Code's strength in Python idiom transformation and type safety. The 262K token context window means it can handle the surrounding module context to suggest imports and ensure consistency. However, without public benchmarks, we can't compare its refactoring quality against models like Claude or GPT-4 on standardized code tasks.

Prompt

Find the bug in this React component. Users report the modal doesn't close when clicking the backdrop, but the close button works fine. Include the event handler code.

Output

The bug is likely in the backdrop's onClick handler—it's probably missing `event.stopPropagation()` or checking `event.target === event.currentTarget`. If the handler closes on any click within the modal container, clicks on child elements bubble up and trigger closure. The fix: `onClick={(e) => { if (e.target === e.currentTarget) onClose(); }}` ensures only direct backdrop clicks close the modal, not clicks on modal content. This is a classic event delegation issue in React portals.

Notes

Demonstrates Kimi's ability to diagnose UI interaction bugs from a natural-language description. The model can reason about event propagation in React's synthetic event system. At $3.30/Mtok output, extended debugging sessions with large component trees could get expensive compared to cheaper alternatives, though the massive context window helps ingest entire component hierarchies.

Prompt

Explain how this SQL query works and why it's slow. The query joins three tables (orders, customers, line_items) and filters by date range, but takes 8 seconds on 2M rows.

Output

The query performs a three-way join without leveraging indexes effectively. The date filter on `orders.created_at` likely runs after the join, forcing the database to materialize the full Cartesian product first. The slowness comes from scanning `line_items` (typically the largest table in e-commerce schemas) without an index on `order_id`. To fix: add a composite index on `(created_at, customer_id)` in orders, ensure `line_items.order_id` is indexed, and rewrite to filter orders by date before joining. This reduces the join input set from millions to thousands.

Notes

Shows Kimi's strength in explaining performance bottlenecks across database operations. The model connects query structure to execution plans—useful for code review. The image modality support means you could paste an EXPLAIN ANALYZE screenshot, though text-based query analysis is more common. Without benchmarks, we can't verify accuracy against known slow-query datasets.

Use-case deep-dives

Multi-file refactoring sessions

When 262K context lets you refactor without losing thread

A 4-person dev shop maintaining a legacy Rails monolith needs to rename a core domain concept across 80 files without breaking tests. Kimi K2.7 Code's 262,144-token window holds the entire module tree in one session—you paste the file structure, the model maps dependencies, then generates a refactor plan with file-by-file diffs. At $0.66/Mtok input, loading 200K tokens costs $0.13; the output plan runs $3.30/Mtok but stays under 20K tokens ($0.07). Total cost per refactor: roughly $0.20. The trade-off: no public benchmarks mean you're trusting vendor claims on code accuracy. If your refactor touches money or auth logic, pair this with human review or switch to a model with published HumanEval scores.

Technical documentation generation

Turning codebases into onboarding docs at $0.20 per repo

A 10-person SaaS team onboards two engineers per quarter and burns 8 hours per hire explaining the same microservices architecture. They dump 150K tokens of TypeScript, API specs, and deployment configs into Kimi K2.7 Code once, then prompt for a 5,000-word onboarding guide with architecture diagrams described in Mermaid syntax. Input cost: $0.10. Output cost (assuming 7K tokens): $0.02. The model's image-understanding mode can also ingest existing architecture PNGs to cross-check descriptions. The boundary: if your docs need to cite specific GitHub issues or Slack threads outside the code, the 262K window won't help—you'd need RAG or a smaller model with tool-use. For pure code-to-prose, this is the cheapest long-context play.

Compliance audit scripting

When legal needs to grep 50 contracts in one prompt

A 3-person legal ops team at a fintech reviews vendor contracts quarterly to flag non-standard liability clauses. They paste 40 PDFs (OCR'd to text, totaling 180K tokens) into Kimi K2.7 Code and ask for a CSV of clause locations plus risk scores. The model's image mode handles scanned signature pages; the text mode parses legalese. At $0.66/Mtok input, the 180K load costs $0.12. Output (a 2K-token CSV) costs $0.01. Run this 4 times per year: $0.52 total. The catch: no benchmark data means you can't verify its clause-extraction accuracy against LegalBench or similar. If a missed clause costs more than $10K in liability, use a model with published legal-reasoning scores or add human spot-checks to the first 3 runs.

Frequently asked

Is Kimi K2.7 Code good for programming tasks?

Yes, the model is purpose-built for code generation and debugging. With a 262k token context window, it can handle entire codebases in a single prompt. The pricing at $0.66 input and $3.30 output per million tokens makes it viable for production use, though no public benchmarks exist yet to compare it against GPT-4o or Claude Sonnet for code quality.

Is Kimi K2.7 Code cheaper than GPT-4o for coding?

Yes, significantly. GPT-4o costs $2.50 input and $10.00 output per million tokens, making Kimi roughly 74% cheaper on input and 67% cheaper on output. For high-volume code generation or refactoring tasks where you're processing large files repeatedly, the savings compound quickly. The trade-off is less proven performance data.

Can Kimi K2.7 Code handle full repository analysis?

The 262k token context window theoretically allows it, but in practice you'll hit limits around 50-80k lines of code depending on verbosity. That's enough for most microservices or medium-sized modules. For monorepo analysis, you'll need to chunk strategically. The image input capability lets you include architecture diagrams or screenshots alongside code.

How does Kimi K2.7 Code compare to previous Kimi models?

MoonshotAI hasn't published detailed version comparisons yet. The K2.7 designation suggests iterative improvements over earlier releases, but without benchmark data we can't quantify gains in code completion accuracy, bug detection, or reasoning depth. If you're already using an earlier Kimi model, test both on your actual codebase before migrating.

Should I use Kimi K2.7 Code for real-time code completion?

Probably not. The $3.30 per million token output cost adds up fast in autocomplete scenarios where you're generating suggestions every few keystrokes. Use it for batch tasks like PR reviews, documentation generation, or refactoring entire files. For IDE autocomplete, stick with faster, cheaper models like GPT-3.5 Turbo or Codestral.

Compare with

More language models

See all language models →

Data last verified 13 hours ago.Sources aggregated hourly to weekly. See docs/architecture/model-directory.md.