Text Models / Kimi

Kimi localized example text## Basic Information

  • Base URL:https://mm-internal-cn.leonecloud.com
  • endpointPath:POST https://mm-internal-cn.leonecloud.com/v1/chat/completions
  • Authentication:Authorization: Bearer <API_KEY>
  • Content-Type:application/json
  • -:OpenAI Chat Completions, can OpenAI SDK or number SDK, onlybase_url andapi_key.

Kimi OpenAI Chat Completions, Request Body and field and consistent, not OptionalParameterfieldlocalized example text.

Description

  • with endpoint use Bearer Token (API Key), in Request:```
  • Authorization: Bearer <API_KEY>

- API Key in「API localized example text」create, in create when「Model」Capabilityafter can endpoint.
- use not ModelCapability Key, will return`403`:

 ```json

{
"error": {
"message": "API Key not LLM Capability, in create API Key complete",
"type": "permission_error"
}
}


## supported Model

Request Body in the`model` fieldas「ModelParameter」, can Model.

| Model | ModelParameter (model) |
| ---- | ---- |
| Kimi K3 | kimi-k3 |
| Kimi K2.7 Code Highspeed | kimi-k2.7-code-highspeed |
| Kimi K2.7 Code | kimi-k2.7-code |
| Kimi K2.6 | kimi-k2.6 |
| Kimi K2.5 | kimi-k2.5 |

> can Model as.Model, and「Modellocalized example text」「localized example text」as, encodedModel.

## Method

Modelendpoint OpenAI, Request Body and field and consistent, not OptionalParameterfield.with OpenAI, Request, API Key, can.

- endpointPath:`POST https://mm-internal-cn.leonecloud.com/v1/chat/completions`

### cURL

```bash

curl -X POST "https://mm-internal-cn.leonecloud.com/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "kimi-k3",
"messages": [
{"role": "user", "content": "localized example text."}
]
}'


### Request Body ()```json
{
 "model": "kimi-k3",
 "stream": true,
 "messages": [
 {
 "role": "system",
 "content": [
 {"type": "text", "text": "localized example text."}
 ]
 },
 {
 "role": "user",
 "content": [
 {"type": "text", "text": "localized example text."}
 ]
 }
 ]
}

Python (OpenAI SDK)

from openai import OpenAI

client = OpenAI(
 base_url="https://mm-internal-cn.leonecloud.com/v1",
 api_key="<API_KEY>",
)

resp = client.chat.completions.create(
 model="kimi-k3",
 messages=[{"role": "user", "content": "localized example text"}],
 stream=True,
)
for chunk in resp:
 print(chunk.choices[0].delta.content or "", end="", flush=True)

Request Parameters

as Parameter, OpenAI.not OptionalParameter will field.

ParameterTypeRequiredDescription
modelstringYesModelParameter, localized example text「supported Model」.
messagesarrayYeslist,role (system/user/assistant)andcontent.
streambooleanNoreturn, defaultfalse.astrue when SSE.
temperaturenumberNolocalized example text.
top_pnumberNolocalized example text.
max_tokensintNomaximum token.
stopstring / arrayNolocalized example text.

Request Body instream astrue, localized example textServer-Sent Events (SSE), datadata: , afterdata: [DONE] localized example text.

data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","choices":[{"delta":{"content":"localized example text"},"index":0}]}

data: {"id":"chatcmpl-xxx","object":"chat.completion.chunk","choices":[{"delta":{"content":"localized example text"},"index":0}]}

data: [DONE]

Billing

  • Modeltoken localized example text, Usually input / output, Model with, (thinking), image etc., Model.
  • Model and,「localized example text」as.
  • token in theusage fieldas;, and can in「localized example text」「localized example text」, and supported.
  • Model in in, first ( can「Balance API」query ).

Error CodesDescription

Status CodeDescriptionlocalized example text
401not / API Key nolocalized example textAuthorization and API Key
403API Key not ModelCapabilityin create and ModelCapability API Key
429orafter; Technical Support
666Model(Error Codes)in thecode_reason Technical Support
5xxlocalized example textafter or Technical Support

ModelHTTP Status Code666 return,:```json
{
"code": 9000,
"code_msg": "localized example text",
"code_reason": ", when field provide"
}


Error Format, OpenAI:```json
{
 "error": {
 "message": "invalid api key",
 "type": "invalid_request_error",
 "code": "401"
 }
}

Note1. localized example text:endpointOpenAI, can use OpenAI or SDK, onlybase_url andapi_key. 2. Modelas:first in「Modellocalized example text」first can use Model name, encoded. 3. Capability:first API Key「Model」Capability. 4. and:tokenusage; and「localized example text」「localized example text」localized example text.

Updated 2026-09-29