Kimi (Moonshot) Chat
Moonshot Kimi series models, called via the OpenAI-compatible format.
Endpoint
POST $URL/v1/chat/completionsSupported Models
| Model | Positioning |
|---|---|
kimi-k3 | Latest generation Kimi model, excellent long context and Chinese understanding |
Request Example
bash
curl $URL/v1/chat/completions \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3",
"messages": [
{"role": "user", "content": "Summarize the key points of this paragraph: ..."}
]
}'python
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="$URL/v1")
resp = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Summarize the key points of this paragraph: ..."}],
)
print(resp.choices[0].message.content)ts
import OpenAI from 'openai'
const client = new OpenAI({
apiKey: process.env.YOUR_API_KEY,
baseURL: '$URL/v1',
})
const resp = await client.chat.completions.create({
model: 'kimi-k3',
messages: [{ role: 'user', content: 'Summarize the key points of this paragraph: ...' }],
})
console.log(resp.choices[0].message.content)Notes
- Kimi models are fully compatible with the OpenAI format; switching models only requires changing the
modelfield. - Particularly good at long-document reading comprehension, Chinese writing and summarization tasks.
