Kimi K2.7 Code is Now Available in Microsoft Foundry Microsoft and Moonshot AI have made the Kimi K2.7 Code model available in the Microsoft Foundry model catalog starting July 1, 2026. The coding-focused model, priced at $0.95 input and $4.00 output per million tokens, features a 256K context window and shows competitive performance on agentic coding benchmarks, including beating Claude Opus 4.8 on MCP Mark Verified. A developer provided a .NET console app example using the Azure AI Inference SDK to call the model. There are a lot of AI model announcements these days. But every now and then one lands that feels immediately practical for real engineering work. Kimi K2.7 Code from Moonshot AI showing up in Microsoft Foundry feels like one of those releases. Microsoft and Moonshot AI have made Kimi K2.7 Code available in the Foundry model catalog starting July 1, 2026. It is designed for the kind of software engineering that does not happen in a single prompt — multi-file refactors, feature work spanning multiple services, debugging sessions that need to hold context across many steps. That is a different problem space from "generate a todo app in one shot." And honestly, that is where most development teams are today. Kimi K2.7 Code is a coding-focused model from Moonshot AI. It builds on the K2.6 series with three focused improvements: The 256K context window is the other number worth noting. Large codebases, long refactoring sessions, multiple files in context at once — that is the use case this model is optimized for. Here is how K2.7 Code stacks up against K2.6 and two frontier models: | Benchmark | Kimi K2.6 | Kimi K2.7 Code | GPT-5.5 | Claude Opus 4.8 | |---|---|---|---|---| | Kimi Code Bench v2 | 50.9 | 62.0 | 69.0 | 67.4 | | Program Bench | 48.3 | 53.6 | 69.1 | 63.8 | | MLS Bench Lite | 26.7 | 35.1 | 35.5 | 42.8 | | MCP Atlas | 69.4 | 76.0 | 79.4 | 81.3 | MCP Mark Verified | 72.8 | 81.1 | 92.9 | 76.4 | A few things worth flagging: The Kimi Code Bench numbers are Moonshot AI's own benchmark — take those as directional. MCP Mark Verified is human-verified and more credible for independent comparison. On that benchmark, K2.7 Code at 81.1 actually beats Claude Opus 4.8 at 76.4. That is the benchmark most relevant to agentic coding workflows with tool use. On pure coding tasks Program Bench, MLS Bench Lite , it sits between GPT-5.5 and Claude Opus 4.8. That is a reasonable position for a model priced at $0.95 input / $4.00 output per million tokens. | Input / 1M tokens | Output / 1M tokens | Cached Input | | |---|---|---|---| | Kimi K2.7 Code | $0.95 | $4.00 | $0.19 | At $0.95 input, this sits below GPT-4o-class pricing. For long-running coding tasks that consume a lot of output tokens, $4.00/M output is the number to watch. Cached input at $0.19 helps when you are repeatedly loading the same large codebase context. If you are evaluating this model, here is where it fits: That is a pretty specific profile. This is not a general-purpose chatbot. It is a model built for developer tooling and autonomous coding agents. Here is a working .NET console app that calls Kimi K2.7 Code through Azure AI Foundry. I am using the Azure AI Inference SDK and DefaultAzureCredential — no API key hardcoded. Code also located at Github| https://github.com/taswar/KimiFoundryDemo https://github.com/taswar/KimiFoundryDemo dotnet new console -n KimiFoundryDemo cd KimiFoundryDemo dotnet add package Azure.AI.Inference --prerelease dotnet add package Azure.Identity Set your environment variables: On Windows PowerShell $env:AZURE AI CHAT ENDPOINT="https://YOURRESOURCE.services.ai.azure.com/models" az login $env:AZURE AI MODEL = "kimi-k2-7-code" using Azure.Identity; using Azure; using Azure.AI.Inference; using Azure.Core; var endpoint = Environment.GetEnvironmentVariable "AZURE AI CHAT ENDPOINT" ?? throw new InvalidOperationException "Set AZURE AI CHAT ENDPOINT environment variable." ; var model = Environment.GetEnvironmentVariable "AZURE AI MODEL" ?? "Kimi-K2.7-Code"; // DefaultAzureCredential handles Entra ID auth — no API key in code. // Sign in first with: az login var credential = new DefaultAzureCredential new DefaultAzureCredentialOptions { ExcludeManagedIdentityCredential = true } ; // Foundry Cognitive Services endpoints require a token whose audience is // https://cognitiveservices.azure.com. Force that scope regardless of the // scope the Azure.AI.Inference SDK requests by default. var scopedCredential = new ScopeOverrideCredential credential, "https://cognitiveservices.azure.com/.default" ; var client = new ChatCompletionsClient new Uri endpoint , scopedCredential ; var options = new ChatCompletionsOptions { Model = model, Temperature = 0.2f, MaxTokens = 2000 }; options.Messages.Add new ChatRequestSystemMessage """ You are a senior .NET architect. Your job is to review code and identify issues clearly and concisely. Be direct. Prioritize correctness over style. Return findings as a numbered list with severity: critical, warning, or info. """ ; options.Messages.Add new ChatRequestUserMessage """ Review the following C method and identify any issues: public async Task GetUserAsync int userId { var user = await dbContext.Users .Where u = u.Id == userId .FirstOrDefault ; return user; } """ ; Console.WriteLine $"Calling model: {model}" ; Console.WriteLine "---" ; Response