---
title: MoonshotAI: Kimi K2.7 Code API | Text Generation | ModelsLab
description: Build with MoonshotAI: Kimi K2.7 Code API by Moonshotai. Text generation, chat, code, and reasoning. Pay-per-use. Free tier.
url: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/moonshotai/moonshotai-kimi-k2.7-code.md
canonical: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/moonshotai/moonshotai-kimi-k2.7-code.md
type: product
component: Playground/LLM/Index
generated_at: 2026-06-30T00:03:27.888175Z
---

MoonshotAI: Kimi K2.7 Code
---

 [LLMs.txt](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/moonshotai-kimi-k2.7-code/llms.txt) [.md](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/moonshotai/moonshotai-kimi-k2.7-code.md)

MoonshotAI: Kimi K2.7 Code
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

Send

### MoonshotAI: Kimi K2.7 Code

moonshotai moonshotai-kimi-k2.7-code

Copy model ID

PricingInput $0.74 / 1M tokens

Output $3.50 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens1000

Top P0.9

Frequency Penalty0

Presence Penalty0

Model Info

Support

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster)

[#### open\_router/Google: Gemini 2.5 Flash

google-gemini-2.5-flash

From $1.40/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemini-2.5-flash)

[#### open\_router/Mistral: Ministral 3 8B 2512

mistralai-ministral-8b-2512

From $0.15/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-ministral-8b-2512)

[#### mistral\_ai/Mistral (7B) Instruct

mistralai-Mistral-7B-Instruct-v0.1

From $0.20/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/mistral_ai/mistralai-Mistral-7B-Instruct-v0.1)

[#### open\_router/Qwen: Qwen3 8B

qwen-qwen3-8b

From $0.23/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-8b)

[#### openai/GPT 5.2

gpt-5.2

From $7.88/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/openai/gpt-5.2)

[#### open\_router/OpenAI: GPT-4o (2024-08-06)

openai-gpt-4o-2024-08-06

From $6.25/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/openai-gpt-4o-2024-08-06)

[#### open\_router/Mistral: Mistral Medium 3

mistralai-mistral-medium-3

From $1.20/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-mistral-medium-3)

[#### open\_router/OpenAI: GPT-4o-mini

openai-gpt-4o-mini

From $0.38/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/openai-gpt-4o-mini)

[#### open\_router/MiniMax: MiniMax M3

minimax-minimax-m3

From $0.75/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/minimax-minimax-m3)

[#### open\_router/Qwen: Qwen3.7 Plus

qwen-qwen3.7-plus

From $0.80/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3.7-plus)

[#### open\_router/Meta: Llama Guard 4 12B

meta-llama-llama-guard-4-12b

From $0.18/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/meta-llama-llama-guard-4-12b)

[#### open\_router/DeepSeek: DeepSeek V4 Pro

deepseek-deepseek-v4-pro

From $0.65/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/deepseek-deepseek-v4-pro)

[#### open\_router/Mistral: Saba

mistralai-mistral-saba

From $0.40/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-mistral-saba)

[#### together\_ai/LFM2-24B-A2B

LiquidAI-LFM2-24B-A2B

From $0.07/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/LiquidAI-LFM2-24B-A2B)

[#### open\_router/Arcee AI: Trinity Large Thinking

arcee-ai-trinity-large-thinking

From $0.53/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/arcee-ai-trinity-large-thinking)

[#### open\_router/ReMM SLERP 13B

undi95-remm-slerp-l2-13b

From $0.55/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/undi95-remm-slerp-l2-13b)

[#### open\_router/Amazon: Nova Premier 1.0

amazon-nova-premier-v1

From $7.50/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/amazon-nova-premier-v1)

[#### deepseek/DeepSeek-R1

deepseek-ai-DeepSeek-R1-Distill-Llama-70B

From $2.00/M tokens](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/deepseek/deepseek-ai-DeepSeek-R1-Distill-Llama-70B)

Open Source Alternatives
---

Explore open-source models that offer similar capabilities with full transparency and flexibility

 [View all open source models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llm&provider=open-source-models)

[MU

Popular](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/modelslab/uncensored-chat)[ModelsLab](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/modelslab)

 [Modelslab: Uncensored Chat

Open Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/modelslab/uncensored-chat)

About 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...

### Technical Specifications

Model IDmoonshotai-kimi-k2.7-code

CategoryLLM Models

TaskText Generation

Price$2.12 per million tokens

AddedJune 12, 2026

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate MoonshotAI: Kimi K2.7 Code into your application with a single API call. Get your API key from the [pricing page](https://modelslab-frontend-v2-927501783998.us-east4.run.app/pricing) to get started.

PythonJavaScriptcURLPHP

```
<code>import requests
import json

url = "https://modelslab.com/api/v7/llm/chat/completions"

headers = {
    "Content-Type": "application/json"
}

data = {
        "model_id": "moonshotai-kimi-k2.7-code",
        "messages": [
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
        "max_tokens": 1000,
        "key": "YOUR_API_KEY"
    }

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    result = response.json()
    print("API Response:")
    print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except Exception as err:
    print(f"Other error occurred: {err}")</code>
```

### Pricing

MoonshotAI: Kimi K2.7 Code API costs $2.120000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab-frontend-v2-927501783998.us-east4.run.app/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

[Browse LLM Models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster) [More from Moonshotai](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router) [View Pricing](https://modelslab-frontend-v2-927501783998.us-east4.run.app/pricing)

MoonshotAI: Kimi K2.7 Code FAQ
---

### What is 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...

### How do I use the MoonshotAI: Kimi K2.7 Code API?

You can integrate MoonshotAI: Kimi K2.7 Code into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "moonshotai-kimi-k2.7-code" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does MoonshotAI: Kimi K2.7 Code cost?

MoonshotAI: Kimi K2.7 Code costs $2.120000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the MoonshotAI: Kimi K2.7 Code model ID?

The model ID for MoonshotAI: Kimi K2.7 Code is "moonshotai-kimi-k2.7-code". Use this ID in your API requests to specify this model.

### Does MoonshotAI: Kimi K2.7 Code have a free tier?

Yes, ModelsLab offers a free tier that lets you try MoonshotAI: Kimi K2.7 Code and other AI models. Sign up to get free API credits and start building immediately.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-06-30*