基礎 URL、請求方法與必要請求頭,皆依當前模型的協議模板渲染。

Kimi K2.7 Code
Coding-focused variant in the Kimi K2 family. Accepts text and image inputs, with reasoning on by default. Suited for long-horizon coding and agentic workflows.
價格
| 規格 | 價格 |
|---|---|
| 輸入 | $0.95/ M tokens |
| 輸出 | $4/ M tokens |
| 快取讀 | $0.19/ M tokens |
| 快取寫 | $1.1174/ M tokens |
快速開始
可直接貼上執行下方範例程式碼。Gate.AI API 與 OpenAI 相容,多數 SDK 只需替換 base URL;切換模型時,只需修改模型 ID。
Get your API key
Sign in to the Gate.AI console and create a new key under "API Keys". Keep it safe and send it via the Authorization header on every request.
前往控制台建立金鑰Make a request
Send a POST request to the Chat Completions endpoint with a model ID and an array of messages to get a reply.
curl --location "https://api.gate.ai/openai/v1/chat/completions" \
--header "Authorization: Bearer {API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"model": "kimi-k2.7-code",
"messages": [
{"role": "user", "content": "Hello"}
]
}'Handle the response \\\\\& streaming
By default a full JSON response is returned. Add "stream": true to the request body to receive incremental chunks over SSE.
curl --no-buffer --location "https://api.gate.ai/openai/v1/chat/completions" \
--header "Authorization: Bearer {API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"model": "kimi-k2.7-code",
"messages": [
{"role": "user", "content": "Hello"}
],
"stream": true
}'端點
相關模型
Kimi K3.1 ProSuccessor to K3 and flagship open-weight multimodal reasoning model for long-horizon coding and agentic knowledge work, with native image and video understanding.
Kimi K3A multimodal reasoning model for complex coding, knowledge work, and long-running agent tasks. It works across large codebases, calls tools, and debugs, using images, logs, and test output to refine its output.
Kimi K2.6Latest multimodal model in the K2 series, built for long-horizon coding, code-driven UI/UX generation, and multi-agent orchestration.
Kimi K2.5頂級中英雙語模型,強大的長上下文能力。
Kimi K2 ThinkingOpen-source thinking model built for long-horizon reasoning and hundreds of sequential tool calls across autonomous research, coding, and agent workflows.
Kimi K2 InstructInstruction-tuned for agent workflows with reliable tool calling and multilingual coding.