> ## Documentation Index
> Fetch the complete documentation index at: https://docs.token.poryf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kimi

> 月之暗面的 Kimi 系列：可用型号、调用示例与计费方式。

月之暗面的 Kimi 系列，偏长程编程与知识工作。

* 接口：`POST https://token.poryf.com/v1/chat/completions`（OpenAI 格式），字段说明见 [创建对话](/api/chat)
* 在线试用需要登录，按自己的余额扣费

## 可用型号

| 模型 ID | 说明 | 链接 |
| - | - | - |
| `kimi-k3` | 最新旗舰 | [价格](https://token.poryf.com/pricing/kimi-k3) · [试用](https://token.poryf.com/model-guide/kimi-k3) |
| `kimi-k2.7-code` | 面向编程场景 | [价格](https://token.poryf.com/pricing/kimi-k2.7-code) · [试用](https://token.poryf.com/model-guide/kimi-k2.7-code) |
| `kimi-k2.7-code-highspeed` | k2.7-code 高速版，单价为其 2 倍 | [价格](https://token.poryf.com/pricing/kimi-k2.7-code-highspeed) · [试用](https://token.poryf.com/model-guide/kimi-k2.7-code-highspeed) |
| `kimi-k2.6` | 上一代通用版 | [价格](https://token.poryf.com/pricing/kimi-k2.6) · [试用](https://token.poryf.com/model-guide/kimi-k2.6) |

型号会随渠道调整增减，以 [模型广场](https://token.poryf.com/pricing) 和 [GET /v1/models](/api/list-models) 为准。

## 调用示例

<CodeGroup>
  ```bash curl theme={null}
  curl https://token.poryf.com/v1/chat/completions \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "kimi-k3",
      "messages": [
        { "role": "user", "content": "用三句话介绍一下你自己" }
      ],
      "max_tokens": 2048
    }'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="YOUR_API_KEY",
      base_url="https://token.poryf.com/v1",
  )

  response = client.chat.completions.create(
      model="kimi-k3",
      messages=[{"role": "user", "content": "用三句话介绍一下你自己"}],
      max_tokens=2048,
  )
  print(response.choices[0].message.content)
  ```
</CodeGroup>

换成其他型号，只需替换 `model`。需要逐字输出时加 `"stream": true`，见 [流式输出](/streaming)。

## 计费

* 按输入、输出、缓存命中 token 分别计价，每个型号只有一档单价。
* `kimi-k3` 另外对写入缓存的 token 计价。

实时单价见 [模型广场](https://token.poryf.com/pricing)，每次调用的实际用量与扣费见 [使用日志](https://token.poryf.com/usage-logs/common)。

<Note>
  * `max_tokens` 包含思考过程。推理型号设得太小时，额度可能全部用于思考，`content` 为空。
  * 本站文本模型目前不支持在对话中识别图片。
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.