Kimi K2.7-Code API
Model ID: kimi-k2.7-code
Coding and tool workflows with text, image, and video understanding in a 256K context.
Coding · Reasoning ·
Capabilities
- Context window
- 262,144 tokens
- Output budget
- Route-specific; default completion budget is 32,768 tokens
- Coding assistance
- Document analysis
- Tool workflows
- reasoning
- streaming
- function_calling
- caching
- structured_output
- vision
API pricing
- Input
- $0.76 USD per 1M tokens
- Output
- $3.2 USD per 1M tokens
- Cached input
- $0.15200000000000002 USD per 1M tokens
Model introduction
Coding and tool workflows with text, image, and video understanding in a 256K context. Start with text code and test output. For multi-step tool use, keep complete assistant messages, including reasoning and tool calls. The official model accepts tool_choice auto or none; do not assume forced tool selection works.
Specifications and limits
Thinking cannot be disabled. Leave sampling parameters at their defaults: temperature 1, top_p 0.95, n 1, and zero presence/frequency penalties. The default output budget is not a maximum.
Getting started
Create a BulkToken API key
Create a key in API Keys and save it as BULKTOKEN_API_KEY on your server.
Configure the client
Use https://bulktoken.ai/v1 and model ID kimi-k2.7-code.
Send your first request
Call POST /v1/chat/completions. Start with text input and review actual usage in Usage Logs.
FAQ
Which model ID should I use?
Use kimi-k2.7-code exactly. The model must be published and available to your API key.
How is usage priced?
BulkToken charges 80% of the official reference rates (20% off). See the model pricing for applicable token categories.
Code examples
See [the Kimi K2.7-Code integration guide](/docs/kimi-k2.7-code) for Python, Node.js, and cURL examples. Install openai for the Python example.
Python
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["BULKTOKEN_API_KEY"], base_url="https://bulktoken.ai/v1")
stream = client.chat.completions.create(
model="kimi-k2.7-code",
messages=[{"role": "user", "content": "Explain a hash table in one sentence."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
cURL
curl https://bulktoken.ai/v1/chat/completions \
-H "Authorization: Bearer $BULKTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "kimi-k2.7-code", "messages": [{"role": "user", "content": "Hello!"}], "stream": true}'